Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/COPYING.txt +19 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/INSTALLER +1 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/LICENSE.txt +176 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/METADATA +63 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/RECORD +448 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/REQUESTED +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/WHEEL +6 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/entry_points.txt +4 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/top_level.txt +3 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestBuffer.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestSignatureMatching.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestStringEncoding.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestTreeFragment.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/__init__.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/__init__.py +1 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/__pycache__/__init__.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/refnanny.cpython-311-x86_64-linux-gnu.so +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/refnanny.pyx +192 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/TestCodeWriter.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/TestShadow.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/TestStringIOTree.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/__init__.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/xmlrunner.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/AsyncGen.c +1317 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Buffer.c +933 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/CppSupport.cpp +133 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Dataclasses.py +112 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Exceptions.c +1137 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/NumpyImportArray.c +46 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Optimize.c +1616 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Overflow.c +404 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/TypeConversion.c +1310 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/arrayarray.h +149 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/INSTALLER +1 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/RECORD +1137 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/entry_points.txt +2 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/top_level.txt +1 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/__init__.py +87 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/cluster.py +280 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/covering.py +57 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/edgelist.py +359 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/generators.py +603 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/matrix.py +167 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/flow/tests/gw1.gpickle.bz2 +3 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/traversal/tests/__pycache__/test_bfs.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/traversal/tests/test_edgebfs.py +147 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/__pycache__/__init__.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/__pycache__/atlas.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/__pycache__/nonisomorphic_trees.cpython-311.pyc +0 -0
- tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/tests/test_community.py +362 -0
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/COPYING.txt
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The original Pyrex code as of 2006-04 is licensed under the following
|
| 2 |
+
license: "Copyright stuff: Pyrex is free of restrictions. You may use,
|
| 3 |
+
redistribute, modify and distribute modified versions."
|
| 4 |
+
|
| 5 |
+
------------------
|
| 6 |
+
|
| 7 |
+
Cython, which derives from Pyrex, is licensed under the Apache 2.0
|
| 8 |
+
Software License. More precisely, all modifications and new code
|
| 9 |
+
made to go from Pyrex to Cython are so licensed.
|
| 10 |
+
|
| 11 |
+
See LICENSE.txt for more details.
|
| 12 |
+
|
| 13 |
+
------------------
|
| 14 |
+
|
| 15 |
+
The output of a Cython compilation is NOT considered a derivative
|
| 16 |
+
work of Cython. Specifically, though the compilation process may
|
| 17 |
+
embed snippets of varying lengths into the final output, these
|
| 18 |
+
snippets, as embedded in the output, do not encumber the resulting
|
| 19 |
+
output with any license restrictions.
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/LICENSE.txt
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
https://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/METADATA
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: Cython
|
| 3 |
+
Version: 3.0.11
|
| 4 |
+
Summary: The Cython compiler for writing C extensions in the Python language.
|
| 5 |
+
Home-page: https://cython.org/
|
| 6 |
+
Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al.
|
| 7 |
+
Author-email: cython-devel@python.org
|
| 8 |
+
License: Apache-2.0
|
| 9 |
+
Project-URL: Documentation, https://cython.readthedocs.io/
|
| 10 |
+
Project-URL: Donate, https://cython.readthedocs.io/en/latest/src/donating.html
|
| 11 |
+
Project-URL: Source Code, https://github.com/cython/cython
|
| 12 |
+
Project-URL: Bug Tracker, https://github.com/cython/cython/issues
|
| 13 |
+
Project-URL: User Group, https://groups.google.com/g/cython-users
|
| 14 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 15 |
+
Classifier: Intended Audience :: Developers
|
| 16 |
+
Classifier: License :: OSI Approved :: Apache Software License
|
| 17 |
+
Classifier: Operating System :: OS Independent
|
| 18 |
+
Classifier: Programming Language :: Python
|
| 19 |
+
Classifier: Programming Language :: Python :: 2
|
| 20 |
+
Classifier: Programming Language :: Python :: 2.7
|
| 21 |
+
Classifier: Programming Language :: Python :: 3
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.4
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.5
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.6
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 26 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 27 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 28 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 29 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 30 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 31 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 32 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 33 |
+
Classifier: Programming Language :: C
|
| 34 |
+
Classifier: Programming Language :: Cython
|
| 35 |
+
Classifier: Topic :: Software Development :: Code Generators
|
| 36 |
+
Classifier: Topic :: Software Development :: Compilers
|
| 37 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 38 |
+
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
|
| 39 |
+
License-File: LICENSE.txt
|
| 40 |
+
License-File: COPYING.txt
|
| 41 |
+
|
| 42 |
+
The Cython language makes writing C extensions for the Python language as
|
| 43 |
+
easy as Python itself. Cython is a source code translator based on Pyrex_,
|
| 44 |
+
but supports more cutting edge functionality and optimizations.
|
| 45 |
+
|
| 46 |
+
The Cython language is a superset of the Python language (almost all Python
|
| 47 |
+
code is also valid Cython code), but Cython additionally supports optional
|
| 48 |
+
static typing to natively call C functions, operate with C++ classes and
|
| 49 |
+
declare fast C types on variables and class attributes. This allows the
|
| 50 |
+
compiler to generate very efficient C code from Cython code.
|
| 51 |
+
|
| 52 |
+
This makes Cython the ideal language for writing glue code for external
|
| 53 |
+
C/C++ libraries, and for fast C modules that speed up the execution of
|
| 54 |
+
Python code.
|
| 55 |
+
|
| 56 |
+
Note that for one-time builds, e.g. for CI/testing, on platforms that are not
|
| 57 |
+
covered by one of the wheel packages provided on PyPI *and* the pure Python wheel
|
| 58 |
+
that we provide is not used, it is substantially faster than a full source build
|
| 59 |
+
to install an uncompiled (slower) version of Cython with::
|
| 60 |
+
|
| 61 |
+
pip install Cython --install-option="--no-cython-compile"
|
| 62 |
+
|
| 63 |
+
.. _Pyrex: https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/RECORD
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../bin/cygdb,sha256=g-Go7XeWUFVdXEPEVDQHGpqa23ppoRMJpqF-QoAlzk4,269
|
| 2 |
+
../../../bin/cython,sha256=XT1SfQF1nJkmzeNpBoKzlWDn9N67r3T8Y5RQb0QXPoE,290
|
| 3 |
+
../../../bin/cythonize,sha256=TjNjnx44QGxed0b6m9mQFpomjDUebKiFMjap51LAfU4,270
|
| 4 |
+
Cython-3.0.11.dist-info/COPYING.txt,sha256=4escSahQjoFz2sMBV-SmQ5pErYhGGUdGxCT7w_wrldc,756
|
| 5 |
+
Cython-3.0.11.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 6 |
+
Cython-3.0.11.dist-info/LICENSE.txt,sha256=lWiisVXmasPguh_YC1K4J7lGDmz28jMSXny8qOIG3cM,10174
|
| 7 |
+
Cython-3.0.11.dist-info/METADATA,sha256=Olx-spBXM1wCz95fdBSflhN68RCfBJpc64eq2YTsU4M,3161
|
| 8 |
+
Cython-3.0.11.dist-info/RECORD,,
|
| 9 |
+
Cython-3.0.11.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 10 |
+
Cython-3.0.11.dist-info/WHEEL,sha256=5Y454O0emXuKMOybDQevJmMdyxBqrxVayhyCIJ_fxN0,151
|
| 11 |
+
Cython-3.0.11.dist-info/entry_points.txt,sha256=VU8NX8gnQyFbyqiWMzfh9BHvYMuoQRS3Nbm3kKcKQeY,139
|
| 12 |
+
Cython-3.0.11.dist-info/top_level.txt,sha256=jLV8tZV98iCbIfiJR4DVzTX5Ru1Y_pYMZ59wkMCe6SY,24
|
| 13 |
+
Cython/Build/BuildExecutable.py,sha256=jl36W_HYIHVuVUtN6iBnDBKA4oZsT1Z3bYx1AR9G8Ys,4789
|
| 14 |
+
Cython/Build/Cythonize.py,sha256=HYib-gx-ARKQc5p-GNOwVzYF0TzUEbzvl0sS-nOGyoI,9830
|
| 15 |
+
Cython/Build/Dependencies.py,sha256=B4aRLzFxuc7kUtRUcmAxVQh4s9LRGZpVUyOGEYdnPq4,52930
|
| 16 |
+
Cython/Build/Distutils.py,sha256=iO5tPX84Kc-ZWMocfuQbl_PqyC9HGGIRS-NiKI60-ZE,49
|
| 17 |
+
Cython/Build/Inline.py,sha256=E4IRWhPzRuoaYF0hbAxBLLP5j2aUXWhHZo5JL8uKC2k,13387
|
| 18 |
+
Cython/Build/IpythonMagic.py,sha256=D8BRzCzPt5Dji7PqTdZEU9NVxmAo65COaCLE5wLwn8c,21966
|
| 19 |
+
Cython/Build/Tests/TestCyCache.py,sha256=4p0k5OfCdWCUVzp_-iVyYTYB9ey6mlKF92WxEehj0ZM,4467
|
| 20 |
+
Cython/Build/Tests/TestCythonizeArgsParser.py,sha256=_ijPP5tDvaeiUtuxUawlOZ8P4dcnkOOUJoze2OAbW4A,20346
|
| 21 |
+
Cython/Build/Tests/TestDependencies.py,sha256=Bt7ERe6WQoZaVjYDZGPuNzYZyv5dEIbtj59-9AK_AlY,5835
|
| 22 |
+
Cython/Build/Tests/TestInline.py,sha256=Ct_KmRN-hhdrx91xB_RILcjaPA4_bxZiCD-8F8NXiUo,3487
|
| 23 |
+
Cython/Build/Tests/TestIpythonMagic.py,sha256=uQECO6yjMmcqLbx5fQ17TP0QJdOvc2hgAuLqFWWeKTw,9411
|
| 24 |
+
Cython/Build/Tests/TestRecythonize.py,sha256=6un9tt8-I1YiFJo9xXRWqe0aUndMfHwrwA0h81Emhwc,6276
|
| 25 |
+
Cython/Build/Tests/TestStripLiterals.py,sha256=D6F9NRbQXO7bHdqugpUnJF8iSjqs8xW_99ViP9ouhzc,1549
|
| 26 |
+
Cython/Build/Tests/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 27 |
+
Cython/Build/Tests/__pycache__/TestCyCache.cpython-311.pyc,,
|
| 28 |
+
Cython/Build/Tests/__pycache__/TestCythonizeArgsParser.cpython-311.pyc,,
|
| 29 |
+
Cython/Build/Tests/__pycache__/TestDependencies.cpython-311.pyc,,
|
| 30 |
+
Cython/Build/Tests/__pycache__/TestInline.cpython-311.pyc,,
|
| 31 |
+
Cython/Build/Tests/__pycache__/TestIpythonMagic.cpython-311.pyc,,
|
| 32 |
+
Cython/Build/Tests/__pycache__/TestRecythonize.cpython-311.pyc,,
|
| 33 |
+
Cython/Build/Tests/__pycache__/TestStripLiterals.cpython-311.pyc,,
|
| 34 |
+
Cython/Build/Tests/__pycache__/__init__.cpython-311.pyc,,
|
| 35 |
+
Cython/Build/__init__.py,sha256=cxv1BKTFfuE10D5-MObSiFogR4dUpaQYFz-CLaHj9KU,401
|
| 36 |
+
Cython/Build/__pycache__/BuildExecutable.cpython-311.pyc,,
|
| 37 |
+
Cython/Build/__pycache__/Cythonize.cpython-311.pyc,,
|
| 38 |
+
Cython/Build/__pycache__/Dependencies.cpython-311.pyc,,
|
| 39 |
+
Cython/Build/__pycache__/Distutils.cpython-311.pyc,,
|
| 40 |
+
Cython/Build/__pycache__/Inline.cpython-311.pyc,,
|
| 41 |
+
Cython/Build/__pycache__/IpythonMagic.cpython-311.pyc,,
|
| 42 |
+
Cython/Build/__pycache__/__init__.cpython-311.pyc,,
|
| 43 |
+
Cython/CodeWriter.py,sha256=Yy4_ZSzZgnZ9_FmawxqBKd4frnshp1b7GupWuU6iKl0,24546
|
| 44 |
+
Cython/Compiler/AnalysedTreeTransforms.py,sha256=LuwGJWnk-scpz_9TnKw1Lq0j4yNf5vCGO_NQ-GGupas,3834
|
| 45 |
+
Cython/Compiler/Annotate.py,sha256=pYe_z56bqtzhSx3hvLS1K8ML36jMjWlFeaek_drOdLs,14153
|
| 46 |
+
Cython/Compiler/AutoDocTransforms.py,sha256=sOPbdvRyU9c2k382ZtgQSFtjG7Jm21n5UAXpLAGLDYE,11738
|
| 47 |
+
Cython/Compiler/Buffer.py,sha256=FalM1FoOOh9t9hXBofnSP5NKM5iYDLpnpZVweis_qrM,29304
|
| 48 |
+
Cython/Compiler/Builtin.py,sha256=pIh5cqcFCb2-eW5oN3rifcG0h-eV-d5oPmLm_3FB7O0,32067
|
| 49 |
+
Cython/Compiler/CmdLine.py,sha256=_m_rMfIT48gl1CrqpY2h7QfRaWjyTHV3YBRBThd7bUk,12526
|
| 50 |
+
Cython/Compiler/Code.cpython-311-x86_64-linux-gnu.so,sha256=TZRhA8tbib2yQ3uv6brSMl1ipEOTXzZ00xyjx_EVKjk,1342888
|
| 51 |
+
Cython/Compiler/Code.pxd,sha256=sx9jxBWoCmvfm_aR9IsfnqE69iNFn_fFe5y-WMfRqEQ,3548
|
| 52 |
+
Cython/Compiler/Code.py,sha256=QOtZC7V2v98BrLPZSA9gA3NcvL2vEm7mwMooUczvADI,104762
|
| 53 |
+
Cython/Compiler/CodeGeneration.py,sha256=jkcx2uX07nck0UZSgysIThRuJiPbdkSeXR4Z2uzbQU8,1108
|
| 54 |
+
Cython/Compiler/CythonScope.py,sha256=4GqELgqDRlQ7bl1FKb47XrcWyYFDYgVstCXHr7yQKUQ,6863
|
| 55 |
+
Cython/Compiler/Dataclass.py,sha256=Awfvdai0Yn2GA6IZSYvYP4WXRgoMfT9I_HD4gHudjGk,36032
|
| 56 |
+
Cython/Compiler/DebugFlags.py,sha256=5Zg9ETp0qPFEma6QMtrGUwu9Fn6NTYMBMWPI_GxFW0A,623
|
| 57 |
+
Cython/Compiler/Errors.py,sha256=_RsCSRTURcZaTtZeGp1TAJiSaXQDLkVBdWv6qa49AW0,9312
|
| 58 |
+
Cython/Compiler/ExprNodes.py,sha256=rvxKVAu2gxiWd6YcaTxrOB0KVN_TivcFTmV8yZ7i-0E,602024
|
| 59 |
+
Cython/Compiler/FlowControl.cpython-311-x86_64-linux-gnu.so,sha256=sse5GrBzH1Zy2XbUQI81JYkbjE4dTtTUA_VtHBQcf5Q,688080
|
| 60 |
+
Cython/Compiler/FlowControl.pxd,sha256=C6se5i0mW-m-wUCa7HOzcuGW4R8All8HOBsIB66p_0A,2979
|
| 61 |
+
Cython/Compiler/FlowControl.py,sha256=3UrRUUR9SliUR7zf_3qATAHd-Xs5ak-bq_QvFtqR60Y,48862
|
| 62 |
+
Cython/Compiler/FusedNode.cpython-311-x86_64-linux-gnu.so,sha256=AkmMt-MwoafMrisUKTjDw8AdgHUdBvmt5jusOfKraBo,517064
|
| 63 |
+
Cython/Compiler/FusedNode.py,sha256=NhZwm2QjIVyHY8Nghz0BIWQn6mXtKpr8VY8PG_0E8OA,43360
|
| 64 |
+
Cython/Compiler/Future.py,sha256=NFtSWCJYqPlEqWZ5Ob_bv_pDfW6iS7pPYWeGH1OGA5g,629
|
| 65 |
+
Cython/Compiler/Interpreter.py,sha256=6wJEJMtz22OoVi49qUZn9ILYevb50vqjqKAteu7lh04,2114
|
| 66 |
+
Cython/Compiler/Lexicon.py,sha256=LmKi6ZqoC-NZDIL86U8L4EGkWVLgHojZQNgUKECkBco,21772
|
| 67 |
+
Cython/Compiler/Main.py,sha256=vv59zMvZnHI5oIkJeTxZSRLYx555TkXu_CcTVzXufkY,32205
|
| 68 |
+
Cython/Compiler/MemoryView.py,sha256=yTDgrvFvjcjIURylob910mMQNTPPmXg7Gh_drqALAfg,30382
|
| 69 |
+
Cython/Compiler/ModuleNode.py,sha256=uhiBxur0D9s-54PCIZRhyVoR7ASHCM4FjH2qVdtVHb0,184020
|
| 70 |
+
Cython/Compiler/Naming.py,sha256=YTKzc5XKvkx8vAqDZmgl45ExnR0QSbZiiNhIev5K1jQ,8160
|
| 71 |
+
Cython/Compiler/Nodes.py,sha256=fuNGOVJP6amUxJCgV7bsfulV_OTbmadmxTRRL4xPm8o,442392
|
| 72 |
+
Cython/Compiler/Optimize.py,sha256=s_sPuYACU4oVACRcoAKoFecyVZ5eU9FfITHhCQahYrw,226603
|
| 73 |
+
Cython/Compiler/Options.py,sha256=ci8mtRDVvl-Mtmcn2UUT40PwAZNjWQ54J4T4zrAQs10,30646
|
| 74 |
+
Cython/Compiler/ParseTreeTransforms.pxd,sha256=1YVH1stZcLYswszLUBMJd4W8wPTik4MCpG4yfNeSh7Y,2583
|
| 75 |
+
Cython/Compiler/ParseTreeTransforms.py,sha256=oDECNyLNwVF3wEuM03DdrLg9fnqH-nEA8Ka1O0TPVqo,171534
|
| 76 |
+
Cython/Compiler/Parsing.cpython-311-x86_64-linux-gnu.so,sha256=cQpeVpAAqGl5Dkdxp3dYk1-stpw7aZroi75lufK_mKI,1170440
|
| 77 |
+
Cython/Compiler/Parsing.pxd,sha256=LomEHtmDKOIroiWpJbrHEcz9-wQP3Jl7jj8PjuLVG10,9166
|
| 78 |
+
Cython/Compiler/Parsing.py,sha256=kRT-rhRpEEwTk3fNABKm0uRh6is5yXH-YCc1U4YENIU,139740
|
| 79 |
+
Cython/Compiler/Pipeline.py,sha256=jNfU_et2wc_HfSSY3LA633OK5FmScceK1zOZKsvlAtM,15631
|
| 80 |
+
Cython/Compiler/PyrexTypes.py,sha256=V_bCmCHwOUkpidMt8APwd02ScK4wbRRHF-U5cbLuIPA,208736
|
| 81 |
+
Cython/Compiler/Pythran.py,sha256=NHIml0yx0jPLyTLRAHXZr0LHTyEyfYqspgYuV4vdNKI,7267
|
| 82 |
+
Cython/Compiler/Scanning.cpython-311-x86_64-linux-gnu.so,sha256=NbvXcI5h1rLUcExxOQGNPq5nvKMD2foDIotQhF9v_-Y,340320
|
| 83 |
+
Cython/Compiler/Scanning.pxd,sha256=ivsDKJzsh6FggfiybEVq3NJ_b6_qIHvi8rPkDLSVTtE,2071
|
| 84 |
+
Cython/Compiler/Scanning.py,sha256=w-aGbQMGXqNBckE87bFDTl1w_lHN4H4-SCwMSh-gZvI,20114
|
| 85 |
+
Cython/Compiler/StringEncoding.py,sha256=wepb0J7NZ9HhahxC0DqL41fWsVl-2I6l95UL1jdYn68,11728
|
| 86 |
+
Cython/Compiler/Symtab.py,sha256=o0q6PYxCE5XFsjaahIjofZfQ-dttPcK7i5vYS5kMqPU,129778
|
| 87 |
+
Cython/Compiler/Tests/TestBuffer.py,sha256=SDAkH2fjCsiaAisWQcBdNX3JxG1KcEEIQJbsnNeIWuk,4156
|
| 88 |
+
Cython/Compiler/Tests/TestCmdLine.py,sha256=ONYLPSMwq4kEYMje-TmQuWzEgNkWkD-RKTmvWDvxtsk,21844
|
| 89 |
+
Cython/Compiler/Tests/TestFlowControl.py,sha256=ge3iqBor6xe5MLaLbOtw7ETntJnAh8EequF1aetVzMw,1848
|
| 90 |
+
Cython/Compiler/Tests/TestGrammar.py,sha256=SbHXzaLnYEcN_D2q6mOIcb0Rd-6cof49LCCYjIPFY4g,5128
|
| 91 |
+
Cython/Compiler/Tests/TestMemView.py,sha256=kytAp-r-DMTuviujoFcA7DhsiofOjnArA0WpJ2j3E1o,2517
|
| 92 |
+
Cython/Compiler/Tests/TestParseTreeTransforms.py,sha256=XbGkHi_fqoZENjQZYp7cMReeF-zg-mpujNaw5LjvdgY,8926
|
| 93 |
+
Cython/Compiler/Tests/TestScanning.py,sha256=SpVM6-4MstnJQUuvFEhXZBEy8n2oPkPguvsb9Y3kI4o,4771
|
| 94 |
+
Cython/Compiler/Tests/TestSignatureMatching.py,sha256=tDlQks1mgo2MIPBW_uC5YkoZt0RjPGYAdluk1j82IvM,3342
|
| 95 |
+
Cython/Compiler/Tests/TestStringEncoding.py,sha256=RL1YDXrOUe1sPLEbWmTJQ5VF-uEZ_KLz0jaeQoMx85k,2315
|
| 96 |
+
Cython/Compiler/Tests/TestTreeFragment.py,sha256=0VywSuhoyluLITx0w-BQ8HYES3TQ5UW0NcGQhjX4qxk,2166
|
| 97 |
+
Cython/Compiler/Tests/TestTreePath.py,sha256=VHOJU30i8GuDWQo3gUL8he0C7wKHENI5wy9t6KU-qII,4192
|
| 98 |
+
Cython/Compiler/Tests/TestTypes.py,sha256=Uo1wWZPgaRbv-leWXmuoqXx_HkY9oPgBAIRI5XulF-Y,3334
|
| 99 |
+
Cython/Compiler/Tests/TestUtilityLoad.py,sha256=5zuAYD_RuRW_KDl2cfA9aXCJ_G-LlDA9pIF4zbqeZlg,3923
|
| 100 |
+
Cython/Compiler/Tests/TestVisitor.py,sha256=QAnBpUhnirSFKqXWiawo-OhXhxIRTQidWxEzGjJDz6M,2228
|
| 101 |
+
Cython/Compiler/Tests/Utils.py,sha256=ChgJ0EeGJRc_ZkNVjZFvFzk1tOj6dxjkW6X1BBot1Hc,1065
|
| 102 |
+
Cython/Compiler/Tests/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 103 |
+
Cython/Compiler/Tests/__pycache__/TestBuffer.cpython-311.pyc,,
|
| 104 |
+
Cython/Compiler/Tests/__pycache__/TestCmdLine.cpython-311.pyc,,
|
| 105 |
+
Cython/Compiler/Tests/__pycache__/TestFlowControl.cpython-311.pyc,,
|
| 106 |
+
Cython/Compiler/Tests/__pycache__/TestGrammar.cpython-311.pyc,,
|
| 107 |
+
Cython/Compiler/Tests/__pycache__/TestMemView.cpython-311.pyc,,
|
| 108 |
+
Cython/Compiler/Tests/__pycache__/TestParseTreeTransforms.cpython-311.pyc,,
|
| 109 |
+
Cython/Compiler/Tests/__pycache__/TestScanning.cpython-311.pyc,,
|
| 110 |
+
Cython/Compiler/Tests/__pycache__/TestSignatureMatching.cpython-311.pyc,,
|
| 111 |
+
Cython/Compiler/Tests/__pycache__/TestStringEncoding.cpython-311.pyc,,
|
| 112 |
+
Cython/Compiler/Tests/__pycache__/TestTreeFragment.cpython-311.pyc,,
|
| 113 |
+
Cython/Compiler/Tests/__pycache__/TestTreePath.cpython-311.pyc,,
|
| 114 |
+
Cython/Compiler/Tests/__pycache__/TestTypes.cpython-311.pyc,,
|
| 115 |
+
Cython/Compiler/Tests/__pycache__/TestUtilityLoad.cpython-311.pyc,,
|
| 116 |
+
Cython/Compiler/Tests/__pycache__/TestVisitor.cpython-311.pyc,,
|
| 117 |
+
Cython/Compiler/Tests/__pycache__/Utils.cpython-311.pyc,,
|
| 118 |
+
Cython/Compiler/Tests/__pycache__/__init__.cpython-311.pyc,,
|
| 119 |
+
Cython/Compiler/TreeFragment.py,sha256=GuKBbSDCwWD77FacP9iHVvBHghBBfYrAvIgB4mxW5cE,9709
|
| 120 |
+
Cython/Compiler/TreePath.py,sha256=3_lScMAd2Sly2ekZ8HO8dyZstGSruINl2MXXq9OYd2Q,7641
|
| 121 |
+
Cython/Compiler/TypeInference.py,sha256=PQHeR9d8EFloyWVuVv6CNPri4G9nTNPyCQzcsfgNeBs,22725
|
| 122 |
+
Cython/Compiler/TypeSlots.py,sha256=s0fmpCT07y85yDnrNZsa_DZvdfc07SiVVX-f_9hxf_g,50443
|
| 123 |
+
Cython/Compiler/UFuncs.py,sha256=KNCawVbwvmUanYTqxG73AJhlIRFIJA6BjYLcKWiidiQ,9166
|
| 124 |
+
Cython/Compiler/UtilNodes.py,sha256=QYfoLIIYKlbmG-IoO2-hTJDShl9pM12SAHb_G5QPwgY,12463
|
| 125 |
+
Cython/Compiler/UtilityCode.py,sha256=yRSZAzXEQq4AuGR278ZFiZCXSoArylcf_cCgVsXDRnA,10952
|
| 126 |
+
Cython/Compiler/Version.py,sha256=f2mS6aYYdu0DMRK3B4IuzMlCo-k-ffmehCao_vKlTdk,181
|
| 127 |
+
Cython/Compiler/Visitor.cpython-311-x86_64-linux-gnu.so,sha256=hZfxmFgE9sDFW4TSmodE8OK8ZgCqppVAJJn7u8uh3sw,374848
|
| 128 |
+
Cython/Compiler/Visitor.pxd,sha256=AsYd6v_MyVWzs2AVj0siG_92JGnKhxEYk89oAbhHa64,1814
|
| 129 |
+
Cython/Compiler/Visitor.py,sha256=c5Xu4v2LTwhxBp_Ign24WXMThddN0OZ_7gZ53aCHOAo,31627
|
| 130 |
+
Cython/Compiler/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 131 |
+
Cython/Compiler/__pycache__/AnalysedTreeTransforms.cpython-311.pyc,,
|
| 132 |
+
Cython/Compiler/__pycache__/Annotate.cpython-311.pyc,,
|
| 133 |
+
Cython/Compiler/__pycache__/AutoDocTransforms.cpython-311.pyc,,
|
| 134 |
+
Cython/Compiler/__pycache__/Buffer.cpython-311.pyc,,
|
| 135 |
+
Cython/Compiler/__pycache__/Builtin.cpython-311.pyc,,
|
| 136 |
+
Cython/Compiler/__pycache__/CmdLine.cpython-311.pyc,,
|
| 137 |
+
Cython/Compiler/__pycache__/Code.cpython-311.pyc,,
|
| 138 |
+
Cython/Compiler/__pycache__/CodeGeneration.cpython-311.pyc,,
|
| 139 |
+
Cython/Compiler/__pycache__/CythonScope.cpython-311.pyc,,
|
| 140 |
+
Cython/Compiler/__pycache__/Dataclass.cpython-311.pyc,,
|
| 141 |
+
Cython/Compiler/__pycache__/DebugFlags.cpython-311.pyc,,
|
| 142 |
+
Cython/Compiler/__pycache__/Errors.cpython-311.pyc,,
|
| 143 |
+
Cython/Compiler/__pycache__/ExprNodes.cpython-311.pyc,,
|
| 144 |
+
Cython/Compiler/__pycache__/FlowControl.cpython-311.pyc,,
|
| 145 |
+
Cython/Compiler/__pycache__/FusedNode.cpython-311.pyc,,
|
| 146 |
+
Cython/Compiler/__pycache__/Future.cpython-311.pyc,,
|
| 147 |
+
Cython/Compiler/__pycache__/Interpreter.cpython-311.pyc,,
|
| 148 |
+
Cython/Compiler/__pycache__/Lexicon.cpython-311.pyc,,
|
| 149 |
+
Cython/Compiler/__pycache__/Main.cpython-311.pyc,,
|
| 150 |
+
Cython/Compiler/__pycache__/MemoryView.cpython-311.pyc,,
|
| 151 |
+
Cython/Compiler/__pycache__/ModuleNode.cpython-311.pyc,,
|
| 152 |
+
Cython/Compiler/__pycache__/Naming.cpython-311.pyc,,
|
| 153 |
+
Cython/Compiler/__pycache__/Nodes.cpython-311.pyc,,
|
| 154 |
+
Cython/Compiler/__pycache__/Optimize.cpython-311.pyc,,
|
| 155 |
+
Cython/Compiler/__pycache__/Options.cpython-311.pyc,,
|
| 156 |
+
Cython/Compiler/__pycache__/ParseTreeTransforms.cpython-311.pyc,,
|
| 157 |
+
Cython/Compiler/__pycache__/Parsing.cpython-311.pyc,,
|
| 158 |
+
Cython/Compiler/__pycache__/Pipeline.cpython-311.pyc,,
|
| 159 |
+
Cython/Compiler/__pycache__/PyrexTypes.cpython-311.pyc,,
|
| 160 |
+
Cython/Compiler/__pycache__/Pythran.cpython-311.pyc,,
|
| 161 |
+
Cython/Compiler/__pycache__/Scanning.cpython-311.pyc,,
|
| 162 |
+
Cython/Compiler/__pycache__/StringEncoding.cpython-311.pyc,,
|
| 163 |
+
Cython/Compiler/__pycache__/Symtab.cpython-311.pyc,,
|
| 164 |
+
Cython/Compiler/__pycache__/TreeFragment.cpython-311.pyc,,
|
| 165 |
+
Cython/Compiler/__pycache__/TreePath.cpython-311.pyc,,
|
| 166 |
+
Cython/Compiler/__pycache__/TypeInference.cpython-311.pyc,,
|
| 167 |
+
Cython/Compiler/__pycache__/TypeSlots.cpython-311.pyc,,
|
| 168 |
+
Cython/Compiler/__pycache__/UFuncs.cpython-311.pyc,,
|
| 169 |
+
Cython/Compiler/__pycache__/UtilNodes.cpython-311.pyc,,
|
| 170 |
+
Cython/Compiler/__pycache__/UtilityCode.cpython-311.pyc,,
|
| 171 |
+
Cython/Compiler/__pycache__/Version.cpython-311.pyc,,
|
| 172 |
+
Cython/Compiler/__pycache__/Visitor.cpython-311.pyc,,
|
| 173 |
+
Cython/Compiler/__pycache__/__init__.cpython-311.pyc,,
|
| 174 |
+
Cython/Coverage.py,sha256=prYNxj3ML6UaI_UVOhROd54GBwRgrt_Fa71vVlrEPbk,18461
|
| 175 |
+
Cython/Debugger/Cygdb.py,sha256=8k5Wz09MSQdiUtCVtb0dMukKqZV7E8fvB9Yvv3rfJCI,6911
|
| 176 |
+
Cython/Debugger/DebugWriter.py,sha256=OoywNqkq5IyRRAvlcaaZ05zDrJMgNgg7O6wMVdltr5k,2486
|
| 177 |
+
Cython/Debugger/Tests/TestLibCython.py,sha256=T6qGlhSlrXwI5cn2OpWa82tZ51UjVm9qmmk9Mfho1p4,8455
|
| 178 |
+
Cython/Debugger/Tests/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 179 |
+
Cython/Debugger/Tests/__pycache__/TestLibCython.cpython-311.pyc,,
|
| 180 |
+
Cython/Debugger/Tests/__pycache__/__init__.cpython-311.pyc,,
|
| 181 |
+
Cython/Debugger/Tests/__pycache__/test_libcython_in_gdb.cpython-311.pyc,,
|
| 182 |
+
Cython/Debugger/Tests/__pycache__/test_libpython_in_gdb.cpython-311.pyc,,
|
| 183 |
+
Cython/Debugger/Tests/cfuncs.c,sha256=4SZurmnz5J1SiIs9N26Eu4zc2wvF_qMEKaN0eTcbDPo,71
|
| 184 |
+
Cython/Debugger/Tests/codefile,sha256=axsI884lThsoLMg2vlQJ6BPG8t9vil0mTDs_Pi7vuwI,642
|
| 185 |
+
Cython/Debugger/Tests/test_libcython_in_gdb.py,sha256=8JDbj3CbmQrB7cFP7yThiHlgIS4QrdvQYMLGEoHuE7A,18048
|
| 186 |
+
Cython/Debugger/Tests/test_libpython_in_gdb.py,sha256=fjXO3VgT0sYcAaV2vpx2oJDJ7MsQmXTG3IOge7QnnU0,4049
|
| 187 |
+
Cython/Debugger/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 188 |
+
Cython/Debugger/__pycache__/Cygdb.cpython-311.pyc,,
|
| 189 |
+
Cython/Debugger/__pycache__/DebugWriter.cpython-311.pyc,,
|
| 190 |
+
Cython/Debugger/__pycache__/__init__.cpython-311.pyc,,
|
| 191 |
+
Cython/Debugger/__pycache__/libcython.cpython-311.pyc,,
|
| 192 |
+
Cython/Debugger/__pycache__/libpython.cpython-311.pyc,,
|
| 193 |
+
Cython/Debugger/libcython.py,sha256=70z-fpmKeAj7Blk9FImlDXfFyNsU848IPzaWZYDITvE,46538
|
| 194 |
+
Cython/Debugger/libpython.py,sha256=crnRuil2PPaXZz0wp6AZ-dabnFXzji0PcLQyMJB9e5Y,94004
|
| 195 |
+
Cython/Debugging.py,sha256=vFtJhn7QstMf5gnYru2qHIz5ZjPg1KSlZVGHr-pBCwM,552
|
| 196 |
+
Cython/Distutils/__init__.py,sha256=uyWaN2NJ_mKYLzVsDPi0qZCdIYoW5M_7YYEmAOIL3Ek,98
|
| 197 |
+
Cython/Distutils/__pycache__/__init__.cpython-311.pyc,,
|
| 198 |
+
Cython/Distutils/__pycache__/build_ext.cpython-311.pyc,,
|
| 199 |
+
Cython/Distutils/__pycache__/extension.cpython-311.pyc,,
|
| 200 |
+
Cython/Distutils/__pycache__/old_build_ext.cpython-311.pyc,,
|
| 201 |
+
Cython/Distutils/build_ext.py,sha256=QCoEpEMz3NQ2s6kQtUB743zeuIFVdIz5VkADtqYbkeE,5708
|
| 202 |
+
Cython/Distutils/extension.py,sha256=tnMDR7SMrWDh2tQjC7fHtptlKhYXvf0HiveMLGQjIJ0,4640
|
| 203 |
+
Cython/Distutils/old_build_ext.py,sha256=jb7aERJvis6xrIJCPnRQjF2O-xjj4jYltMvDRodQAtg,13825
|
| 204 |
+
Cython/Includes/cpython/__init__.pxd,sha256=imlSN5iR-xZ9Ep9tw_6WqTLaVn6vO5tXYHhVxv1u82o,8306
|
| 205 |
+
Cython/Includes/cpython/array.pxd,sha256=0laAK0ujw6gtzgfqzWWmckRQe0-SQ5smhAqXKNpJCWg,6367
|
| 206 |
+
Cython/Includes/cpython/bool.pxd,sha256=5RU6XY57iZ-xtngjXswJoBOxn1ClZdkcXWHQiZ2k6fg,1358
|
| 207 |
+
Cython/Includes/cpython/buffer.pxd,sha256=wm7aHygGUof_H3-JyICOek_xiU6Oks178ark1Nfk-a0,4870
|
| 208 |
+
Cython/Includes/cpython/bytearray.pxd,sha256=m0VdoHgouF1T0VtRjFLXZ5fi22vaMdVwFWpF3IxB6m4,1443
|
| 209 |
+
Cython/Includes/cpython/bytes.pxd,sha256=OH9krgA2CLdcNJWOM0PpgMskbh5vnq6fjjj1lzYOhOU,10066
|
| 210 |
+
Cython/Includes/cpython/cellobject.pxd,sha256=DXdTjSN1RP1m4CsaGuggyIA1nGiIO4Kr7-c0ZWfrpRo,1390
|
| 211 |
+
Cython/Includes/cpython/ceval.pxd,sha256=h6fBetZCUvWTcCn3bkXZg2kqnIuyC5ZSChyhOocxVus,236
|
| 212 |
+
Cython/Includes/cpython/cobject.pxd,sha256=ZeMdbpZLqpcTywdv2VoppMTWD4X_yghL6Qox7LVfOyg,1524
|
| 213 |
+
Cython/Includes/cpython/codecs.pxd,sha256=3fyudEljkNGQ7e3dJPst6udXGcAeNKvlMK9U8EB1gXc,5084
|
| 214 |
+
Cython/Includes/cpython/complex.pxd,sha256=B_ondPAPNM7nSJtgMPKZgWxFHldPxBqG63spwK4t9_Y,1842
|
| 215 |
+
Cython/Includes/cpython/contextvars.pxd,sha256=HoNxGtIIZOLEuSclvOizjkSAwhLtOZWzg8j8YZa_RT8,5731
|
| 216 |
+
Cython/Includes/cpython/conversion.pxd,sha256=dbbFuZJF0SscmcaNCUf0tlBQDRdKYf5tH8yzhTU_XYI,1696
|
| 217 |
+
Cython/Includes/cpython/datetime.pxd,sha256=uoyukvbgigbAVXMVUFd6pwvUViAUHfZvuNPiA0nqETU,15793
|
| 218 |
+
Cython/Includes/cpython/descr.pxd,sha256=RPSPJUxyejKsWruYS3IWU1rg0L1pKFAYidYcXW9YAj0,728
|
| 219 |
+
Cython/Includes/cpython/dict.pxd,sha256=U1FHJRnYf2GZcVReNEATzeOa8s5PlAD539MQigbOASc,7939
|
| 220 |
+
Cython/Includes/cpython/exc.pxd,sha256=0pI7VcDnMLqf-S_BClRgoiH2xGyDbhlmFGWOKcn3sGM,13830
|
| 221 |
+
Cython/Includes/cpython/fileobject.pxd,sha256=yQG3M9wfS2jwpgSTo-8oXx8K9xnpGIkL-etQt9YDwTU,2889
|
| 222 |
+
Cython/Includes/cpython/float.pxd,sha256=Gmf5SzLRCZOMd-deD35PgOlRGsrcwhQw__E4igmqKdc,1650
|
| 223 |
+
Cython/Includes/cpython/function.pxd,sha256=IoJUprbz8F10DEKh-vSSpY6nWkCHw7SqG9p2f-4gHek,2671
|
| 224 |
+
Cython/Includes/cpython/genobject.pxd,sha256=emC1JPgkuvBbGC0rgeZapKDaXYEj48uWiDC-xF0Mx2I,1052
|
| 225 |
+
Cython/Includes/cpython/getargs.pxd,sha256=268twKzdiAkQMXMsetNiNlNqaqzlKtiBENKbhOHd8x4,775
|
| 226 |
+
Cython/Includes/cpython/instance.pxd,sha256=qCbxPeHKOJbuszDu3UEaI-KLX9lTopuaNCcpoHJ9ngU,985
|
| 227 |
+
Cython/Includes/cpython/int.pxd,sha256=d9a0zUw_M3pRycCESWIjtfXWRvdvFOWxjdOjkcbX2gs,4131
|
| 228 |
+
Cython/Includes/cpython/iterator.pxd,sha256=o52mLHbdm14Kqant2hR2zAdYzqK4fkSWZtBcRmpoP-I,1319
|
| 229 |
+
Cython/Includes/cpython/iterobject.pxd,sha256=5UEZZwG5zyzxoCpknoQuh91zPUV11Uxr6F1taJdTv8k,1036
|
| 230 |
+
Cython/Includes/cpython/list.pxd,sha256=HhnwchBGhPIAoObzIXyg33KqvSxBRveWoq34iZM508s,4096
|
| 231 |
+
Cython/Includes/cpython/long.pxd,sha256=1gN-O5AcV4B_r974qxW9YDr7NedDyDrTRjOelClvoyA,7047
|
| 232 |
+
Cython/Includes/cpython/longintrepr.pxd,sha256=czvKr3fQdYIwIRu3gojXssT9LFXH-nstM7f_lPt7lE4,480
|
| 233 |
+
Cython/Includes/cpython/mapping.pxd,sha256=DI5_kOp78IaYx77qIWpetu13iMEgGXZew84mTsCPYtM,2692
|
| 234 |
+
Cython/Includes/cpython/marshal.pxd,sha256=-Tl2w_7VfgzrCSq1gpBIEZRADw1g1zZNMdPXz4YJClE,2897
|
| 235 |
+
Cython/Includes/cpython/mem.pxd,sha256=O8I4rWJj7VvrlYjPpR-Dhls5izYddgO5rNyAOAzWUQQ,5912
|
| 236 |
+
Cython/Includes/cpython/memoryview.pxd,sha256=l97J5-hbH3hp9aMbdXp3n73hJFNNsng6uyh40pc8P7I,2504
|
| 237 |
+
Cython/Includes/cpython/method.pxd,sha256=UWXflhIlP4y7B5XDbH9rQ15iADciGW-iqV1-dlw2Wwg,2196
|
| 238 |
+
Cython/Includes/cpython/module.pxd,sha256=ahRxpmkz_KMZhnSk-ZrXn_kkSoUhNBxWXf9uPquXyis,10128
|
| 239 |
+
Cython/Includes/cpython/number.pxd,sha256=tYJ0nn0k_llUx3ilniW9iXd2rKVejA-J5UUiIJ36Kww,11922
|
| 240 |
+
Cython/Includes/cpython/object.pxd,sha256=1mMnUhoxDfCg7iCjQHvf4lsagJLZw9H0EhsLy4NggyM,20003
|
| 241 |
+
Cython/Includes/cpython/oldbuffer.pxd,sha256=v0-YZ_Iwwj3ZQdM8VE5NPTQcbBlJdWwJGtNO9DonGgw,2916
|
| 242 |
+
Cython/Includes/cpython/pycapsule.pxd,sha256=Z3-xhfFRIldr-SqznNaE5J0N0jlUvoa-I5sGTHzWTGg,5700
|
| 243 |
+
Cython/Includes/cpython/pylifecycle.pxd,sha256=LziJZHclGdtsr3yT28fULHNZ_n67bs1DmI9s8YzrBGg,2000
|
| 244 |
+
Cython/Includes/cpython/pyport.pxd,sha256=MfWCwvbMjd_qBvpmj5DuNUqGnTnLLEIx9pb8B1-dz_Y,222
|
| 245 |
+
Cython/Includes/cpython/pystate.pxd,sha256=TQb-_El6K7h6ktpFkgfehi1VBe4KcUNscH7TG7Nv8W4,3779
|
| 246 |
+
Cython/Includes/cpython/pythread.pxd,sha256=0375TaYmtNCDDkWBh9WY4oJ_jhoTxhu_RR5QiOsXmYg,1946
|
| 247 |
+
Cython/Includes/cpython/ref.pxd,sha256=awtAD2o36UaGQbnDHVdOyH8J2Iiclo7D4Bj7XFJbaA0,2556
|
| 248 |
+
Cython/Includes/cpython/sequence.pxd,sha256=UajXW6S_ssyCmYDDsXFiHGR9IUDMP3f6AuV4bBzh2Do,6006
|
| 249 |
+
Cython/Includes/cpython/set.pxd,sha256=ewHRPVMbHUGDInZ3NziisCq68LvtmEJ-SXFbzmuJxLc,5383
|
| 250 |
+
Cython/Includes/cpython/slice.pxd,sha256=Rzgn8diAsN7lS2xGTq4VZucV3ziFNra4oz4tKGEAkMo,3111
|
| 251 |
+
Cython/Includes/cpython/string.pxd,sha256=6jHMVltzGLTLgmo_ndti22mTuQmNVyk9J9S48eyPbEo,9942
|
| 252 |
+
Cython/Includes/cpython/time.pxd,sha256=rdv6S1n2jDiymQDTnf5dxjdgab5ia0SiO0R2cKjkaTk,2411
|
| 253 |
+
Cython/Includes/cpython/tuple.pxd,sha256=DUUhJp4v23g0JOJ6OK3sGvHNgEz97Z9be8XBgZrqH0Y,3219
|
| 254 |
+
Cython/Includes/cpython/type.pxd,sha256=qt8Hqz3DKGJuMgWJgP2JuCpUHiySYp8KCJTerJ4gnpI,2067
|
| 255 |
+
Cython/Includes/cpython/unicode.pxd,sha256=68cguuI3cMJbspbqwRPuzmpjJfOsZe_IV10JvhMd-FQ,30635
|
| 256 |
+
Cython/Includes/cpython/version.pxd,sha256=l5KXt04isEv3qbGRJZ8fNlCYGO24HsA2l4EM3RxTEhE,847
|
| 257 |
+
Cython/Includes/cpython/weakref.pxd,sha256=UU9H_ovHG07FFgP_kY2xhGv3yJDr_8iujCZnxH2jnlo,1984
|
| 258 |
+
Cython/Includes/libc/__init__.pxd,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 259 |
+
Cython/Includes/libc/complex.pxd,sha256=m2ntA8NFZQG02UuY5YDGu-MrW-Avp0kSY82mhkR1Q8M,1224
|
| 260 |
+
Cython/Includes/libc/errno.pxd,sha256=tt0CJaCDWZN4HGtzC5nP7D-hT-jjoYD9m0FOPizmRvc,2049
|
| 261 |
+
Cython/Includes/libc/float.pxd,sha256=IhvZJljpTG0fZtcIp7EBO2Sqddozxoxwj4RFNVcKLpY,966
|
| 262 |
+
Cython/Includes/libc/limits.pxd,sha256=xHlIyuDIKpjqclvRRYzZIcfd5G1re5QtbmoDMqZR_Ec,621
|
| 263 |
+
Cython/Includes/libc/locale.pxd,sha256=sixG8EJ6wiVb0HIR1LWJ3lXTjTv463GJ9C_40HRovN4,1140
|
| 264 |
+
Cython/Includes/libc/math.pxd,sha256=Hy0ewq4Xw2sWPvrokbrbpHw6r6azx8C1nRsNWtuMhUs,6581
|
| 265 |
+
Cython/Includes/libc/setjmp.pxd,sha256=XRh-gSuhvFLl0nRvz5OhSWYe9eqX2attAck3JI7mwa4,297
|
| 266 |
+
Cython/Includes/libc/signal.pxd,sha256=RmJeCLtWUfYFTtwiocZSV-gJtJrxFijkTYOZnvOk9Pw,1179
|
| 267 |
+
Cython/Includes/libc/stddef.pxd,sha256=0rCyoocCfDL-1OQo3pxHQ-6fW20SAYktOLPoa4d97w8,164
|
| 268 |
+
Cython/Includes/libc/stdint.pxd,sha256=qHJXzpWCrbvJWSaHYZL27VJPupQreTZl9VGj0jgLdRU,3449
|
| 269 |
+
Cython/Includes/libc/stdio.pxd,sha256=qUaxEwNrQl1-4yHLorzzJZ-a-y5_-Rm_m7Z5meaRqH0,2476
|
| 270 |
+
Cython/Includes/libc/stdlib.pxd,sha256=p62xq2XfB24WfNCjRXgD6cOYoRuV47AnYijkjWv4ugE,2444
|
| 271 |
+
Cython/Includes/libc/string.pxd,sha256=tzYGbRrnccedFLes-KGgJqM0FEtwHF_q4f2fqltNvyE,2038
|
| 272 |
+
Cython/Includes/libc/time.pxd,sha256=zeE7saukFU9k77SXjUlIJ2GWka-LdXCFVwinfL4sQx0,1354
|
| 273 |
+
Cython/Includes/libcpp/__init__.pxd,sha256=PCx8ZRfOeoyMRu41PPlPY9uo2kZmt_7d0KR4Epzfe7c,94
|
| 274 |
+
Cython/Includes/libcpp/algorithm.pxd,sha256=HaatOKA2pIHc-RNHCIWayPXLT2Hd56Q0gKC5kLlCYYc,23704
|
| 275 |
+
Cython/Includes/libcpp/any.pxd,sha256=0HE8j4XF0bkCrxaYWE3DM1kV_2LhljH8WKh2ariwIWc,425
|
| 276 |
+
Cython/Includes/libcpp/atomic.pxd,sha256=BDFpDe8SmSdiDkEUfzbh55hjkY8yCUVDyeeUcMOwiy8,1705
|
| 277 |
+
Cython/Includes/libcpp/bit.pxd,sha256=Wd_4EoENOPZeqqhd0s--6TCOzeqPpUFfGNQibsqV9Ig,749
|
| 278 |
+
Cython/Includes/libcpp/cast.pxd,sha256=En4LBubdinfpm9Rel077tK_LGwg_3k4FAu9mlIbKjuw,501
|
| 279 |
+
Cython/Includes/libcpp/cmath.pxd,sha256=-_jnjIWY47jybkNnGrMk8ewZeGaWU0ezMWAZm9UCRk0,19935
|
| 280 |
+
Cython/Includes/libcpp/complex.pxd,sha256=JtuQuknvS6GQ0FfyJGQ914DXvzNEaF1-z9D0jST6gXM,2995
|
| 281 |
+
Cython/Includes/libcpp/deque.pxd,sha256=SwgYrnqq6OMQMSOEFTZpnpRsii7pIAT-06bLxMS5w7M,6718
|
| 282 |
+
Cython/Includes/libcpp/execution.pxd,sha256=I2KizUy9DGm_0edrd2BFdHPwyeip2ZcDxqdwb0t7taI,515
|
| 283 |
+
Cython/Includes/libcpp/forward_list.pxd,sha256=o2ThwKyJWZrNT4ZMB1aYmf-2wqYiqSCDdfVswpo8S8I,2429
|
| 284 |
+
Cython/Includes/libcpp/functional.pxd,sha256=kMul7WB1J0X2-611AMtXq6sP9jYYk3YO8zZoDKFaeDU,722
|
| 285 |
+
Cython/Includes/libcpp/iterator.pxd,sha256=UjkDqqKq6pHLiwgdUY730PbzAiTKKlhak6gkVd3jtsk,1512
|
| 286 |
+
Cython/Includes/libcpp/limits.pxd,sha256=BWJzVBB8MZt3l9PUre1o5eScE2fGJa3_Sv6e_KH30Uw,1821
|
| 287 |
+
Cython/Includes/libcpp/list.pxd,sha256=iOovgIk_Slkf7yaDEv6-ZUss_AU98OGWkvgNQDF0K0A,4438
|
| 288 |
+
Cython/Includes/libcpp/map.pxd,sha256=C8EaEsvLEc2tmEkyybOzgkx3CoFWYFBpZelHhcKHI1s,10481
|
| 289 |
+
Cython/Includes/libcpp/memory.pxd,sha256=OqNDPX_1ps9bxWCEQDiefbQv-NeZJ7SNUQtdYB86MZs,3593
|
| 290 |
+
Cython/Includes/libcpp/numbers.pxd,sha256=SkBhbClhRTtzbSMj_QvR2pz-CjdB08ZXPJbXSwATzvw,395
|
| 291 |
+
Cython/Includes/libcpp/numeric.pxd,sha256=dTdOmLBD5X5VGeTdYQqA_AXgJOr5f51_-rR7umo-w0Y,6571
|
| 292 |
+
Cython/Includes/libcpp/optional.pxd,sha256=Mf5gnZIvB9IR-L7bi3ntog2EOXB-pp1Xo45CWqyRCiU,990
|
| 293 |
+
Cython/Includes/libcpp/pair.pxd,sha256=UBJXw43uHkDlNsr0Pu1aP5tZ-ILXhUAyOLam2qdWmZA,27
|
| 294 |
+
Cython/Includes/libcpp/queue.pxd,sha256=FbL4Q7C3lgtZ2YzictU1XBXzQ7G-6y9i_7l2eqzA3Xc,649
|
| 295 |
+
Cython/Includes/libcpp/random.pxd,sha256=jgjjSbPvJturdi1NhYclH6NQRnDF3CiCbuPKgtrQ2lc,6203
|
| 296 |
+
Cython/Includes/libcpp/set.pxd,sha256=IAEHB3ElvGIm9AX8fWoO9db1jpz6eVXLDgMgOcoHhcY,9176
|
| 297 |
+
Cython/Includes/libcpp/stack.pxd,sha256=hCU6nVpHHkKhlzREnw4cSi64atGu9pWeuorFSZtEoh4,301
|
| 298 |
+
Cython/Includes/libcpp/string.pxd,sha256=gT_1KTVrAt-0rnWT5S97GJhPChKpk-syeqa_Mj5L9wU,13840
|
| 299 |
+
Cython/Includes/libcpp/typeindex.pxd,sha256=mIHr5Mq6Lol0SlzqeK6w_giVERh3uAjZm78yPDLXzc4,524
|
| 300 |
+
Cython/Includes/libcpp/typeinfo.pxd,sha256=tITsqurrdaZjsEGFksem9xZtVhSxQRxHZxcoC-4Y-DY,304
|
| 301 |
+
Cython/Includes/libcpp/unordered_map.pxd,sha256=dHnTuJ1S3ja7OYGRW-hZ1Zh_xDpv3iW6JUxs9Um_K4U,7945
|
| 302 |
+
Cython/Includes/libcpp/unordered_set.pxd,sha256=yfmib2EnFDGn_RvlxCFkVy-eVapwQw2FvTHu-I5psTU,5810
|
| 303 |
+
Cython/Includes/libcpp/utility.pxd,sha256=hTbvp7c12pnU2yvzzMvflZB-MAc_--3xh3PXtD_VIwg,1040
|
| 304 |
+
Cython/Includes/libcpp/vector.pxd,sha256=lLjXSgOThX23KA6Suuyf0FrAY7kDiTs8xFJi5xKzetk,6839
|
| 305 |
+
Cython/Includes/numpy/__init__.pxd,sha256=JbZ4wJihimLMlU6P4bT2iYy4E_hKrNenab-GC8h91QI,36457
|
| 306 |
+
Cython/Includes/numpy/math.pxd,sha256=qZEdamaPgCFW4J7Itc6BWgOrQSKZdxDT6kbU_gqx2g4,5807
|
| 307 |
+
Cython/Includes/openmp.pxd,sha256=3GTRd5JH31CvfTzXErglXnyf_jye1Gvk9O4giTa6pc0,1712
|
| 308 |
+
Cython/Includes/posix/__init__.pxd,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 309 |
+
Cython/Includes/posix/dlfcn.pxd,sha256=U-jAieh45NSlrlogsd6SJeCunYDxCG-AlQ7hpEXQgL4,356
|
| 310 |
+
Cython/Includes/posix/fcntl.pxd,sha256=s0Qj0-T7Luzk0dJH4Jn_U54Suzf1LrfKDlFp7qg_nfM,1697
|
| 311 |
+
Cython/Includes/posix/ioctl.pxd,sha256=2RC5zejPOCTkarDZM_6Vd2wc4oBuN7iaiL_C5MPBs90,99
|
| 312 |
+
Cython/Includes/posix/mman.pxd,sha256=jeRRW5YRK4o2cLx5M98Ce--CP7GGZWVyy3ylW2mP6nU,3475
|
| 313 |
+
Cython/Includes/posix/resource.pxd,sha256=_oeWwy1HOQ-PUAxfnM1Ha7jnSIi2uUosAaNaQmqUmsk,1338
|
| 314 |
+
Cython/Includes/posix/select.pxd,sha256=cF6U60K7hYUzQuY8udA8VF50vTC7xxau1eynXrADzAU,619
|
| 315 |
+
Cython/Includes/posix/signal.pxd,sha256=wFJI5UthdtU9mZWjEBeZ9IIfeX252JVwDk2tsbW_q3U,1876
|
| 316 |
+
Cython/Includes/posix/stat.pxd,sha256=5sHZ4Ira3nVeNDynsM-7aEcJu7DfC07d_aTwlcUhC0Q,2695
|
| 317 |
+
Cython/Includes/posix/stdio.pxd,sha256=nDxLG4Qdq2v9zLb-bfxphv9oCvCD5QenT2POqSX7Sww,1055
|
| 318 |
+
Cython/Includes/posix/stdlib.pxd,sha256=G5Miv-QwID6Te9BQsz2vlRyKTpmvtuuYdwOUX4RxRoM,935
|
| 319 |
+
Cython/Includes/posix/strings.pxd,sha256=GNEteqND2wgXXSvkv6U9eKSC9oIom3C7o2zQ6W_J_S4,374
|
| 320 |
+
Cython/Includes/posix/time.pxd,sha256=lX06ykHd1qZsrw9ziKLpsGNdoN03PURRfrEngOMRBcs,1981
|
| 321 |
+
Cython/Includes/posix/types.pxd,sha256=tWEWxST4EGHIgYS-Ce2SGjZ-KgmM2SVe1eggdcgv3JQ,1162
|
| 322 |
+
Cython/Includes/posix/uio.pxd,sha256=lsHOhduB-LgUwWz8uMYlenGa29gtfc2B_K8Jjw7_8OY,822
|
| 323 |
+
Cython/Includes/posix/unistd.pxd,sha256=w9B4d9NaXBsQ62XOr2xe9UFPGewmEk5BG6sqiRWdoM8,8061
|
| 324 |
+
Cython/Includes/posix/wait.pxd,sha256=8bQAm7_cADrhT9ZY8-HZUn6dbIeIvEkuy-ZYmaSYQMg,1246
|
| 325 |
+
Cython/Plex/Actions.cpython-311-x86_64-linux-gnu.so,sha256=yqfhf3eac_YWxsZ0aVb15SxJbOIZC1KtRMbbLP4lSKQ,80704
|
| 326 |
+
Cython/Plex/Actions.pxd,sha256=AQbTp0D_OPz2nVkcaPiumYEFfaQacOVJCGorHctKHcM,581
|
| 327 |
+
Cython/Plex/Actions.py,sha256=eGPLzGxlQ4ncVaaUaQk-Re2N6SEDYk7DFq3KFVZXVjo,2919
|
| 328 |
+
Cython/Plex/DFA.cpython-311-x86_64-linux-gnu.so,sha256=hCvqfOxNG6864pvvrLILQP6JhdfeuvyAN2rJFjWVASs,128360
|
| 329 |
+
Cython/Plex/DFA.pxd,sha256=ZU4_46Flh_0QN9eQFgIdVXuGo-iuFTQHFil97o_Ege0,776
|
| 330 |
+
Cython/Plex/DFA.py,sha256=HRTKO0V2gWmQ-8ch9u38NXXI9gVJ3HRwg5W2owWWkwE,5427
|
| 331 |
+
Cython/Plex/Errors.py,sha256=UsCwtNpxD2_BfStOsYfb1gMeU0xe5a_8yUDd7WKf7cc,976
|
| 332 |
+
Cython/Plex/Lexicons.py,sha256=D8QeBOxAM06Zox9gn_Dxnk7JNPFI1_F4Wb2kb8nFKKI,5946
|
| 333 |
+
Cython/Plex/Machines.cpython-311-x86_64-linux-gnu.so,sha256=W9tKGFkvybV2cuVHoLvgEXdrQeo81ei_gXLp5yQj8gY,176680
|
| 334 |
+
Cython/Plex/Machines.pxd,sha256=PmaVCp9oQorpzUgpTQAPMwPlXTVjHfln73arpOthKLY,732
|
| 335 |
+
Cython/Plex/Machines.py,sha256=MlbIyguDBOrZ9qaTXHUcEB8T664y4KKLG0V1iLNINv8,7684
|
| 336 |
+
Cython/Plex/Regexps.py,sha256=Gei0aVp0eM-KJWNLqvgOj9thOTw6Swy-aRlx-gzVbmA,14957
|
| 337 |
+
Cython/Plex/Scanners.cpython-311-x86_64-linux-gnu.so,sha256=L-956RiR4JNYm1zYktPXy3gJ3zf3CSvKbCe5sjU8G4o,123048
|
| 338 |
+
Cython/Plex/Scanners.pxd,sha256=oiTi45TeGNyaGN09oX8y21HtEfgcnlH_iHMahlqAcPs,1552
|
| 339 |
+
Cython/Plex/Scanners.py,sha256=GsW6Ow3mOW43aZGNImZ8h_j5sBFCMSX4cI6YokCYOBo,12939
|
| 340 |
+
Cython/Plex/Transitions.cpython-311-x86_64-linux-gnu.so,sha256=GSRS8Trc2W4r55CyH9MLWTpBqblpdUSZ47Gf9flNR4Y,138408
|
| 341 |
+
Cython/Plex/Transitions.pxd,sha256=Ewpk1zxElJtYDEDQPFkGRDh-KAFfwbbUi0sd2gLsTuU,590
|
| 342 |
+
Cython/Plex/Transitions.py,sha256=qrlew4MHJytnuG0OCxOBmUiVPCm-8egSlRJg1vsN20w,6761
|
| 343 |
+
Cython/Plex/__init__.py,sha256=HUAqdIcdoDbQWsTwPl0-cM5rclQCecGv2Ysz_3dcBRo,1155
|
| 344 |
+
Cython/Plex/__pycache__/Actions.cpython-311.pyc,,
|
| 345 |
+
Cython/Plex/__pycache__/DFA.cpython-311.pyc,,
|
| 346 |
+
Cython/Plex/__pycache__/Errors.cpython-311.pyc,,
|
| 347 |
+
Cython/Plex/__pycache__/Lexicons.cpython-311.pyc,,
|
| 348 |
+
Cython/Plex/__pycache__/Machines.cpython-311.pyc,,
|
| 349 |
+
Cython/Plex/__pycache__/Regexps.cpython-311.pyc,,
|
| 350 |
+
Cython/Plex/__pycache__/Scanners.cpython-311.pyc,,
|
| 351 |
+
Cython/Plex/__pycache__/Transitions.cpython-311.pyc,,
|
| 352 |
+
Cython/Plex/__pycache__/__init__.cpython-311.pyc,,
|
| 353 |
+
Cython/Runtime/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 354 |
+
Cython/Runtime/__pycache__/__init__.cpython-311.pyc,,
|
| 355 |
+
Cython/Runtime/refnanny.cpython-311-x86_64-linux-gnu.so,sha256=kNrjPiYL_v9YUJ40an7SwA-Znv2xnw2myvowLSZ-QNQ,93912
|
| 356 |
+
Cython/Runtime/refnanny.pyx,sha256=K09EBbEVRgelbCnYDwlxwm3Fmuxsk8c4NW8xXz6s5hk,6611
|
| 357 |
+
Cython/Shadow.py,sha256=jNFqWxRBGPdXraiqlzeF4-sH4tNvfXy7MD58LBHP3b0,17278
|
| 358 |
+
Cython/Shadow.pyi,sha256=X7Y2fTL2wuz9Xb6I6pBQc3GQ1bQ6pa9gM4--hbz3qmo,2697
|
| 359 |
+
Cython/StringIOTree.cpython-311-x86_64-linux-gnu.so,sha256=sFK6scoeZtYfYPZHt_8kLeg3tOnFyKeOvTvvv-mZOTo,89896
|
| 360 |
+
Cython/StringIOTree.py,sha256=AB7jPmSEZXutd7v_JbDaTgg93vQEasP52X-QBtRPZ_4,5737
|
| 361 |
+
Cython/Tempita/__init__.py,sha256=YHujYHiLoYUwFNNswJCgzSrDuie3sV08JsWT9Nbmp78,152
|
| 362 |
+
Cython/Tempita/__pycache__/__init__.cpython-311.pyc,,
|
| 363 |
+
Cython/Tempita/__pycache__/_looper.cpython-311.pyc,,
|
| 364 |
+
Cython/Tempita/__pycache__/_tempita.cpython-311.pyc,,
|
| 365 |
+
Cython/Tempita/__pycache__/compat3.cpython-311.pyc,,
|
| 366 |
+
Cython/Tempita/_looper.py,sha256=jlStYhz9Pgp6NatX86k-netBNBmvwaeWxCRS_S8vcIM,4168
|
| 367 |
+
Cython/Tempita/_tempita.cpython-311-x86_64-linux-gnu.so,sha256=BHfyCw36GfedxISkqSwLpK4gTQdK0XFFLh196LvU1s8,595904
|
| 368 |
+
Cython/Tempita/_tempita.py,sha256=TyzL8e2Dpj3HTo7NsxSYN2LdvRShV6o9oEujNe6x8tU,37650
|
| 369 |
+
Cython/Tempita/compat3.py,sha256=cjW1y266vRF5Xvh8kAu7_qHGT8AGGu2kGSJRK6DI-0E,903
|
| 370 |
+
Cython/TestUtils.py,sha256=F_EvSitHy43ZNvZwZUy2JYJlHA5nMWGDlsEvjLahpeo,14703
|
| 371 |
+
Cython/Tests/TestCodeWriter.py,sha256=ZbhNJEzEyxnl5w4dPw_8na6bpzSaeuZtYjEUecj4Ueo,3799
|
| 372 |
+
Cython/Tests/TestCythonUtils.py,sha256=5wwdRgB3NgMvPoqMetIwRcddH0WgPrPI4bJq2pwEKQk,6825
|
| 373 |
+
Cython/Tests/TestJediTyper.py,sha256=ppWoB_kWprErFZoTQctja1yBMia8jWdBbRaN5zhkYRM,7021
|
| 374 |
+
Cython/Tests/TestShadow.py,sha256=MzvslvgEhJQDExPZBLSAClvJk4gDgfF3vafVx2VukkM,3384
|
| 375 |
+
Cython/Tests/TestStringIOTree.py,sha256=vTuu3z32WTcmJaf0fBq62NMghYtaPL2rRnfdl2WM--4,1946
|
| 376 |
+
Cython/Tests/TestTestUtils.py,sha256=6GJdzk66ewwC-ds132IzcmAhLWr8Oc9Ae18gFccwdxY,2966
|
| 377 |
+
Cython/Tests/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
|
| 378 |
+
Cython/Tests/__pycache__/TestCodeWriter.cpython-311.pyc,,
|
| 379 |
+
Cython/Tests/__pycache__/TestCythonUtils.cpython-311.pyc,,
|
| 380 |
+
Cython/Tests/__pycache__/TestJediTyper.cpython-311.pyc,,
|
| 381 |
+
Cython/Tests/__pycache__/TestShadow.cpython-311.pyc,,
|
| 382 |
+
Cython/Tests/__pycache__/TestStringIOTree.cpython-311.pyc,,
|
| 383 |
+
Cython/Tests/__pycache__/TestTestUtils.cpython-311.pyc,,
|
| 384 |
+
Cython/Tests/__pycache__/__init__.cpython-311.pyc,,
|
| 385 |
+
Cython/Tests/__pycache__/xmlrunner.cpython-311.pyc,,
|
| 386 |
+
Cython/Tests/xmlrunner.py,sha256=9RrsdLNoOwd5nbqwxE_dWugLJ4RYdbP2t-0prJVpODM,14777
|
| 387 |
+
Cython/Utility/AsyncGen.c,sha256=L8bb7P7lBEjfxURalqug0o4Soljs58FSlDbpRPMh1bQ,48376
|
| 388 |
+
Cython/Utility/Buffer.c,sha256=JzuEsbFEMziYhHd2z-teXGwztKq2Lxioy1YKbbcSgrs,29910
|
| 389 |
+
Cython/Utility/Builtins.c,sha256=ER4FCul2WdtlTRhFSqrdjI9gOzpf1S2CN0YIeZFq_w0,19205
|
| 390 |
+
Cython/Utility/CConvert.pyx,sha256=EIC2CoisktkTpi_68-SF5eyftd6356t8W1c6dGQfx28,4419
|
| 391 |
+
Cython/Utility/CMath.c,sha256=GIc7gd2WzaZryDJM3tefqXifLJpUJs6_T_c_mFrr-s8,2566
|
| 392 |
+
Cython/Utility/CommonStructures.c,sha256=02ZcCAT2bXhZm2HJ1AIdx4fK0-TALfcI6GavxMVnDk4,4690
|
| 393 |
+
Cython/Utility/Complex.c,sha256=91iLlSVz9zZ7fPiSPdRoKddG_yEQJXOt3eBd6dAbjXo,13609
|
| 394 |
+
Cython/Utility/Coroutine.c,sha256=ofL1T1lkWx259qNTpPz5B_1AAmQOiejpfurJV-W11ko,99284
|
| 395 |
+
Cython/Utility/CpdefEnums.pyx,sha256=R96TnoDtZucC9qvWmbQn3kuhxggugUQP5Pp5Vgmhwp4,6040
|
| 396 |
+
Cython/Utility/CppConvert.pyx,sha256=tolYphcqNtj1KfxJLz1q76Js-JN-EMeuCBuN1N0N-ZU,7054
|
| 397 |
+
Cython/Utility/CppSupport.cpp,sha256=B-nq6TcgMFFWfnZL2K7UhE_b0lZyjsuI6c-yQ9tzsv8,4934
|
| 398 |
+
Cython/Utility/CythonFunction.c,sha256=mQdzqyxYMxKV-wPIUFPsyPDVIkyqkbKDC6riUShoay4,64260
|
| 399 |
+
Cython/Utility/Dataclasses.c,sha256=Yky76ur34ZYi8mijd1ceC0Jc06B9aPEYBUu-LS5VSs0,7271
|
| 400 |
+
Cython/Utility/Dataclasses.py,sha256=3lSw4xyskxbh6fyHKkYD_98nVWjZRpMQ5jnJQDtE0A0,4077
|
| 401 |
+
Cython/Utility/Embed.c,sha256=JbXpWihTK9bq9rBhWMyaImZu8eTUvrrU6cWY-LZ8wA8,7436
|
| 402 |
+
Cython/Utility/Exceptions.c,sha256=oidvxTU8mYMz9JMl7-ZZgrikCyIKLc8Gl5ovJu024rw,38955
|
| 403 |
+
Cython/Utility/ExtensionTypes.c,sha256=t7ikHM9WDO8h8_WcCv8f_glW3mywGEylM96JFVSCtKM,25417
|
| 404 |
+
Cython/Utility/FunctionArguments.c,sha256=nw4Cb-n8Mk4XrJhEj__iIjxT3EtA_XSnPHmlGAP6ukY,20740
|
| 405 |
+
Cython/Utility/ImportExport.c,sha256=YeFwS6w-by14oI2KG17u04qz0yQLiNUUFmeRmsWnSYI,29972
|
| 406 |
+
Cython/Utility/MemoryView.pyx,sha256=bMO2DFBecbQiO07engC4n2iUTI3RvAhR7c0lTa73b94,49594
|
| 407 |
+
Cython/Utility/MemoryView_C.c,sha256=kEZ87RvCQcqTxcaWcPUVn4WgDJsDbCla1HqEbf8NFDE,31647
|
| 408 |
+
Cython/Utility/ModuleSetupCode.c,sha256=fjXvPH6bwfyyRHeZzeCFxFeYryeFscW2h9BSVlCfzk8,86132
|
| 409 |
+
Cython/Utility/NumpyImportArray.c,sha256=Gwo493DF8JxUxhTTjJYIdyHHJ9TEwFKqDmKsdk_uPyw,2033
|
| 410 |
+
Cython/Utility/ObjectHandling.c,sha256=UTQYetFVANoYfOLAGc3IyicfkSMy3Vm6KtjJd-ajLds,116556
|
| 411 |
+
Cython/Utility/Optimize.c,sha256=TpJPminM-vsQdslaVSu65LhaCnOyCMIcyj9hSTpTu8A,61029
|
| 412 |
+
Cython/Utility/Overflow.c,sha256=1kwFjE2a3mdCG9gAlamP16tBjuNWFhs8s7UyHAQ2JkY,15874
|
| 413 |
+
Cython/Utility/Printing.c,sha256=o8XnfjNIT8Ub5KY4FAp_FNw-OE3xqjy0MgmYWgDcWao,5103
|
| 414 |
+
Cython/Utility/Profile.c,sha256=ZAO6vlT0FiQ5eXWl_JlmvQcFvrFiUov-RGLP3Gl-d78,18194
|
| 415 |
+
Cython/Utility/StringTools.c,sha256=YaxeLKr6Dtu-HGJHk2tUSTolQfboMomsG0lb5rqG79A,45790
|
| 416 |
+
Cython/Utility/TestCyUtilityLoader.pyx,sha256=91lWWJub7l_6xNn3ncrvQZZ94RpkQzEx2NtAaFpvrxY,152
|
| 417 |
+
Cython/Utility/TestCythonScope.pyx,sha256=oE9x2UaH2KoyheZxKlRCCphtW8R4esePuJo4LoGh1Nc,1795
|
| 418 |
+
Cython/Utility/TestUtilityLoader.c,sha256=dGy6ZWL2kBqtmUY7kF75UEox5kadQZ__BmZKscwg2aY,279
|
| 419 |
+
Cython/Utility/TypeConversion.c,sha256=8OlHSjFUIAAeWQTP2FBhc5KBYXUCy9uXnpYblFxPAoA,47910
|
| 420 |
+
Cython/Utility/UFuncs.pyx,sha256=dF32cppwl4Lelmpa7COgmRh1Vv4GD4uLhHG15g4E6gQ,2179
|
| 421 |
+
Cython/Utility/UFuncs_C.c,sha256=BqiTcx1h5iINFAd3IubUHNEi8u_A1O_E-BOAf2J27d0,1519
|
| 422 |
+
Cython/Utility/__init__.py,sha256=t2bpY-TYSX8lJdbKuBFJ1kBfpWVzgGw4xoZlCKfyj_s,1159
|
| 423 |
+
Cython/Utility/__pycache__/Dataclasses.cpython-311.pyc,,
|
| 424 |
+
Cython/Utility/__pycache__/__init__.cpython-311.pyc,,
|
| 425 |
+
Cython/Utility/arrayarray.h,sha256=3Ll8Gd_S4rv8HaTfg5i6-aaoB9taI1vzwTp7NeA7Wy0,4089
|
| 426 |
+
Cython/Utils.cpython-311-x86_64-linux-gnu.so,sha256=86qw6F2IwaGLvptyDxJsEVwioWuR7oAG29HW-l3gmes,396760
|
| 427 |
+
Cython/Utils.py,sha256=_YpSLV29bS00oQLGqmTkgRxNXfFKAH1kyUtiQ7bO92I,22079
|
| 428 |
+
Cython/__init__.py,sha256=GMnkoIas6hfN_meqZAJF9BEs1NuY4-4B2L0Uls7hXaA,358
|
| 429 |
+
Cython/__pycache__/CodeWriter.cpython-311.pyc,,
|
| 430 |
+
Cython/__pycache__/Coverage.cpython-311.pyc,,
|
| 431 |
+
Cython/__pycache__/Debugging.cpython-311.pyc,,
|
| 432 |
+
Cython/__pycache__/Shadow.cpython-311.pyc,,
|
| 433 |
+
Cython/__pycache__/StringIOTree.cpython-311.pyc,,
|
| 434 |
+
Cython/__pycache__/TestUtils.cpython-311.pyc,,
|
| 435 |
+
Cython/__pycache__/Utils.cpython-311.pyc,,
|
| 436 |
+
Cython/__pycache__/__init__.cpython-311.pyc,,
|
| 437 |
+
__pycache__/cython.cpython-311.pyc,,
|
| 438 |
+
cython.py,sha256=z2AtgHBGh0x0h0ZcGje7IhYlR6nGH_MmOh1fFMjqYn0,520
|
| 439 |
+
pyximport/__init__.py,sha256=9hOyKolFtOerPiVEyktKrT1VtzbGexq9UmORzo52iHI,79
|
| 440 |
+
pyximport/__pycache__/__init__.cpython-311.pyc,,
|
| 441 |
+
pyximport/__pycache__/_pyximport2.cpython-311.pyc,,
|
| 442 |
+
pyximport/__pycache__/_pyximport3.cpython-311.pyc,,
|
| 443 |
+
pyximport/__pycache__/pyxbuild.cpython-311.pyc,,
|
| 444 |
+
pyximport/__pycache__/pyximport.cpython-311.pyc,,
|
| 445 |
+
pyximport/_pyximport2.py,sha256=mklesc9aVvPvUqWHXZhxlHF4rVrrirz1FFqJ30_x5IU,24364
|
| 446 |
+
pyximport/_pyximport3.py,sha256=dGzBogaWn9eIWWyTZ9Un1jELxh8BdmSe3Fbxc3teX4M,18380
|
| 447 |
+
pyximport/pyxbuild.py,sha256=AsL1tyLxG61Mj7Ah-DxtDBuaXF94W2Tb6KTos7r0w8I,5702
|
| 448 |
+
pyximport/pyximport.py,sha256=23hjqx86b50J1MLmDBWBu_ESWLi1V7CoBzUYOKJi5oI,321
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/REQUESTED
ADDED
|
File without changes
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (72.1.0)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp311-cp311-manylinux_2_17_x86_64
|
| 5 |
+
Tag: cp311-cp311-manylinux2014_x86_64
|
| 6 |
+
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[console_scripts]
|
| 2 |
+
cygdb = Cython.Debugger.Cygdb:main
|
| 3 |
+
cython = Cython.Compiler.Main:setuptools_main
|
| 4 |
+
cythonize = Cython.Build.Cythonize:main
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython-3.0.11.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Cython
|
| 2 |
+
cython
|
| 3 |
+
pyximport
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestBuffer.cpython-311.pyc
ADDED
|
Binary file (8.2 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestSignatureMatching.cpython-311.pyc
ADDED
|
Binary file (7.64 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestStringEncoding.cpython-311.pyc
ADDED
|
Binary file (3.58 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/TestTreeFragment.cpython-311.pyc
ADDED
|
Binary file (5.64 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Compiler/Tests/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (222 Bytes). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# empty file
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (215 Bytes). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/refnanny.cpython-311-x86_64-linux-gnu.so
ADDED
|
Binary file (93.9 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Runtime/refnanny.pyx
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# cython: language_level=3, auto_pickle=False
|
| 2 |
+
|
| 3 |
+
from cpython.ref cimport PyObject, Py_INCREF, Py_CLEAR, Py_XDECREF, Py_XINCREF
|
| 4 |
+
from cpython.exc cimport PyErr_Fetch, PyErr_Restore
|
| 5 |
+
from cpython.pystate cimport PyThreadState_Get
|
| 6 |
+
|
| 7 |
+
cimport cython
|
| 8 |
+
|
| 9 |
+
loglevel = 0
|
| 10 |
+
reflog = []
|
| 11 |
+
|
| 12 |
+
cdef log(level, action, obj, lineno):
|
| 13 |
+
if reflog is None:
|
| 14 |
+
# can happen during finalisation
|
| 15 |
+
return
|
| 16 |
+
if loglevel >= level:
|
| 17 |
+
reflog.append((lineno, action, id(obj)))
|
| 18 |
+
|
| 19 |
+
LOG_NONE, LOG_ALL = range(2)
|
| 20 |
+
|
| 21 |
+
@cython.final
|
| 22 |
+
cdef class Context(object):
|
| 23 |
+
cdef readonly object name, filename
|
| 24 |
+
cdef readonly dict refs
|
| 25 |
+
cdef readonly list errors
|
| 26 |
+
cdef readonly Py_ssize_t start
|
| 27 |
+
|
| 28 |
+
def __cinit__(self, name, line=0, filename=None):
|
| 29 |
+
self.name = name
|
| 30 |
+
self.start = line
|
| 31 |
+
self.filename = filename
|
| 32 |
+
self.refs = {} # id -> (count, [lineno])
|
| 33 |
+
self.errors = []
|
| 34 |
+
|
| 35 |
+
cdef regref(self, obj, Py_ssize_t lineno, bint is_null):
|
| 36 |
+
log(LOG_ALL, u'regref', u"<NULL>" if is_null else obj, lineno)
|
| 37 |
+
if is_null:
|
| 38 |
+
self.errors.append(f"NULL argument on line {lineno}")
|
| 39 |
+
return
|
| 40 |
+
id_ = id(obj)
|
| 41 |
+
count, linenumbers = self.refs.get(id_, (0, []))
|
| 42 |
+
self.refs[id_] = (count + 1, linenumbers)
|
| 43 |
+
linenumbers.append(lineno)
|
| 44 |
+
|
| 45 |
+
cdef bint delref(self, obj, Py_ssize_t lineno, bint is_null) except -1:
|
| 46 |
+
# returns whether it is ok to do the decref operation
|
| 47 |
+
log(LOG_ALL, u'delref', u"<NULL>" if is_null else obj, lineno)
|
| 48 |
+
if is_null:
|
| 49 |
+
self.errors.append(f"NULL argument on line {lineno}")
|
| 50 |
+
return False
|
| 51 |
+
id_ = id(obj)
|
| 52 |
+
count, linenumbers = self.refs.get(id_, (0, []))
|
| 53 |
+
if count == 0:
|
| 54 |
+
self.errors.append(f"Too many decrefs on line {lineno}, reference acquired on lines {linenumbers!r}")
|
| 55 |
+
return False
|
| 56 |
+
if count == 1:
|
| 57 |
+
del self.refs[id_]
|
| 58 |
+
else:
|
| 59 |
+
self.refs[id_] = (count - 1, linenumbers)
|
| 60 |
+
return True
|
| 61 |
+
|
| 62 |
+
cdef end(self):
|
| 63 |
+
if self.refs:
|
| 64 |
+
msg = u"References leaked:"
|
| 65 |
+
for count, linenos in self.refs.itervalues():
|
| 66 |
+
msg += f"\n ({count}) acquired on lines: {u', '.join([f'{x}' for x in linenos])}"
|
| 67 |
+
self.errors.append(msg)
|
| 68 |
+
return u"\n".join([f'REFNANNY: {error}' for error in self.errors]) if self.errors else None
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
cdef void report_unraisable(filename, Py_ssize_t lineno, object e=None):
|
| 72 |
+
try:
|
| 73 |
+
if e is None:
|
| 74 |
+
import sys
|
| 75 |
+
e = sys.exc_info()[1]
|
| 76 |
+
print(f"refnanny raised an exception from {filename}:{lineno}: {e}")
|
| 77 |
+
finally:
|
| 78 |
+
return # We absolutely cannot exit with an exception
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
# All Python operations must happen after any existing
|
| 82 |
+
# exception has been fetched, in case we are called from
|
| 83 |
+
# exception-handling code.
|
| 84 |
+
|
| 85 |
+
cdef PyObject* SetupContext(char* funcname, Py_ssize_t lineno, char* filename) except NULL:
|
| 86 |
+
if Context is None:
|
| 87 |
+
# Context may be None during finalize phase.
|
| 88 |
+
# In that case, we don't want to be doing anything fancy
|
| 89 |
+
# like caching and resetting exceptions.
|
| 90 |
+
return NULL
|
| 91 |
+
cdef (PyObject*) type = NULL, value = NULL, tb = NULL, result = NULL
|
| 92 |
+
PyThreadState_Get() # Check that we hold the GIL
|
| 93 |
+
PyErr_Fetch(&type, &value, &tb)
|
| 94 |
+
try:
|
| 95 |
+
ctx = Context(funcname, lineno, filename)
|
| 96 |
+
Py_INCREF(ctx)
|
| 97 |
+
result = <PyObject*>ctx
|
| 98 |
+
except Exception, e:
|
| 99 |
+
report_unraisable(filename, lineno, e)
|
| 100 |
+
PyErr_Restore(type, value, tb)
|
| 101 |
+
return result
|
| 102 |
+
|
| 103 |
+
cdef void GOTREF(PyObject* ctx, PyObject* p_obj, Py_ssize_t lineno):
|
| 104 |
+
if ctx == NULL: return
|
| 105 |
+
cdef (PyObject*) type = NULL, value = NULL, tb = NULL
|
| 106 |
+
PyErr_Fetch(&type, &value, &tb)
|
| 107 |
+
try:
|
| 108 |
+
(<Context>ctx).regref(
|
| 109 |
+
<object>p_obj if p_obj is not NULL else None,
|
| 110 |
+
lineno,
|
| 111 |
+
is_null=p_obj is NULL,
|
| 112 |
+
)
|
| 113 |
+
except:
|
| 114 |
+
report_unraisable((<Context>ctx).filename, lineno=(<Context>ctx).start)
|
| 115 |
+
finally:
|
| 116 |
+
PyErr_Restore(type, value, tb)
|
| 117 |
+
return # swallow any exceptions
|
| 118 |
+
|
| 119 |
+
cdef bint GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, Py_ssize_t lineno):
|
| 120 |
+
if ctx == NULL: return 1
|
| 121 |
+
cdef (PyObject*) type = NULL, value = NULL, tb = NULL
|
| 122 |
+
cdef bint decref_ok = False
|
| 123 |
+
PyErr_Fetch(&type, &value, &tb)
|
| 124 |
+
try:
|
| 125 |
+
decref_ok = (<Context>ctx).delref(
|
| 126 |
+
<object>p_obj if p_obj is not NULL else None,
|
| 127 |
+
lineno,
|
| 128 |
+
is_null=p_obj is NULL,
|
| 129 |
+
)
|
| 130 |
+
except:
|
| 131 |
+
report_unraisable((<Context>ctx).filename, lineno=(<Context>ctx).start)
|
| 132 |
+
finally:
|
| 133 |
+
PyErr_Restore(type, value, tb)
|
| 134 |
+
return decref_ok # swallow any exceptions
|
| 135 |
+
|
| 136 |
+
cdef void GIVEREF(PyObject* ctx, PyObject* p_obj, Py_ssize_t lineno):
|
| 137 |
+
GIVEREF_and_report(ctx, p_obj, lineno)
|
| 138 |
+
|
| 139 |
+
cdef void INCREF(PyObject* ctx, PyObject* obj, Py_ssize_t lineno):
|
| 140 |
+
Py_XINCREF(obj)
|
| 141 |
+
PyThreadState_Get() # Check that we hold the GIL
|
| 142 |
+
GOTREF(ctx, obj, lineno)
|
| 143 |
+
|
| 144 |
+
cdef void DECREF(PyObject* ctx, PyObject* obj, Py_ssize_t lineno):
|
| 145 |
+
if GIVEREF_and_report(ctx, obj, lineno):
|
| 146 |
+
Py_XDECREF(obj)
|
| 147 |
+
PyThreadState_Get() # Check that we hold the GIL
|
| 148 |
+
|
| 149 |
+
cdef void FinishContext(PyObject** ctx):
|
| 150 |
+
if ctx == NULL or ctx[0] == NULL: return
|
| 151 |
+
cdef (PyObject*) type = NULL, value = NULL, tb = NULL
|
| 152 |
+
cdef object errors = None
|
| 153 |
+
cdef Context context
|
| 154 |
+
PyThreadState_Get() # Check that we hold the GIL
|
| 155 |
+
PyErr_Fetch(&type, &value, &tb)
|
| 156 |
+
try:
|
| 157 |
+
context = <Context>ctx[0]
|
| 158 |
+
errors = context.end()
|
| 159 |
+
if errors:
|
| 160 |
+
print(f"{context.filename.decode('latin1')}: {context.name.decode('latin1')}()")
|
| 161 |
+
print(errors)
|
| 162 |
+
context = None
|
| 163 |
+
except:
|
| 164 |
+
report_unraisable(
|
| 165 |
+
context.filename if context is not None else None,
|
| 166 |
+
lineno=context.start if context is not None else 0,
|
| 167 |
+
)
|
| 168 |
+
finally:
|
| 169 |
+
Py_CLEAR(ctx[0])
|
| 170 |
+
PyErr_Restore(type, value, tb)
|
| 171 |
+
return # swallow any exceptions
|
| 172 |
+
|
| 173 |
+
ctypedef struct RefNannyAPIStruct:
|
| 174 |
+
void (*INCREF)(PyObject*, PyObject*, Py_ssize_t)
|
| 175 |
+
void (*DECREF)(PyObject*, PyObject*, Py_ssize_t)
|
| 176 |
+
void (*GOTREF)(PyObject*, PyObject*, Py_ssize_t)
|
| 177 |
+
void (*GIVEREF)(PyObject*, PyObject*, Py_ssize_t)
|
| 178 |
+
PyObject* (*SetupContext)(char*, Py_ssize_t, char*) except NULL
|
| 179 |
+
void (*FinishContext)(PyObject**)
|
| 180 |
+
|
| 181 |
+
cdef RefNannyAPIStruct api
|
| 182 |
+
api.INCREF = INCREF
|
| 183 |
+
api.DECREF = DECREF
|
| 184 |
+
api.GOTREF = GOTREF
|
| 185 |
+
api.GIVEREF = GIVEREF
|
| 186 |
+
api.SetupContext = SetupContext
|
| 187 |
+
api.FinishContext = FinishContext
|
| 188 |
+
|
| 189 |
+
cdef extern from "Python.h":
|
| 190 |
+
object PyLong_FromVoidPtr(void*)
|
| 191 |
+
|
| 192 |
+
RefNannyAPI = PyLong_FromVoidPtr(<void*>&api)
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/TestCodeWriter.cpython-311.pyc
ADDED
|
Binary file (6.57 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/TestShadow.cpython-311.pyc
ADDED
|
Binary file (4.46 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/TestStringIOTree.cpython-311.pyc
ADDED
|
Binary file (4.03 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (213 Bytes). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Tests/__pycache__/xmlrunner.cpython-311.pyc
ADDED
|
Binary file (23 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/AsyncGen.c
ADDED
|
@@ -0,0 +1,1317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This is copied from genobject.c in CPython 3.6.
|
| 2 |
+
// Try to keep it in sync by doing this from time to time:
|
| 3 |
+
// sed -e 's|__pyx_||ig' Cython/Utility/AsyncGen.c | diff -udw - cpython/Objects/genobject.c | less
|
| 4 |
+
|
| 5 |
+
//////////////////// AsyncGenerator.proto ////////////////////
|
| 6 |
+
//@requires: Coroutine.c::Coroutine
|
| 7 |
+
|
| 8 |
+
#define __Pyx_AsyncGen_USED
|
| 9 |
+
typedef struct {
|
| 10 |
+
__pyx_CoroutineObject coro;
|
| 11 |
+
PyObject *ag_finalizer;
|
| 12 |
+
int ag_hooks_inited;
|
| 13 |
+
int ag_closed;
|
| 14 |
+
int ag_running_async;
|
| 15 |
+
} __pyx_PyAsyncGenObject;
|
| 16 |
+
|
| 17 |
+
static PyTypeObject *__pyx__PyAsyncGenWrappedValueType = 0;
|
| 18 |
+
static PyTypeObject *__pyx__PyAsyncGenASendType = 0;
|
| 19 |
+
static PyTypeObject *__pyx__PyAsyncGenAThrowType = 0;
|
| 20 |
+
static PyTypeObject *__pyx_AsyncGenType = 0;
|
| 21 |
+
|
| 22 |
+
#define __Pyx_AsyncGen_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_AsyncGenType)
|
| 23 |
+
#define __pyx_PyAsyncGenASend_CheckExact(o) \
|
| 24 |
+
__Pyx_IS_TYPE(o, __pyx__PyAsyncGenASendType)
|
| 25 |
+
#define __pyx_PyAsyncGenAThrow_CheckExact(o) \
|
| 26 |
+
__Pyx_IS_TYPE(o, __pyx__PyAsyncGenAThrowType)
|
| 27 |
+
|
| 28 |
+
static PyObject *__Pyx_async_gen_anext(PyObject *o);
|
| 29 |
+
static CYTHON_INLINE PyObject *__Pyx_async_gen_asend_iternext(PyObject *o);
|
| 30 |
+
static PyObject *__Pyx_async_gen_asend_send(PyObject *o, PyObject *arg);
|
| 31 |
+
static PyObject *__Pyx_async_gen_asend_close(PyObject *o, PyObject *args);
|
| 32 |
+
static PyObject *__Pyx_async_gen_athrow_close(PyObject *o, PyObject *args);
|
| 33 |
+
|
| 34 |
+
static PyObject *__Pyx__PyAsyncGenValueWrapperNew(PyObject *val);
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
static __pyx_CoroutineObject *__Pyx_AsyncGen_New(
|
| 38 |
+
__pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
|
| 39 |
+
PyObject *name, PyObject *qualname, PyObject *module_name) {
|
| 40 |
+
__pyx_PyAsyncGenObject *gen = PyObject_GC_New(__pyx_PyAsyncGenObject, __pyx_AsyncGenType);
|
| 41 |
+
if (unlikely(!gen))
|
| 42 |
+
return NULL;
|
| 43 |
+
gen->ag_finalizer = NULL;
|
| 44 |
+
gen->ag_closed = 0;
|
| 45 |
+
gen->ag_hooks_inited = 0;
|
| 46 |
+
gen->ag_running_async = 0;
|
| 47 |
+
return __Pyx__Coroutine_NewInit((__pyx_CoroutineObject*)gen, body, code, closure, name, qualname, module_name);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
static int __pyx_AsyncGen_init(PyObject *module);
|
| 51 |
+
static void __Pyx_PyAsyncGen_Fini(void);
|
| 52 |
+
|
| 53 |
+
//////////////////// AsyncGenerator.cleanup ////////////////////
|
| 54 |
+
|
| 55 |
+
__Pyx_PyAsyncGen_Fini();
|
| 56 |
+
|
| 57 |
+
//////////////////// AsyncGeneratorInitFinalizer ////////////////////
|
| 58 |
+
|
| 59 |
+
// this is separated out because it needs more adaptation
|
| 60 |
+
|
| 61 |
+
#if PY_VERSION_HEX < 0x030600B0
|
| 62 |
+
static int __Pyx_async_gen_init_hooks(__pyx_PyAsyncGenObject *o) {
|
| 63 |
+
#if 0
|
| 64 |
+
// TODO: implement finalizer support in older Python versions
|
| 65 |
+
PyThreadState *tstate;
|
| 66 |
+
PyObject *finalizer;
|
| 67 |
+
PyObject *firstiter;
|
| 68 |
+
#endif
|
| 69 |
+
|
| 70 |
+
if (likely(o->ag_hooks_inited)) {
|
| 71 |
+
return 0;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
o->ag_hooks_inited = 1;
|
| 75 |
+
|
| 76 |
+
#if 0
|
| 77 |
+
tstate = __Pyx_PyThreadState_Current;
|
| 78 |
+
|
| 79 |
+
finalizer = tstate->async_gen_finalizer;
|
| 80 |
+
if (finalizer) {
|
| 81 |
+
Py_INCREF(finalizer);
|
| 82 |
+
o->ag_finalizer = finalizer;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
firstiter = tstate->async_gen_firstiter;
|
| 86 |
+
if (firstiter) {
|
| 87 |
+
PyObject *res;
|
| 88 |
+
|
| 89 |
+
Py_INCREF(firstiter);
|
| 90 |
+
res = __Pyx_PyObject_CallOneArg(firstiter, (PyObject*)o);
|
| 91 |
+
Py_DECREF(firstiter);
|
| 92 |
+
if (res == NULL) {
|
| 93 |
+
return 1;
|
| 94 |
+
}
|
| 95 |
+
Py_DECREF(res);
|
| 96 |
+
}
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
return 0;
|
| 100 |
+
}
|
| 101 |
+
#endif
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
//////////////////// AsyncGenerator ////////////////////
|
| 105 |
+
//@requires: AsyncGeneratorInitFinalizer
|
| 106 |
+
//@requires: Coroutine.c::Coroutine
|
| 107 |
+
//@requires: Coroutine.c::ReturnWithStopIteration
|
| 108 |
+
//@requires: ObjectHandling.c::PyObjectCall2Args
|
| 109 |
+
//@requires: ObjectHandling.c::PyObject_GenericGetAttrNoDict
|
| 110 |
+
|
| 111 |
+
PyDoc_STRVAR(__Pyx_async_gen_send_doc,
|
| 112 |
+
"send(arg) -> send 'arg' into generator,\n\
|
| 113 |
+
return next yielded value or raise StopIteration.");
|
| 114 |
+
|
| 115 |
+
PyDoc_STRVAR(__Pyx_async_gen_close_doc,
|
| 116 |
+
"close() -> raise GeneratorExit inside generator.");
|
| 117 |
+
|
| 118 |
+
PyDoc_STRVAR(__Pyx_async_gen_throw_doc,
|
| 119 |
+
"throw(typ[,val[,tb]]) -> raise exception in generator,\n\
|
| 120 |
+
return next yielded value or raise StopIteration.");
|
| 121 |
+
|
| 122 |
+
PyDoc_STRVAR(__Pyx_async_gen_await_doc,
|
| 123 |
+
"__await__() -> return a representation that can be passed into the 'await' expression.");
|
| 124 |
+
|
| 125 |
+
// COPY STARTS HERE:
|
| 126 |
+
|
| 127 |
+
static PyObject *__Pyx_async_gen_asend_new(__pyx_PyAsyncGenObject *, PyObject *);
|
| 128 |
+
static PyObject *__Pyx_async_gen_athrow_new(__pyx_PyAsyncGenObject *, PyObject *);
|
| 129 |
+
|
| 130 |
+
static const char *__Pyx_NON_INIT_CORO_MSG = "can't send non-None value to a just-started coroutine";
|
| 131 |
+
static const char *__Pyx_ASYNC_GEN_IGNORED_EXIT_MSG = "async generator ignored GeneratorExit";
|
| 132 |
+
static const char *__Pyx_ASYNC_GEN_CANNOT_REUSE_SEND_MSG = "cannot reuse already awaited __anext__()/asend()";
|
| 133 |
+
static const char *__Pyx_ASYNC_GEN_CANNOT_REUSE_CLOSE_MSG = "cannot reuse already awaited aclose()/athrow()";
|
| 134 |
+
|
| 135 |
+
typedef enum {
|
| 136 |
+
__PYX_AWAITABLE_STATE_INIT, /* new awaitable, has not yet been iterated */
|
| 137 |
+
__PYX_AWAITABLE_STATE_ITER, /* being iterated */
|
| 138 |
+
__PYX_AWAITABLE_STATE_CLOSED, /* closed */
|
| 139 |
+
} __pyx_AwaitableState;
|
| 140 |
+
|
| 141 |
+
typedef struct {
|
| 142 |
+
PyObject_HEAD
|
| 143 |
+
__pyx_PyAsyncGenObject *ags_gen;
|
| 144 |
+
|
| 145 |
+
/* Can be NULL, when in the __anext__() mode (equivalent of "asend(None)") */
|
| 146 |
+
PyObject *ags_sendval;
|
| 147 |
+
|
| 148 |
+
__pyx_AwaitableState ags_state;
|
| 149 |
+
} __pyx_PyAsyncGenASend;
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
typedef struct {
|
| 153 |
+
PyObject_HEAD
|
| 154 |
+
__pyx_PyAsyncGenObject *agt_gen;
|
| 155 |
+
|
| 156 |
+
/* Can be NULL, when in the "aclose()" mode (equivalent of "athrow(GeneratorExit)") */
|
| 157 |
+
PyObject *agt_args;
|
| 158 |
+
|
| 159 |
+
__pyx_AwaitableState agt_state;
|
| 160 |
+
} __pyx_PyAsyncGenAThrow;
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
typedef struct {
|
| 164 |
+
PyObject_HEAD
|
| 165 |
+
PyObject *agw_val;
|
| 166 |
+
} __pyx__PyAsyncGenWrappedValue;
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
#ifndef _PyAsyncGen_MAXFREELIST
|
| 170 |
+
#define _PyAsyncGen_MAXFREELIST 80
|
| 171 |
+
#endif
|
| 172 |
+
|
| 173 |
+
// Freelists boost performance 6-10%; they also reduce memory
|
| 174 |
+
// fragmentation, as _PyAsyncGenWrappedValue and PyAsyncGenASend
|
| 175 |
+
// are short-living objects that are instantiated for every
|
| 176 |
+
// __anext__ call.
|
| 177 |
+
|
| 178 |
+
static __pyx__PyAsyncGenWrappedValue *__Pyx_ag_value_freelist[_PyAsyncGen_MAXFREELIST];
|
| 179 |
+
static int __Pyx_ag_value_freelist_free = 0;
|
| 180 |
+
|
| 181 |
+
static __pyx_PyAsyncGenASend *__Pyx_ag_asend_freelist[_PyAsyncGen_MAXFREELIST];
|
| 182 |
+
static int __Pyx_ag_asend_freelist_free = 0;
|
| 183 |
+
|
| 184 |
+
#define __pyx__PyAsyncGenWrappedValue_CheckExact(o) \
|
| 185 |
+
__Pyx_IS_TYPE(o, __pyx__PyAsyncGenWrappedValueType)
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
static int
|
| 189 |
+
__Pyx_async_gen_traverse(__pyx_PyAsyncGenObject *gen, visitproc visit, void *arg)
|
| 190 |
+
{
|
| 191 |
+
Py_VISIT(gen->ag_finalizer);
|
| 192 |
+
return __Pyx_Coroutine_traverse((__pyx_CoroutineObject*)gen, visit, arg);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
static PyObject *
|
| 197 |
+
__Pyx_async_gen_repr(__pyx_CoroutineObject *o)
|
| 198 |
+
{
|
| 199 |
+
// avoid NULL pointer dereference for qualname during garbage collection
|
| 200 |
+
return PyUnicode_FromFormat("<async_generator object %S at %p>",
|
| 201 |
+
o->gi_qualname ? o->gi_qualname : Py_None, o);
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
#if PY_VERSION_HEX >= 0x030600B0
|
| 206 |
+
static int
|
| 207 |
+
__Pyx_async_gen_init_hooks(__pyx_PyAsyncGenObject *o)
|
| 208 |
+
{
|
| 209 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 210 |
+
PyThreadState *tstate;
|
| 211 |
+
#endif
|
| 212 |
+
PyObject *finalizer;
|
| 213 |
+
PyObject *firstiter;
|
| 214 |
+
|
| 215 |
+
if (o->ag_hooks_inited) {
|
| 216 |
+
return 0;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
o->ag_hooks_inited = 1;
|
| 220 |
+
|
| 221 |
+
#if CYTHON_COMPILING_IN_PYPY
|
| 222 |
+
finalizer = _PyEval_GetAsyncGenFinalizer();
|
| 223 |
+
#else
|
| 224 |
+
tstate = __Pyx_PyThreadState_Current;
|
| 225 |
+
finalizer = tstate->async_gen_finalizer;
|
| 226 |
+
#endif
|
| 227 |
+
if (finalizer) {
|
| 228 |
+
Py_INCREF(finalizer);
|
| 229 |
+
o->ag_finalizer = finalizer;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
#if CYTHON_COMPILING_IN_PYPY
|
| 233 |
+
firstiter = _PyEval_GetAsyncGenFirstiter();
|
| 234 |
+
#else
|
| 235 |
+
firstiter = tstate->async_gen_firstiter;
|
| 236 |
+
#endif
|
| 237 |
+
if (firstiter) {
|
| 238 |
+
PyObject *res;
|
| 239 |
+
#if CYTHON_UNPACK_METHODS
|
| 240 |
+
PyObject *self;
|
| 241 |
+
#endif
|
| 242 |
+
|
| 243 |
+
Py_INCREF(firstiter);
|
| 244 |
+
// at least asyncio stores methods here => optimise the call
|
| 245 |
+
#if CYTHON_UNPACK_METHODS
|
| 246 |
+
if (likely(PyMethod_Check(firstiter)) && likely((self = PyMethod_GET_SELF(firstiter)) != NULL)) {
|
| 247 |
+
PyObject *function = PyMethod_GET_FUNCTION(firstiter);
|
| 248 |
+
res = __Pyx_PyObject_Call2Args(function, self, (PyObject*)o);
|
| 249 |
+
} else
|
| 250 |
+
#endif
|
| 251 |
+
res = __Pyx_PyObject_CallOneArg(firstiter, (PyObject*)o);
|
| 252 |
+
|
| 253 |
+
Py_DECREF(firstiter);
|
| 254 |
+
if (unlikely(res == NULL)) {
|
| 255 |
+
return 1;
|
| 256 |
+
}
|
| 257 |
+
Py_DECREF(res);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
return 0;
|
| 261 |
+
}
|
| 262 |
+
#endif
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
static PyObject *
|
| 266 |
+
__Pyx_async_gen_anext(PyObject *g)
|
| 267 |
+
{
|
| 268 |
+
__pyx_PyAsyncGenObject *o = (__pyx_PyAsyncGenObject*) g;
|
| 269 |
+
if (unlikely(__Pyx_async_gen_init_hooks(o))) {
|
| 270 |
+
return NULL;
|
| 271 |
+
}
|
| 272 |
+
return __Pyx_async_gen_asend_new(o, NULL);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
static PyObject *
|
| 276 |
+
__Pyx_async_gen_anext_method(PyObject *g, PyObject *arg) {
|
| 277 |
+
CYTHON_UNUSED_VAR(arg);
|
| 278 |
+
return __Pyx_async_gen_anext(g);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
static PyObject *
|
| 283 |
+
__Pyx_async_gen_asend(__pyx_PyAsyncGenObject *o, PyObject *arg)
|
| 284 |
+
{
|
| 285 |
+
if (unlikely(__Pyx_async_gen_init_hooks(o))) {
|
| 286 |
+
return NULL;
|
| 287 |
+
}
|
| 288 |
+
return __Pyx_async_gen_asend_new(o, arg);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
|
| 292 |
+
static PyObject *
|
| 293 |
+
__Pyx_async_gen_aclose(__pyx_PyAsyncGenObject *o, PyObject *arg)
|
| 294 |
+
{
|
| 295 |
+
CYTHON_UNUSED_VAR(arg);
|
| 296 |
+
if (unlikely(__Pyx_async_gen_init_hooks(o))) {
|
| 297 |
+
return NULL;
|
| 298 |
+
}
|
| 299 |
+
return __Pyx_async_gen_athrow_new(o, NULL);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
|
| 303 |
+
static PyObject *
|
| 304 |
+
__Pyx_async_gen_athrow(__pyx_PyAsyncGenObject *o, PyObject *args)
|
| 305 |
+
{
|
| 306 |
+
if (unlikely(__Pyx_async_gen_init_hooks(o))) {
|
| 307 |
+
return NULL;
|
| 308 |
+
}
|
| 309 |
+
return __Pyx_async_gen_athrow_new(o, args);
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
|
| 313 |
+
static PyObject *
|
| 314 |
+
__Pyx_async_gen_self_method(PyObject *g, PyObject *arg) {
|
| 315 |
+
CYTHON_UNUSED_VAR(arg);
|
| 316 |
+
return __Pyx_NewRef(g);
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
static PyGetSetDef __Pyx_async_gen_getsetlist[] = {
|
| 321 |
+
{(char*) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
|
| 322 |
+
(char*) PyDoc_STR("name of the async generator"), 0},
|
| 323 |
+
{(char*) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
|
| 324 |
+
(char*) PyDoc_STR("qualified name of the async generator"), 0},
|
| 325 |
+
//REMOVED: {(char*) "ag_await", (getter)coro_get_cr_await, NULL,
|
| 326 |
+
//REMOVED: (char*) PyDoc_STR("object being awaited on, or None")},
|
| 327 |
+
{0, 0, 0, 0, 0} /* Sentinel */
|
| 328 |
+
};
|
| 329 |
+
|
| 330 |
+
static PyMemberDef __Pyx_async_gen_memberlist[] = {
|
| 331 |
+
//REMOVED: {(char*) "ag_frame", T_OBJECT, offsetof(__pyx_PyAsyncGenObject, ag_frame), READONLY},
|
| 332 |
+
{(char*) "ag_running", T_BOOL, offsetof(__pyx_PyAsyncGenObject, ag_running_async), READONLY, NULL},
|
| 333 |
+
//REMOVED: {(char*) "ag_code", T_OBJECT, offsetof(__pyx_PyAsyncGenObject, ag_code), READONLY},
|
| 334 |
+
//ADDED: "ag_await"
|
| 335 |
+
{(char*) "ag_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
|
| 336 |
+
(char*) PyDoc_STR("object being awaited on, or None")},
|
| 337 |
+
{(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
|
| 338 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 339 |
+
{(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
|
| 340 |
+
#endif
|
| 341 |
+
{0, 0, 0, 0, 0} /* Sentinel */
|
| 342 |
+
};
|
| 343 |
+
|
| 344 |
+
PyDoc_STRVAR(__Pyx_async_aclose_doc,
|
| 345 |
+
"aclose() -> raise GeneratorExit inside generator.");
|
| 346 |
+
|
| 347 |
+
PyDoc_STRVAR(__Pyx_async_asend_doc,
|
| 348 |
+
"asend(v) -> send 'v' in generator.");
|
| 349 |
+
|
| 350 |
+
PyDoc_STRVAR(__Pyx_async_athrow_doc,
|
| 351 |
+
"athrow(typ[,val[,tb]]) -> raise exception in generator.");
|
| 352 |
+
|
| 353 |
+
PyDoc_STRVAR(__Pyx_async_aiter_doc,
|
| 354 |
+
"__aiter__(v) -> return an asynchronous iterator.");
|
| 355 |
+
|
| 356 |
+
PyDoc_STRVAR(__Pyx_async_anext_doc,
|
| 357 |
+
"__anext__(v) -> continue asynchronous iteration and return the next element.");
|
| 358 |
+
|
| 359 |
+
static PyMethodDef __Pyx_async_gen_methods[] = {
|
| 360 |
+
{"asend", (PyCFunction)__Pyx_async_gen_asend, METH_O, __Pyx_async_asend_doc},
|
| 361 |
+
{"athrow",(PyCFunction)__Pyx_async_gen_athrow, METH_VARARGS, __Pyx_async_athrow_doc},
|
| 362 |
+
{"aclose", (PyCFunction)__Pyx_async_gen_aclose, METH_NOARGS, __Pyx_async_aclose_doc},
|
| 363 |
+
{"__aiter__", (PyCFunction)__Pyx_async_gen_self_method, METH_NOARGS, __Pyx_async_aiter_doc},
|
| 364 |
+
{"__anext__", (PyCFunction)__Pyx_async_gen_anext_method, METH_NOARGS, __Pyx_async_anext_doc},
|
| 365 |
+
{0, 0, 0, 0} /* Sentinel */
|
| 366 |
+
};
|
| 367 |
+
|
| 368 |
+
|
| 369 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 370 |
+
static PyType_Slot __pyx_AsyncGenType_slots[] = {
|
| 371 |
+
{Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
|
| 372 |
+
{Py_am_aiter, (void *)PyObject_SelfIter},
|
| 373 |
+
{Py_am_anext, (void *)__Pyx_async_gen_anext},
|
| 374 |
+
{Py_tp_repr, (void *)__Pyx_async_gen_repr},
|
| 375 |
+
{Py_tp_traverse, (void *)__Pyx_async_gen_traverse},
|
| 376 |
+
{Py_tp_methods, (void *)__Pyx_async_gen_methods},
|
| 377 |
+
{Py_tp_members, (void *)__Pyx_async_gen_memberlist},
|
| 378 |
+
{Py_tp_getset, (void *)__Pyx_async_gen_getsetlist},
|
| 379 |
+
#if CYTHON_USE_TP_FINALIZE
|
| 380 |
+
{Py_tp_finalize, (void *)__Pyx_Coroutine_del},
|
| 381 |
+
#endif
|
| 382 |
+
{0, 0},
|
| 383 |
+
};
|
| 384 |
+
|
| 385 |
+
static PyType_Spec __pyx_AsyncGenType_spec = {
|
| 386 |
+
__PYX_TYPE_MODULE_PREFIX "async_generator",
|
| 387 |
+
sizeof(__pyx_PyAsyncGenObject),
|
| 388 |
+
0,
|
| 389 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
|
| 390 |
+
__pyx_AsyncGenType_slots
|
| 391 |
+
};
|
| 392 |
+
#else /* CYTHON_USE_TYPE_SPECS */
|
| 393 |
+
|
| 394 |
+
#if CYTHON_USE_ASYNC_SLOTS
|
| 395 |
+
static __Pyx_PyAsyncMethodsStruct __Pyx_async_gen_as_async = {
|
| 396 |
+
0, /* am_await */
|
| 397 |
+
PyObject_SelfIter, /* am_aiter */
|
| 398 |
+
(unaryfunc)__Pyx_async_gen_anext, /* am_anext */
|
| 399 |
+
#if PY_VERSION_HEX >= 0x030A00A3
|
| 400 |
+
0, /*am_send*/
|
| 401 |
+
#endif
|
| 402 |
+
};
|
| 403 |
+
#endif
|
| 404 |
+
|
| 405 |
+
static PyTypeObject __pyx_AsyncGenType_type = {
|
| 406 |
+
PyVarObject_HEAD_INIT(0, 0)
|
| 407 |
+
"async_generator", /* tp_name */
|
| 408 |
+
sizeof(__pyx_PyAsyncGenObject), /* tp_basicsize */
|
| 409 |
+
0, /* tp_itemsize */
|
| 410 |
+
(destructor)__Pyx_Coroutine_dealloc, /* tp_dealloc */
|
| 411 |
+
0, /* tp_vectorcall_offset */
|
| 412 |
+
0, /* tp_getattr */
|
| 413 |
+
0, /* tp_setattr */
|
| 414 |
+
#if CYTHON_USE_ASYNC_SLOTS
|
| 415 |
+
&__Pyx_async_gen_as_async, /* tp_as_async */
|
| 416 |
+
#else
|
| 417 |
+
0, /*tp_reserved*/
|
| 418 |
+
#endif
|
| 419 |
+
(reprfunc)__Pyx_async_gen_repr, /* tp_repr */
|
| 420 |
+
0, /* tp_as_number */
|
| 421 |
+
0, /* tp_as_sequence */
|
| 422 |
+
0, /* tp_as_mapping */
|
| 423 |
+
0, /* tp_hash */
|
| 424 |
+
0, /* tp_call */
|
| 425 |
+
0, /* tp_str */
|
| 426 |
+
0, /* tp_getattro */
|
| 427 |
+
0, /* tp_setattro */
|
| 428 |
+
0, /* tp_as_buffer */
|
| 429 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
|
| 430 |
+
Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags */
|
| 431 |
+
0, /* tp_doc */
|
| 432 |
+
(traverseproc)__Pyx_async_gen_traverse, /* tp_traverse */
|
| 433 |
+
0, /* tp_clear */
|
| 434 |
+
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
|
| 435 |
+
// in order to (mis-)use tp_reserved above, we must also implement tp_richcompare
|
| 436 |
+
__Pyx_Coroutine_compare, /*tp_richcompare*/
|
| 437 |
+
#else
|
| 438 |
+
0, /*tp_richcompare*/
|
| 439 |
+
#endif
|
| 440 |
+
offsetof(__pyx_CoroutineObject, gi_weakreflist), /* tp_weaklistoffset */
|
| 441 |
+
0, /* tp_iter */
|
| 442 |
+
0, /* tp_iternext */
|
| 443 |
+
__Pyx_async_gen_methods, /* tp_methods */
|
| 444 |
+
__Pyx_async_gen_memberlist, /* tp_members */
|
| 445 |
+
__Pyx_async_gen_getsetlist, /* tp_getset */
|
| 446 |
+
0, /* tp_base */
|
| 447 |
+
0, /* tp_dict */
|
| 448 |
+
0, /* tp_descr_get */
|
| 449 |
+
0, /* tp_descr_set */
|
| 450 |
+
0, /* tp_dictoffset */
|
| 451 |
+
0, /* tp_init */
|
| 452 |
+
0, /* tp_alloc */
|
| 453 |
+
0, /* tp_new */
|
| 454 |
+
0, /* tp_free */
|
| 455 |
+
0, /* tp_is_gc */
|
| 456 |
+
0, /* tp_bases */
|
| 457 |
+
0, /* tp_mro */
|
| 458 |
+
0, /* tp_cache */
|
| 459 |
+
0, /* tp_subclasses */
|
| 460 |
+
0, /* tp_weaklist */
|
| 461 |
+
#if CYTHON_USE_TP_FINALIZE
|
| 462 |
+
0, /*tp_del*/
|
| 463 |
+
#else
|
| 464 |
+
__Pyx_Coroutine_del, /*tp_del*/
|
| 465 |
+
#endif
|
| 466 |
+
0, /* tp_version_tag */
|
| 467 |
+
#if CYTHON_USE_TP_FINALIZE
|
| 468 |
+
__Pyx_Coroutine_del, /* tp_finalize */
|
| 469 |
+
#elif PY_VERSION_HEX >= 0x030400a1
|
| 470 |
+
0, /* tp_finalize */
|
| 471 |
+
#endif
|
| 472 |
+
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
| 473 |
+
0, /*tp_vectorcall*/
|
| 474 |
+
#endif
|
| 475 |
+
#if __PYX_NEED_TP_PRINT_SLOT
|
| 476 |
+
0, /*tp_print*/
|
| 477 |
+
#endif
|
| 478 |
+
#if PY_VERSION_HEX >= 0x030C0000
|
| 479 |
+
0, /*tp_watched*/
|
| 480 |
+
#endif
|
| 481 |
+
#if PY_VERSION_HEX >= 0x030d00A4
|
| 482 |
+
0, /*tp_versions_used*/
|
| 483 |
+
#endif
|
| 484 |
+
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
| 485 |
+
0, /*tp_pypy_flags*/
|
| 486 |
+
#endif
|
| 487 |
+
};
|
| 488 |
+
#endif /* CYTHON_USE_TYPE_SPECS */
|
| 489 |
+
|
| 490 |
+
|
| 491 |
+
static int
|
| 492 |
+
__Pyx_PyAsyncGen_ClearFreeLists(void)
|
| 493 |
+
{
|
| 494 |
+
int ret = __Pyx_ag_value_freelist_free + __Pyx_ag_asend_freelist_free;
|
| 495 |
+
|
| 496 |
+
while (__Pyx_ag_value_freelist_free) {
|
| 497 |
+
__pyx__PyAsyncGenWrappedValue *o;
|
| 498 |
+
o = __Pyx_ag_value_freelist[--__Pyx_ag_value_freelist_free];
|
| 499 |
+
assert(__pyx__PyAsyncGenWrappedValue_CheckExact(o));
|
| 500 |
+
__Pyx_PyHeapTypeObject_GC_Del(o);
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
while (__Pyx_ag_asend_freelist_free) {
|
| 504 |
+
__pyx_PyAsyncGenASend *o;
|
| 505 |
+
o = __Pyx_ag_asend_freelist[--__Pyx_ag_asend_freelist_free];
|
| 506 |
+
assert(__Pyx_IS_TYPE(o, __pyx__PyAsyncGenASendType));
|
| 507 |
+
__Pyx_PyHeapTypeObject_GC_Del(o);
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
return ret;
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
static void
|
| 514 |
+
__Pyx_PyAsyncGen_Fini(void)
|
| 515 |
+
{
|
| 516 |
+
__Pyx_PyAsyncGen_ClearFreeLists();
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+
static PyObject *
|
| 521 |
+
__Pyx_async_gen_unwrap_value(__pyx_PyAsyncGenObject *gen, PyObject *result)
|
| 522 |
+
{
|
| 523 |
+
if (result == NULL) {
|
| 524 |
+
PyObject *exc_type = PyErr_Occurred();
|
| 525 |
+
if (!exc_type) {
|
| 526 |
+
PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
|
| 527 |
+
gen->ag_closed = 1;
|
| 528 |
+
} else if (__Pyx_PyErr_GivenExceptionMatches2(exc_type, __Pyx_PyExc_StopAsyncIteration, PyExc_GeneratorExit)) {
|
| 529 |
+
gen->ag_closed = 1;
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
gen->ag_running_async = 0;
|
| 533 |
+
return NULL;
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
if (__pyx__PyAsyncGenWrappedValue_CheckExact(result)) {
|
| 537 |
+
/* async yield */
|
| 538 |
+
__Pyx_ReturnWithStopIteration(((__pyx__PyAsyncGenWrappedValue*)result)->agw_val);
|
| 539 |
+
Py_DECREF(result);
|
| 540 |
+
gen->ag_running_async = 0;
|
| 541 |
+
return NULL;
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
return result;
|
| 545 |
+
}
|
| 546 |
+
|
| 547 |
+
|
| 548 |
+
/* ---------- Async Generator ASend Awaitable ------------ */
|
| 549 |
+
|
| 550 |
+
|
| 551 |
+
static void
|
| 552 |
+
__Pyx_async_gen_asend_dealloc(__pyx_PyAsyncGenASend *o)
|
| 553 |
+
{
|
| 554 |
+
PyObject_GC_UnTrack((PyObject *)o);
|
| 555 |
+
Py_CLEAR(o->ags_gen);
|
| 556 |
+
Py_CLEAR(o->ags_sendval);
|
| 557 |
+
if (likely(__Pyx_ag_asend_freelist_free < _PyAsyncGen_MAXFREELIST)) {
|
| 558 |
+
assert(__pyx_PyAsyncGenASend_CheckExact(o));
|
| 559 |
+
__Pyx_ag_asend_freelist[__Pyx_ag_asend_freelist_free++] = o;
|
| 560 |
+
} else {
|
| 561 |
+
__Pyx_PyHeapTypeObject_GC_Del(o);
|
| 562 |
+
}
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
static int
|
| 566 |
+
__Pyx_async_gen_asend_traverse(__pyx_PyAsyncGenASend *o, visitproc visit, void *arg)
|
| 567 |
+
{
|
| 568 |
+
Py_VISIT(o->ags_gen);
|
| 569 |
+
Py_VISIT(o->ags_sendval);
|
| 570 |
+
return 0;
|
| 571 |
+
}
|
| 572 |
+
|
| 573 |
+
|
| 574 |
+
static PyObject *
|
| 575 |
+
__Pyx_async_gen_asend_send(PyObject *g, PyObject *arg)
|
| 576 |
+
{
|
| 577 |
+
__pyx_PyAsyncGenASend *o = (__pyx_PyAsyncGenASend*) g;
|
| 578 |
+
PyObject *result;
|
| 579 |
+
|
| 580 |
+
if (unlikely(o->ags_state == __PYX_AWAITABLE_STATE_CLOSED)) {
|
| 581 |
+
PyErr_SetString(PyExc_RuntimeError, __Pyx_ASYNC_GEN_CANNOT_REUSE_SEND_MSG);
|
| 582 |
+
return NULL;
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
if (o->ags_state == __PYX_AWAITABLE_STATE_INIT) {
|
| 586 |
+
if (unlikely(o->ags_gen->ag_running_async)) {
|
| 587 |
+
PyErr_SetString(
|
| 588 |
+
PyExc_RuntimeError,
|
| 589 |
+
"anext(): asynchronous generator is already running");
|
| 590 |
+
return NULL;
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
if (arg == NULL || arg == Py_None) {
|
| 594 |
+
arg = o->ags_sendval ? o->ags_sendval : Py_None;
|
| 595 |
+
}
|
| 596 |
+
o->ags_state = __PYX_AWAITABLE_STATE_ITER;
|
| 597 |
+
}
|
| 598 |
+
|
| 599 |
+
o->ags_gen->ag_running_async = 1;
|
| 600 |
+
result = __Pyx_Coroutine_Send((PyObject*)o->ags_gen, arg);
|
| 601 |
+
result = __Pyx_async_gen_unwrap_value(o->ags_gen, result);
|
| 602 |
+
|
| 603 |
+
if (result == NULL) {
|
| 604 |
+
o->ags_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
return result;
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
|
| 611 |
+
static CYTHON_INLINE PyObject *
|
| 612 |
+
__Pyx_async_gen_asend_iternext(PyObject *o)
|
| 613 |
+
{
|
| 614 |
+
return __Pyx_async_gen_asend_send(o, Py_None);
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
|
| 618 |
+
static PyObject *
|
| 619 |
+
__Pyx_async_gen_asend_throw(__pyx_PyAsyncGenASend *o, PyObject *args)
|
| 620 |
+
{
|
| 621 |
+
PyObject *result;
|
| 622 |
+
|
| 623 |
+
if (unlikely(o->ags_state == __PYX_AWAITABLE_STATE_CLOSED)) {
|
| 624 |
+
PyErr_SetString(PyExc_RuntimeError, __Pyx_ASYNC_GEN_CANNOT_REUSE_SEND_MSG);
|
| 625 |
+
return NULL;
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
result = __Pyx_Coroutine_Throw((PyObject*)o->ags_gen, args);
|
| 629 |
+
result = __Pyx_async_gen_unwrap_value(o->ags_gen, result);
|
| 630 |
+
|
| 631 |
+
if (result == NULL) {
|
| 632 |
+
o->ags_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
return result;
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
|
| 639 |
+
static PyObject *
|
| 640 |
+
__Pyx_async_gen_asend_close(PyObject *g, PyObject *args)
|
| 641 |
+
{
|
| 642 |
+
__pyx_PyAsyncGenASend *o = (__pyx_PyAsyncGenASend*) g;
|
| 643 |
+
CYTHON_UNUSED_VAR(args);
|
| 644 |
+
o->ags_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 645 |
+
Py_RETURN_NONE;
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
|
| 649 |
+
static PyMethodDef __Pyx_async_gen_asend_methods[] = {
|
| 650 |
+
{"send", (PyCFunction)__Pyx_async_gen_asend_send, METH_O, __Pyx_async_gen_send_doc},
|
| 651 |
+
{"throw", (PyCFunction)__Pyx_async_gen_asend_throw, METH_VARARGS, __Pyx_async_gen_throw_doc},
|
| 652 |
+
{"close", (PyCFunction)__Pyx_async_gen_asend_close, METH_NOARGS, __Pyx_async_gen_close_doc},
|
| 653 |
+
{"__await__", (PyCFunction)__Pyx_async_gen_self_method, METH_NOARGS, __Pyx_async_gen_await_doc},
|
| 654 |
+
{0, 0, 0, 0} /* Sentinel */
|
| 655 |
+
};
|
| 656 |
+
|
| 657 |
+
|
| 658 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 659 |
+
static PyType_Slot __pyx__PyAsyncGenASendType_slots[] = {
|
| 660 |
+
{Py_tp_dealloc, (void *)__Pyx_async_gen_asend_dealloc},
|
| 661 |
+
{Py_am_await, (void *)PyObject_SelfIter},
|
| 662 |
+
{Py_tp_traverse, (void *)__Pyx_async_gen_asend_traverse},
|
| 663 |
+
{Py_tp_methods, (void *)__Pyx_async_gen_asend_methods},
|
| 664 |
+
{Py_tp_iter, (void *)PyObject_SelfIter},
|
| 665 |
+
{Py_tp_iternext, (void *)__Pyx_async_gen_asend_iternext},
|
| 666 |
+
{0, 0},
|
| 667 |
+
};
|
| 668 |
+
|
| 669 |
+
static PyType_Spec __pyx__PyAsyncGenASendType_spec = {
|
| 670 |
+
__PYX_TYPE_MODULE_PREFIX "async_generator_asend",
|
| 671 |
+
sizeof(__pyx_PyAsyncGenASend),
|
| 672 |
+
0,
|
| 673 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
| 674 |
+
__pyx__PyAsyncGenASendType_slots
|
| 675 |
+
};
|
| 676 |
+
#else /* CYTHON_USE_TYPE_SPECS */
|
| 677 |
+
|
| 678 |
+
#if CYTHON_USE_ASYNC_SLOTS
|
| 679 |
+
static __Pyx_PyAsyncMethodsStruct __Pyx_async_gen_asend_as_async = {
|
| 680 |
+
PyObject_SelfIter, /* am_await */
|
| 681 |
+
0, /* am_aiter */
|
| 682 |
+
0, /* am_anext */
|
| 683 |
+
#if PY_VERSION_HEX >= 0x030A00A3
|
| 684 |
+
0, /*am_send*/
|
| 685 |
+
#endif
|
| 686 |
+
};
|
| 687 |
+
#endif
|
| 688 |
+
|
| 689 |
+
static PyTypeObject __pyx__PyAsyncGenASendType_type = {
|
| 690 |
+
PyVarObject_HEAD_INIT(0, 0)
|
| 691 |
+
"async_generator_asend", /* tp_name */
|
| 692 |
+
sizeof(__pyx_PyAsyncGenASend), /* tp_basicsize */
|
| 693 |
+
0, /* tp_itemsize */
|
| 694 |
+
/* methods */
|
| 695 |
+
(destructor)__Pyx_async_gen_asend_dealloc, /* tp_dealloc */
|
| 696 |
+
0, /* tp_vectorcall_offset */
|
| 697 |
+
0, /* tp_getattr */
|
| 698 |
+
0, /* tp_setattr */
|
| 699 |
+
#if CYTHON_USE_ASYNC_SLOTS
|
| 700 |
+
&__Pyx_async_gen_asend_as_async, /* tp_as_async */
|
| 701 |
+
#else
|
| 702 |
+
0, /*tp_reserved*/
|
| 703 |
+
#endif
|
| 704 |
+
0, /* tp_repr */
|
| 705 |
+
0, /* tp_as_number */
|
| 706 |
+
0, /* tp_as_sequence */
|
| 707 |
+
0, /* tp_as_mapping */
|
| 708 |
+
0, /* tp_hash */
|
| 709 |
+
0, /* tp_call */
|
| 710 |
+
0, /* tp_str */
|
| 711 |
+
0, /* tp_getattro */
|
| 712 |
+
0, /* tp_setattro */
|
| 713 |
+
0, /* tp_as_buffer */
|
| 714 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
| 715 |
+
0, /* tp_doc */
|
| 716 |
+
(traverseproc)__Pyx_async_gen_asend_traverse, /* tp_traverse */
|
| 717 |
+
0, /* tp_clear */
|
| 718 |
+
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
|
| 719 |
+
// in order to (mis-)use tp_reserved above, we must also implement tp_richcompare
|
| 720 |
+
__Pyx_Coroutine_compare, /*tp_richcompare*/
|
| 721 |
+
#else
|
| 722 |
+
0, /*tp_richcompare*/
|
| 723 |
+
#endif
|
| 724 |
+
0, /* tp_weaklistoffset */
|
| 725 |
+
PyObject_SelfIter, /* tp_iter */
|
| 726 |
+
(iternextfunc)__Pyx_async_gen_asend_iternext, /* tp_iternext */
|
| 727 |
+
__Pyx_async_gen_asend_methods, /* tp_methods */
|
| 728 |
+
0, /* tp_members */
|
| 729 |
+
0, /* tp_getset */
|
| 730 |
+
0, /* tp_base */
|
| 731 |
+
0, /* tp_dict */
|
| 732 |
+
0, /* tp_descr_get */
|
| 733 |
+
0, /* tp_descr_set */
|
| 734 |
+
0, /* tp_dictoffset */
|
| 735 |
+
0, /* tp_init */
|
| 736 |
+
0, /* tp_alloc */
|
| 737 |
+
0, /* tp_new */
|
| 738 |
+
0, /* tp_free */
|
| 739 |
+
0, /* tp_is_gc */
|
| 740 |
+
0, /* tp_bases */
|
| 741 |
+
0, /* tp_mro */
|
| 742 |
+
0, /* tp_cache */
|
| 743 |
+
0, /* tp_subclasses */
|
| 744 |
+
0, /* tp_weaklist */
|
| 745 |
+
0, /* tp_del */
|
| 746 |
+
0, /* tp_version_tag */
|
| 747 |
+
#if PY_VERSION_HEX >= 0x030400a1
|
| 748 |
+
0, /* tp_finalize */
|
| 749 |
+
#endif
|
| 750 |
+
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
| 751 |
+
0, /*tp_vectorcall*/
|
| 752 |
+
#endif
|
| 753 |
+
#if __PYX_NEED_TP_PRINT_SLOT
|
| 754 |
+
0, /*tp_print*/
|
| 755 |
+
#endif
|
| 756 |
+
#if PY_VERSION_HEX >= 0x030C0000
|
| 757 |
+
0, /*tp_watched*/
|
| 758 |
+
#endif
|
| 759 |
+
#if PY_VERSION_HEX >= 0x030d00A4
|
| 760 |
+
0, /*tp_versions_used*/
|
| 761 |
+
#endif
|
| 762 |
+
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
| 763 |
+
0, /*tp_pypy_flags*/
|
| 764 |
+
#endif
|
| 765 |
+
};
|
| 766 |
+
#endif /* CYTHON_USE_TYPE_SPECS */
|
| 767 |
+
|
| 768 |
+
|
| 769 |
+
static PyObject *
|
| 770 |
+
__Pyx_async_gen_asend_new(__pyx_PyAsyncGenObject *gen, PyObject *sendval)
|
| 771 |
+
{
|
| 772 |
+
__pyx_PyAsyncGenASend *o;
|
| 773 |
+
if (likely(__Pyx_ag_asend_freelist_free)) {
|
| 774 |
+
__Pyx_ag_asend_freelist_free--;
|
| 775 |
+
o = __Pyx_ag_asend_freelist[__Pyx_ag_asend_freelist_free];
|
| 776 |
+
_Py_NewReference((PyObject *)o);
|
| 777 |
+
} else {
|
| 778 |
+
o = PyObject_GC_New(__pyx_PyAsyncGenASend, __pyx__PyAsyncGenASendType);
|
| 779 |
+
if (unlikely(o == NULL)) {
|
| 780 |
+
return NULL;
|
| 781 |
+
}
|
| 782 |
+
}
|
| 783 |
+
|
| 784 |
+
Py_INCREF(gen);
|
| 785 |
+
o->ags_gen = gen;
|
| 786 |
+
|
| 787 |
+
Py_XINCREF(sendval);
|
| 788 |
+
o->ags_sendval = sendval;
|
| 789 |
+
|
| 790 |
+
o->ags_state = __PYX_AWAITABLE_STATE_INIT;
|
| 791 |
+
|
| 792 |
+
PyObject_GC_Track((PyObject*)o);
|
| 793 |
+
return (PyObject*)o;
|
| 794 |
+
}
|
| 795 |
+
|
| 796 |
+
|
| 797 |
+
/* ---------- Async Generator Value Wrapper ------------ */
|
| 798 |
+
|
| 799 |
+
|
| 800 |
+
static void
|
| 801 |
+
__Pyx_async_gen_wrapped_val_dealloc(__pyx__PyAsyncGenWrappedValue *o)
|
| 802 |
+
{
|
| 803 |
+
PyObject_GC_UnTrack((PyObject *)o);
|
| 804 |
+
Py_CLEAR(o->agw_val);
|
| 805 |
+
if (likely(__Pyx_ag_value_freelist_free < _PyAsyncGen_MAXFREELIST)) {
|
| 806 |
+
assert(__pyx__PyAsyncGenWrappedValue_CheckExact(o));
|
| 807 |
+
__Pyx_ag_value_freelist[__Pyx_ag_value_freelist_free++] = o;
|
| 808 |
+
} else {
|
| 809 |
+
__Pyx_PyHeapTypeObject_GC_Del(o);
|
| 810 |
+
}
|
| 811 |
+
}
|
| 812 |
+
|
| 813 |
+
|
| 814 |
+
static int
|
| 815 |
+
__Pyx_async_gen_wrapped_val_traverse(__pyx__PyAsyncGenWrappedValue *o,
|
| 816 |
+
visitproc visit, void *arg)
|
| 817 |
+
{
|
| 818 |
+
Py_VISIT(o->agw_val);
|
| 819 |
+
return 0;
|
| 820 |
+
}
|
| 821 |
+
|
| 822 |
+
|
| 823 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 824 |
+
static PyType_Slot __pyx__PyAsyncGenWrappedValueType_slots[] = {
|
| 825 |
+
{Py_tp_dealloc, (void *)__Pyx_async_gen_wrapped_val_dealloc},
|
| 826 |
+
{Py_tp_traverse, (void *)__Pyx_async_gen_wrapped_val_traverse},
|
| 827 |
+
{0, 0},
|
| 828 |
+
};
|
| 829 |
+
|
| 830 |
+
static PyType_Spec __pyx__PyAsyncGenWrappedValueType_spec = {
|
| 831 |
+
__PYX_TYPE_MODULE_PREFIX "async_generator_wrapped_value",
|
| 832 |
+
sizeof(__pyx__PyAsyncGenWrappedValue),
|
| 833 |
+
0,
|
| 834 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
| 835 |
+
__pyx__PyAsyncGenWrappedValueType_slots
|
| 836 |
+
};
|
| 837 |
+
#else /* CYTHON_USE_TYPE_SPECS */
|
| 838 |
+
|
| 839 |
+
static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
|
| 840 |
+
PyVarObject_HEAD_INIT(0, 0)
|
| 841 |
+
"async_generator_wrapped_value", /* tp_name */
|
| 842 |
+
sizeof(__pyx__PyAsyncGenWrappedValue), /* tp_basicsize */
|
| 843 |
+
0, /* tp_itemsize */
|
| 844 |
+
/* methods */
|
| 845 |
+
(destructor)__Pyx_async_gen_wrapped_val_dealloc, /* tp_dealloc */
|
| 846 |
+
0, /* tp_vectorcall_offset */
|
| 847 |
+
0, /* tp_getattr */
|
| 848 |
+
0, /* tp_setattr */
|
| 849 |
+
0, /* tp_as_async */
|
| 850 |
+
0, /* tp_repr */
|
| 851 |
+
0, /* tp_as_number */
|
| 852 |
+
0, /* tp_as_sequence */
|
| 853 |
+
0, /* tp_as_mapping */
|
| 854 |
+
0, /* tp_hash */
|
| 855 |
+
0, /* tp_call */
|
| 856 |
+
0, /* tp_str */
|
| 857 |
+
0, /* tp_getattro */
|
| 858 |
+
0, /* tp_setattro */
|
| 859 |
+
0, /* tp_as_buffer */
|
| 860 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
| 861 |
+
0, /* tp_doc */
|
| 862 |
+
(traverseproc)__Pyx_async_gen_wrapped_val_traverse, /* tp_traverse */
|
| 863 |
+
0, /* tp_clear */
|
| 864 |
+
0, /* tp_richcompare */
|
| 865 |
+
0, /* tp_weaklistoffset */
|
| 866 |
+
0, /* tp_iter */
|
| 867 |
+
0, /* tp_iternext */
|
| 868 |
+
0, /* tp_methods */
|
| 869 |
+
0, /* tp_members */
|
| 870 |
+
0, /* tp_getset */
|
| 871 |
+
0, /* tp_base */
|
| 872 |
+
0, /* tp_dict */
|
| 873 |
+
0, /* tp_descr_get */
|
| 874 |
+
0, /* tp_descr_set */
|
| 875 |
+
0, /* tp_dictoffset */
|
| 876 |
+
0, /* tp_init */
|
| 877 |
+
0, /* tp_alloc */
|
| 878 |
+
0, /* tp_new */
|
| 879 |
+
0, /* tp_free */
|
| 880 |
+
0, /* tp_is_gc */
|
| 881 |
+
0, /* tp_bases */
|
| 882 |
+
0, /* tp_mro */
|
| 883 |
+
0, /* tp_cache */
|
| 884 |
+
0, /* tp_subclasses */
|
| 885 |
+
0, /* tp_weaklist */
|
| 886 |
+
0, /* tp_del */
|
| 887 |
+
0, /* tp_version_tag */
|
| 888 |
+
#if PY_VERSION_HEX >= 0x030400a1
|
| 889 |
+
0, /* tp_finalize */
|
| 890 |
+
#endif
|
| 891 |
+
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
| 892 |
+
0, /*tp_vectorcall*/
|
| 893 |
+
#endif
|
| 894 |
+
#if __PYX_NEED_TP_PRINT_SLOT
|
| 895 |
+
0, /*tp_print*/
|
| 896 |
+
#endif
|
| 897 |
+
#if PY_VERSION_HEX >= 0x030C0000
|
| 898 |
+
0, /*tp_watched*/
|
| 899 |
+
#endif
|
| 900 |
+
#if PY_VERSION_HEX >= 0x030d00A4
|
| 901 |
+
0, /*tp_versions_used*/
|
| 902 |
+
#endif
|
| 903 |
+
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
| 904 |
+
0, /*tp_pypy_flags*/
|
| 905 |
+
#endif
|
| 906 |
+
};
|
| 907 |
+
#endif /* CYTHON_USE_TYPE_SPECS */
|
| 908 |
+
|
| 909 |
+
|
| 910 |
+
static PyObject *
|
| 911 |
+
__Pyx__PyAsyncGenValueWrapperNew(PyObject *val)
|
| 912 |
+
{
|
| 913 |
+
// NOTE: steals a reference to val !
|
| 914 |
+
__pyx__PyAsyncGenWrappedValue *o;
|
| 915 |
+
assert(val);
|
| 916 |
+
|
| 917 |
+
if (likely(__Pyx_ag_value_freelist_free)) {
|
| 918 |
+
__Pyx_ag_value_freelist_free--;
|
| 919 |
+
o = __Pyx_ag_value_freelist[__Pyx_ag_value_freelist_free];
|
| 920 |
+
assert(__pyx__PyAsyncGenWrappedValue_CheckExact(o));
|
| 921 |
+
_Py_NewReference((PyObject*)o);
|
| 922 |
+
} else {
|
| 923 |
+
o = PyObject_GC_New(__pyx__PyAsyncGenWrappedValue, __pyx__PyAsyncGenWrappedValueType);
|
| 924 |
+
if (unlikely(!o)) {
|
| 925 |
+
Py_DECREF(val);
|
| 926 |
+
return NULL;
|
| 927 |
+
}
|
| 928 |
+
}
|
| 929 |
+
o->agw_val = val;
|
| 930 |
+
// no Py_INCREF(val) - steals reference!
|
| 931 |
+
PyObject_GC_Track((PyObject*)o);
|
| 932 |
+
return (PyObject*)o;
|
| 933 |
+
}
|
| 934 |
+
|
| 935 |
+
|
| 936 |
+
/* ---------- Async Generator AThrow awaitable ------------ */
|
| 937 |
+
|
| 938 |
+
|
| 939 |
+
static void
|
| 940 |
+
__Pyx_async_gen_athrow_dealloc(__pyx_PyAsyncGenAThrow *o)
|
| 941 |
+
{
|
| 942 |
+
PyObject_GC_UnTrack((PyObject *)o);
|
| 943 |
+
Py_CLEAR(o->agt_gen);
|
| 944 |
+
Py_CLEAR(o->agt_args);
|
| 945 |
+
__Pyx_PyHeapTypeObject_GC_Del(o);
|
| 946 |
+
}
|
| 947 |
+
|
| 948 |
+
|
| 949 |
+
static int
|
| 950 |
+
__Pyx_async_gen_athrow_traverse(__pyx_PyAsyncGenAThrow *o, visitproc visit, void *arg)
|
| 951 |
+
{
|
| 952 |
+
Py_VISIT(o->agt_gen);
|
| 953 |
+
Py_VISIT(o->agt_args);
|
| 954 |
+
return 0;
|
| 955 |
+
}
|
| 956 |
+
|
| 957 |
+
|
| 958 |
+
static PyObject *
|
| 959 |
+
__Pyx_async_gen_athrow_send(__pyx_PyAsyncGenAThrow *o, PyObject *arg)
|
| 960 |
+
{
|
| 961 |
+
__pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)o->agt_gen;
|
| 962 |
+
PyObject *retval, *exc_type;
|
| 963 |
+
|
| 964 |
+
if (unlikely(o->agt_state == __PYX_AWAITABLE_STATE_CLOSED)) {
|
| 965 |
+
PyErr_SetString(PyExc_RuntimeError, __Pyx_ASYNC_GEN_CANNOT_REUSE_CLOSE_MSG);
|
| 966 |
+
return NULL;
|
| 967 |
+
}
|
| 968 |
+
|
| 969 |
+
if (unlikely(gen->resume_label == -1)) {
|
| 970 |
+
// already run past the end
|
| 971 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 972 |
+
PyErr_SetNone(PyExc_StopIteration);
|
| 973 |
+
return NULL;
|
| 974 |
+
}
|
| 975 |
+
|
| 976 |
+
if (o->agt_state == __PYX_AWAITABLE_STATE_INIT) {
|
| 977 |
+
if (unlikely(o->agt_gen->ag_running_async)) {
|
| 978 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 979 |
+
if (o->agt_args == NULL) {
|
| 980 |
+
PyErr_SetString(
|
| 981 |
+
PyExc_RuntimeError,
|
| 982 |
+
"aclose(): asynchronous generator is already running");
|
| 983 |
+
} else {
|
| 984 |
+
PyErr_SetString(
|
| 985 |
+
PyExc_RuntimeError,
|
| 986 |
+
"athrow(): asynchronous generator is already running");
|
| 987 |
+
}
|
| 988 |
+
return NULL;
|
| 989 |
+
}
|
| 990 |
+
|
| 991 |
+
if (unlikely(o->agt_gen->ag_closed)) {
|
| 992 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 993 |
+
PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
|
| 994 |
+
return NULL;
|
| 995 |
+
}
|
| 996 |
+
|
| 997 |
+
if (unlikely(arg != Py_None)) {
|
| 998 |
+
PyErr_SetString(PyExc_RuntimeError, __Pyx_NON_INIT_CORO_MSG);
|
| 999 |
+
return NULL;
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
o->agt_state = __PYX_AWAITABLE_STATE_ITER;
|
| 1003 |
+
o->agt_gen->ag_running_async = 1;
|
| 1004 |
+
|
| 1005 |
+
if (o->agt_args == NULL) {
|
| 1006 |
+
/* aclose() mode */
|
| 1007 |
+
o->agt_gen->ag_closed = 1;
|
| 1008 |
+
|
| 1009 |
+
retval = __Pyx__Coroutine_Throw((PyObject*)gen,
|
| 1010 |
+
/* Do not close generator when PyExc_GeneratorExit is passed */
|
| 1011 |
+
PyExc_GeneratorExit, NULL, NULL, NULL, 0);
|
| 1012 |
+
|
| 1013 |
+
if (retval && __pyx__PyAsyncGenWrappedValue_CheckExact(retval)) {
|
| 1014 |
+
Py_DECREF(retval);
|
| 1015 |
+
goto yield_close;
|
| 1016 |
+
}
|
| 1017 |
+
} else {
|
| 1018 |
+
PyObject *typ;
|
| 1019 |
+
PyObject *tb = NULL;
|
| 1020 |
+
PyObject *val = NULL;
|
| 1021 |
+
|
| 1022 |
+
if (unlikely(!PyArg_UnpackTuple(o->agt_args, "athrow", 1, 3, &typ, &val, &tb))) {
|
| 1023 |
+
return NULL;
|
| 1024 |
+
}
|
| 1025 |
+
|
| 1026 |
+
retval = __Pyx__Coroutine_Throw((PyObject*)gen,
|
| 1027 |
+
/* Do not close generator when PyExc_GeneratorExit is passed */
|
| 1028 |
+
typ, val, tb, o->agt_args, 0);
|
| 1029 |
+
retval = __Pyx_async_gen_unwrap_value(o->agt_gen, retval);
|
| 1030 |
+
}
|
| 1031 |
+
if (retval == NULL) {
|
| 1032 |
+
goto check_error;
|
| 1033 |
+
}
|
| 1034 |
+
return retval;
|
| 1035 |
+
}
|
| 1036 |
+
|
| 1037 |
+
assert (o->agt_state == __PYX_AWAITABLE_STATE_ITER);
|
| 1038 |
+
|
| 1039 |
+
retval = __Pyx_Coroutine_Send((PyObject *)gen, arg);
|
| 1040 |
+
if (o->agt_args) {
|
| 1041 |
+
return __Pyx_async_gen_unwrap_value(o->agt_gen, retval);
|
| 1042 |
+
} else {
|
| 1043 |
+
/* aclose() mode */
|
| 1044 |
+
if (retval) {
|
| 1045 |
+
if (unlikely(__pyx__PyAsyncGenWrappedValue_CheckExact(retval))) {
|
| 1046 |
+
Py_DECREF(retval);
|
| 1047 |
+
goto yield_close;
|
| 1048 |
+
}
|
| 1049 |
+
else {
|
| 1050 |
+
return retval;
|
| 1051 |
+
}
|
| 1052 |
+
}
|
| 1053 |
+
else {
|
| 1054 |
+
goto check_error;
|
| 1055 |
+
}
|
| 1056 |
+
}
|
| 1057 |
+
|
| 1058 |
+
yield_close:
|
| 1059 |
+
o->agt_gen->ag_running_async = 0;
|
| 1060 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 1061 |
+
PyErr_SetString(
|
| 1062 |
+
PyExc_RuntimeError, __Pyx_ASYNC_GEN_IGNORED_EXIT_MSG);
|
| 1063 |
+
return NULL;
|
| 1064 |
+
|
| 1065 |
+
check_error:
|
| 1066 |
+
o->agt_gen->ag_running_async = 0;
|
| 1067 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 1068 |
+
exc_type = PyErr_Occurred();
|
| 1069 |
+
if (__Pyx_PyErr_GivenExceptionMatches2(exc_type, __Pyx_PyExc_StopAsyncIteration, PyExc_GeneratorExit)) {
|
| 1070 |
+
if (o->agt_args == NULL) {
|
| 1071 |
+
// when aclose() is called we don't want to propagate
|
| 1072 |
+
// StopAsyncIteration or GeneratorExit; just raise
|
| 1073 |
+
// StopIteration, signalling that this 'aclose()' await
|
| 1074 |
+
// is done.
|
| 1075 |
+
PyErr_Clear();
|
| 1076 |
+
PyErr_SetNone(PyExc_StopIteration);
|
| 1077 |
+
}
|
| 1078 |
+
}
|
| 1079 |
+
return NULL;
|
| 1080 |
+
}
|
| 1081 |
+
|
| 1082 |
+
|
| 1083 |
+
static PyObject *
|
| 1084 |
+
__Pyx_async_gen_athrow_throw(__pyx_PyAsyncGenAThrow *o, PyObject *args)
|
| 1085 |
+
{
|
| 1086 |
+
PyObject *retval;
|
| 1087 |
+
|
| 1088 |
+
if (unlikely(o->agt_state == __PYX_AWAITABLE_STATE_CLOSED)) {
|
| 1089 |
+
PyErr_SetString(PyExc_RuntimeError, __Pyx_ASYNC_GEN_CANNOT_REUSE_CLOSE_MSG);
|
| 1090 |
+
return NULL;
|
| 1091 |
+
}
|
| 1092 |
+
|
| 1093 |
+
retval = __Pyx_Coroutine_Throw((PyObject*)o->agt_gen, args);
|
| 1094 |
+
if (o->agt_args) {
|
| 1095 |
+
return __Pyx_async_gen_unwrap_value(o->agt_gen, retval);
|
| 1096 |
+
} else {
|
| 1097 |
+
// aclose() mode
|
| 1098 |
+
PyObject *exc_type;
|
| 1099 |
+
if (unlikely(retval && __pyx__PyAsyncGenWrappedValue_CheckExact(retval))) {
|
| 1100 |
+
o->agt_gen->ag_running_async = 0;
|
| 1101 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 1102 |
+
Py_DECREF(retval);
|
| 1103 |
+
PyErr_SetString(PyExc_RuntimeError, __Pyx_ASYNC_GEN_IGNORED_EXIT_MSG);
|
| 1104 |
+
return NULL;
|
| 1105 |
+
}
|
| 1106 |
+
exc_type = PyErr_Occurred();
|
| 1107 |
+
if (__Pyx_PyErr_GivenExceptionMatches2(exc_type, __Pyx_PyExc_StopAsyncIteration, PyExc_GeneratorExit)) {
|
| 1108 |
+
// when aclose() is called we don't want to propagate
|
| 1109 |
+
// StopAsyncIteration or GeneratorExit; just raise
|
| 1110 |
+
// StopIteration, signalling that this 'aclose()' await
|
| 1111 |
+
// is done.
|
| 1112 |
+
PyErr_Clear();
|
| 1113 |
+
PyErr_SetNone(PyExc_StopIteration);
|
| 1114 |
+
}
|
| 1115 |
+
return retval;
|
| 1116 |
+
}
|
| 1117 |
+
}
|
| 1118 |
+
|
| 1119 |
+
|
| 1120 |
+
static PyObject *
|
| 1121 |
+
__Pyx_async_gen_athrow_iternext(__pyx_PyAsyncGenAThrow *o)
|
| 1122 |
+
{
|
| 1123 |
+
return __Pyx_async_gen_athrow_send(o, Py_None);
|
| 1124 |
+
}
|
| 1125 |
+
|
| 1126 |
+
|
| 1127 |
+
static PyObject *
|
| 1128 |
+
__Pyx_async_gen_athrow_close(PyObject *g, PyObject *args)
|
| 1129 |
+
{
|
| 1130 |
+
__pyx_PyAsyncGenAThrow *o = (__pyx_PyAsyncGenAThrow*) g;
|
| 1131 |
+
CYTHON_UNUSED_VAR(args);
|
| 1132 |
+
o->agt_state = __PYX_AWAITABLE_STATE_CLOSED;
|
| 1133 |
+
Py_RETURN_NONE;
|
| 1134 |
+
}
|
| 1135 |
+
|
| 1136 |
+
|
| 1137 |
+
static PyMethodDef __Pyx_async_gen_athrow_methods[] = {
|
| 1138 |
+
{"send", (PyCFunction)__Pyx_async_gen_athrow_send, METH_O, __Pyx_async_gen_send_doc},
|
| 1139 |
+
{"throw", (PyCFunction)__Pyx_async_gen_athrow_throw, METH_VARARGS, __Pyx_async_gen_throw_doc},
|
| 1140 |
+
{"close", (PyCFunction)__Pyx_async_gen_athrow_close, METH_NOARGS, __Pyx_async_gen_close_doc},
|
| 1141 |
+
{"__await__", (PyCFunction)__Pyx_async_gen_self_method, METH_NOARGS, __Pyx_async_gen_await_doc},
|
| 1142 |
+
{0, 0, 0, 0} /* Sentinel */
|
| 1143 |
+
};
|
| 1144 |
+
|
| 1145 |
+
|
| 1146 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 1147 |
+
static PyType_Slot __pyx__PyAsyncGenAThrowType_slots[] = {
|
| 1148 |
+
{Py_tp_dealloc, (void *)__Pyx_async_gen_athrow_dealloc},
|
| 1149 |
+
{Py_am_await, (void *)PyObject_SelfIter},
|
| 1150 |
+
{Py_tp_traverse, (void *)__Pyx_async_gen_athrow_traverse},
|
| 1151 |
+
{Py_tp_iter, (void *)PyObject_SelfIter},
|
| 1152 |
+
{Py_tp_iternext, (void *)__Pyx_async_gen_athrow_iternext},
|
| 1153 |
+
{Py_tp_methods, (void *)__Pyx_async_gen_athrow_methods},
|
| 1154 |
+
{Py_tp_getattro, (void *)__Pyx_PyObject_GenericGetAttrNoDict},
|
| 1155 |
+
{0, 0},
|
| 1156 |
+
};
|
| 1157 |
+
|
| 1158 |
+
static PyType_Spec __pyx__PyAsyncGenAThrowType_spec = {
|
| 1159 |
+
__PYX_TYPE_MODULE_PREFIX "async_generator_athrow",
|
| 1160 |
+
sizeof(__pyx_PyAsyncGenAThrow),
|
| 1161 |
+
0,
|
| 1162 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
| 1163 |
+
__pyx__PyAsyncGenAThrowType_slots
|
| 1164 |
+
};
|
| 1165 |
+
#else /* CYTHON_USE_TYPE_SPECS */
|
| 1166 |
+
|
| 1167 |
+
#if CYTHON_USE_ASYNC_SLOTS
|
| 1168 |
+
static __Pyx_PyAsyncMethodsStruct __Pyx_async_gen_athrow_as_async = {
|
| 1169 |
+
PyObject_SelfIter, /* am_await */
|
| 1170 |
+
0, /* am_aiter */
|
| 1171 |
+
0, /* am_anext */
|
| 1172 |
+
#if PY_VERSION_HEX >= 0x030A00A3
|
| 1173 |
+
0, /*am_send*/
|
| 1174 |
+
#endif
|
| 1175 |
+
};
|
| 1176 |
+
#endif
|
| 1177 |
+
|
| 1178 |
+
static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
|
| 1179 |
+
PyVarObject_HEAD_INIT(0, 0)
|
| 1180 |
+
"async_generator_athrow", /* tp_name */
|
| 1181 |
+
sizeof(__pyx_PyAsyncGenAThrow), /* tp_basicsize */
|
| 1182 |
+
0, /* tp_itemsize */
|
| 1183 |
+
(destructor)__Pyx_async_gen_athrow_dealloc, /* tp_dealloc */
|
| 1184 |
+
0, /* tp_vectorcall_offset */
|
| 1185 |
+
0, /* tp_getattr */
|
| 1186 |
+
0, /* tp_setattr */
|
| 1187 |
+
#if CYTHON_USE_ASYNC_SLOTS
|
| 1188 |
+
&__Pyx_async_gen_athrow_as_async, /* tp_as_async */
|
| 1189 |
+
#else
|
| 1190 |
+
0, /*tp_reserved*/
|
| 1191 |
+
#endif
|
| 1192 |
+
0, /* tp_repr */
|
| 1193 |
+
0, /* tp_as_number */
|
| 1194 |
+
0, /* tp_as_sequence */
|
| 1195 |
+
0, /* tp_as_mapping */
|
| 1196 |
+
0, /* tp_hash */
|
| 1197 |
+
0, /* tp_call */
|
| 1198 |
+
0, /* tp_str */
|
| 1199 |
+
0, /* tp_getattro */
|
| 1200 |
+
0, /* tp_setattro */
|
| 1201 |
+
0, /* tp_as_buffer */
|
| 1202 |
+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
| 1203 |
+
0, /* tp_doc */
|
| 1204 |
+
(traverseproc)__Pyx_async_gen_athrow_traverse, /* tp_traverse */
|
| 1205 |
+
0, /* tp_clear */
|
| 1206 |
+
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
|
| 1207 |
+
// in order to (mis-)use tp_reserved above, we must also implement tp_richcompare
|
| 1208 |
+
__Pyx_Coroutine_compare, /*tp_richcompare*/
|
| 1209 |
+
#else
|
| 1210 |
+
0, /*tp_richcompare*/
|
| 1211 |
+
#endif
|
| 1212 |
+
0, /* tp_weaklistoffset */
|
| 1213 |
+
PyObject_SelfIter, /* tp_iter */
|
| 1214 |
+
(iternextfunc)__Pyx_async_gen_athrow_iternext, /* tp_iternext */
|
| 1215 |
+
__Pyx_async_gen_athrow_methods, /* tp_methods */
|
| 1216 |
+
0, /* tp_members */
|
| 1217 |
+
0, /* tp_getset */
|
| 1218 |
+
0, /* tp_base */
|
| 1219 |
+
0, /* tp_dict */
|
| 1220 |
+
0, /* tp_descr_get */
|
| 1221 |
+
0, /* tp_descr_set */
|
| 1222 |
+
0, /* tp_dictoffset */
|
| 1223 |
+
0, /* tp_init */
|
| 1224 |
+
0, /* tp_alloc */
|
| 1225 |
+
0, /* tp_new */
|
| 1226 |
+
0, /* tp_free */
|
| 1227 |
+
0, /* tp_is_gc */
|
| 1228 |
+
0, /* tp_bases */
|
| 1229 |
+
0, /* tp_mro */
|
| 1230 |
+
0, /* tp_cache */
|
| 1231 |
+
0, /* tp_subclasses */
|
| 1232 |
+
0, /* tp_weaklist */
|
| 1233 |
+
0, /* tp_del */
|
| 1234 |
+
0, /* tp_version_tag */
|
| 1235 |
+
#if PY_VERSION_HEX >= 0x030400a1
|
| 1236 |
+
0, /* tp_finalize */
|
| 1237 |
+
#endif
|
| 1238 |
+
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
| 1239 |
+
0, /*tp_vectorcall*/
|
| 1240 |
+
#endif
|
| 1241 |
+
#if __PYX_NEED_TP_PRINT_SLOT
|
| 1242 |
+
0, /*tp_print*/
|
| 1243 |
+
#endif
|
| 1244 |
+
#if PY_VERSION_HEX >= 0x030C0000
|
| 1245 |
+
0, /*tp_watched*/
|
| 1246 |
+
#endif
|
| 1247 |
+
#if PY_VERSION_HEX >= 0x030d00A4
|
| 1248 |
+
0, /*tp_versions_used*/
|
| 1249 |
+
#endif
|
| 1250 |
+
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
| 1251 |
+
0, /*tp_pypy_flags*/
|
| 1252 |
+
#endif
|
| 1253 |
+
};
|
| 1254 |
+
#endif /* CYTHON_USE_TYPE_SPECS */
|
| 1255 |
+
|
| 1256 |
+
|
| 1257 |
+
static PyObject *
|
| 1258 |
+
__Pyx_async_gen_athrow_new(__pyx_PyAsyncGenObject *gen, PyObject *args)
|
| 1259 |
+
{
|
| 1260 |
+
__pyx_PyAsyncGenAThrow *o;
|
| 1261 |
+
o = PyObject_GC_New(__pyx_PyAsyncGenAThrow, __pyx__PyAsyncGenAThrowType);
|
| 1262 |
+
if (unlikely(o == NULL)) {
|
| 1263 |
+
return NULL;
|
| 1264 |
+
}
|
| 1265 |
+
o->agt_gen = gen;
|
| 1266 |
+
o->agt_args = args;
|
| 1267 |
+
o->agt_state = __PYX_AWAITABLE_STATE_INIT;
|
| 1268 |
+
Py_INCREF(gen);
|
| 1269 |
+
Py_XINCREF(args);
|
| 1270 |
+
PyObject_GC_Track((PyObject*)o);
|
| 1271 |
+
return (PyObject*)o;
|
| 1272 |
+
}
|
| 1273 |
+
|
| 1274 |
+
|
| 1275 |
+
/* ---------- global type sharing ------------ */
|
| 1276 |
+
|
| 1277 |
+
static int __pyx_AsyncGen_init(PyObject *module) {
|
| 1278 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 1279 |
+
__pyx_AsyncGenType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_AsyncGenType_spec, NULL);
|
| 1280 |
+
#else
|
| 1281 |
+
CYTHON_MAYBE_UNUSED_VAR(module);
|
| 1282 |
+
// on Windows, C-API functions can't be used in slots statically
|
| 1283 |
+
__pyx_AsyncGenType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
|
| 1284 |
+
__pyx_AsyncGenType = __Pyx_FetchCommonType(&__pyx_AsyncGenType_type);
|
| 1285 |
+
#endif
|
| 1286 |
+
if (unlikely(!__pyx_AsyncGenType))
|
| 1287 |
+
return -1;
|
| 1288 |
+
|
| 1289 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 1290 |
+
__pyx__PyAsyncGenAThrowType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx__PyAsyncGenAThrowType_spec, NULL);
|
| 1291 |
+
#else
|
| 1292 |
+
__pyx__PyAsyncGenAThrowType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
|
| 1293 |
+
__pyx__PyAsyncGenAThrowType = __Pyx_FetchCommonType(&__pyx__PyAsyncGenAThrowType_type);
|
| 1294 |
+
#endif
|
| 1295 |
+
if (unlikely(!__pyx__PyAsyncGenAThrowType))
|
| 1296 |
+
return -1;
|
| 1297 |
+
|
| 1298 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 1299 |
+
__pyx__PyAsyncGenWrappedValueType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx__PyAsyncGenWrappedValueType_spec, NULL);
|
| 1300 |
+
#else
|
| 1301 |
+
__pyx__PyAsyncGenWrappedValueType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
|
| 1302 |
+
__pyx__PyAsyncGenWrappedValueType = __Pyx_FetchCommonType(&__pyx__PyAsyncGenWrappedValueType_type);
|
| 1303 |
+
#endif
|
| 1304 |
+
if (unlikely(!__pyx__PyAsyncGenWrappedValueType))
|
| 1305 |
+
return -1;
|
| 1306 |
+
|
| 1307 |
+
#if CYTHON_USE_TYPE_SPECS
|
| 1308 |
+
__pyx__PyAsyncGenASendType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx__PyAsyncGenASendType_spec, NULL);
|
| 1309 |
+
#else
|
| 1310 |
+
__pyx__PyAsyncGenASendType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
|
| 1311 |
+
__pyx__PyAsyncGenASendType = __Pyx_FetchCommonType(&__pyx__PyAsyncGenASendType_type);
|
| 1312 |
+
#endif
|
| 1313 |
+
if (unlikely(!__pyx__PyAsyncGenASendType))
|
| 1314 |
+
return -1;
|
| 1315 |
+
|
| 1316 |
+
return 0;
|
| 1317 |
+
}
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Buffer.c
ADDED
|
@@ -0,0 +1,933 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 |
+
} __Pyx_Buf_DimInfo;
|
| 8 |
+
|
| 9 |
+
typedef struct {
|
| 10 |
+
size_t refcount;
|
| 11 |
+
Py_buffer pybuffer;
|
| 12 |
+
} __Pyx_Buffer;
|
| 13 |
+
|
| 14 |
+
typedef struct {
|
| 15 |
+
__Pyx_Buffer *rcbuffer;
|
| 16 |
+
char *data;
|
| 17 |
+
__Pyx_Buf_DimInfo diminfo[{{max_dims}}];
|
| 18 |
+
} __Pyx_LocalBuf_ND;
|
| 19 |
+
|
| 20 |
+
/////////////// BufferIndexError.proto ///////////////
|
| 21 |
+
static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
|
| 22 |
+
|
| 23 |
+
/////////////// BufferIndexError ///////////////
|
| 24 |
+
static void __Pyx_RaiseBufferIndexError(int axis) {
|
| 25 |
+
PyErr_Format(PyExc_IndexError,
|
| 26 |
+
"Out of bounds on buffer access (axis %d)", axis);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/////////////// BufferIndexErrorNogil.proto ///////////////
|
| 30 |
+
//@requires: BufferIndexError
|
| 31 |
+
|
| 32 |
+
static void __Pyx_RaiseBufferIndexErrorNogil(int axis); /*proto*/
|
| 33 |
+
|
| 34 |
+
/////////////// BufferIndexErrorNogil ///////////////
|
| 35 |
+
static void __Pyx_RaiseBufferIndexErrorNogil(int axis) {
|
| 36 |
+
#ifdef WITH_THREAD
|
| 37 |
+
PyGILState_STATE gilstate = PyGILState_Ensure();
|
| 38 |
+
#endif
|
| 39 |
+
__Pyx_RaiseBufferIndexError(axis);
|
| 40 |
+
#ifdef WITH_THREAD
|
| 41 |
+
PyGILState_Release(gilstate);
|
| 42 |
+
#endif
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/////////////// BufferFallbackError.proto ///////////////
|
| 46 |
+
static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
|
| 47 |
+
|
| 48 |
+
/////////////// BufferFallbackError ///////////////
|
| 49 |
+
static void __Pyx_RaiseBufferFallbackError(void) {
|
| 50 |
+
PyErr_SetString(PyExc_ValueError,
|
| 51 |
+
"Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/////////////// BufferFormatStructs.proto ///////////////
|
| 55 |
+
//@proto_block: utility_code_proto_before_types
|
| 56 |
+
|
| 57 |
+
/* Run-time type information about structs used with buffers */
|
| 58 |
+
struct __Pyx_StructField_;
|
| 59 |
+
|
| 60 |
+
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
|
| 61 |
+
|
| 62 |
+
typedef struct {
|
| 63 |
+
const char* name; /* for error messages only */
|
| 64 |
+
struct __Pyx_StructField_* fields;
|
| 65 |
+
size_t size; /* sizeof(type) */
|
| 66 |
+
size_t arraysize[8]; /* length of array in each dimension */
|
| 67 |
+
int ndim;
|
| 68 |
+
char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
|
| 69 |
+
char is_unsigned;
|
| 70 |
+
int flags;
|
| 71 |
+
} __Pyx_TypeInfo;
|
| 72 |
+
|
| 73 |
+
typedef struct __Pyx_StructField_ {
|
| 74 |
+
__Pyx_TypeInfo* type;
|
| 75 |
+
const char* name;
|
| 76 |
+
size_t offset;
|
| 77 |
+
} __Pyx_StructField;
|
| 78 |
+
|
| 79 |
+
typedef struct {
|
| 80 |
+
__Pyx_StructField* field;
|
| 81 |
+
size_t parent_offset;
|
| 82 |
+
} __Pyx_BufFmt_StackElem;
|
| 83 |
+
|
| 84 |
+
typedef struct {
|
| 85 |
+
__Pyx_StructField root;
|
| 86 |
+
__Pyx_BufFmt_StackElem* head;
|
| 87 |
+
size_t fmt_offset;
|
| 88 |
+
size_t new_count, enc_count;
|
| 89 |
+
size_t struct_alignment;
|
| 90 |
+
int is_complex;
|
| 91 |
+
char enc_type;
|
| 92 |
+
char new_packmode;
|
| 93 |
+
char enc_packmode;
|
| 94 |
+
char is_valid_array;
|
| 95 |
+
} __Pyx_BufFmt_Context;
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
/////////////// GetAndReleaseBuffer.proto ///////////////
|
| 99 |
+
|
| 100 |
+
#if PY_MAJOR_VERSION < 3
|
| 101 |
+
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
|
| 102 |
+
static void __Pyx_ReleaseBuffer(Py_buffer *view);
|
| 103 |
+
#else
|
| 104 |
+
#define __Pyx_GetBuffer PyObject_GetBuffer
|
| 105 |
+
#define __Pyx_ReleaseBuffer PyBuffer_Release
|
| 106 |
+
#endif
|
| 107 |
+
|
| 108 |
+
/////////////// GetAndReleaseBuffer ///////////////
|
| 109 |
+
|
| 110 |
+
#if PY_MAJOR_VERSION < 3
|
| 111 |
+
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
|
| 112 |
+
__Pyx_TypeName obj_type_name;
|
| 113 |
+
if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
|
| 114 |
+
|
| 115 |
+
{{for type_ptr, getbuffer, releasebuffer in types}}
|
| 116 |
+
{{if getbuffer}}
|
| 117 |
+
if (__Pyx_TypeCheck(obj, {{type_ptr}})) return {{getbuffer}}(obj, view, flags);
|
| 118 |
+
{{endif}}
|
| 119 |
+
{{endfor}}
|
| 120 |
+
|
| 121 |
+
obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
|
| 122 |
+
PyErr_Format(PyExc_TypeError,
|
| 123 |
+
"'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
|
| 124 |
+
obj_type_name);
|
| 125 |
+
__Pyx_DECREF_TypeName(obj_type_name);
|
| 126 |
+
return -1;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
|
| 130 |
+
PyObject *obj = view->obj;
|
| 131 |
+
if (!obj) return;
|
| 132 |
+
|
| 133 |
+
if (PyObject_CheckBuffer(obj)) {
|
| 134 |
+
PyBuffer_Release(view);
|
| 135 |
+
return;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
if ((0)) {}
|
| 139 |
+
{{for type_ptr, getbuffer, releasebuffer in types}}
|
| 140 |
+
{{if releasebuffer}}
|
| 141 |
+
else if (__Pyx_TypeCheck(obj, {{type_ptr}})) {{releasebuffer}}(obj, view);
|
| 142 |
+
{{endif}}
|
| 143 |
+
{{endfor}}
|
| 144 |
+
|
| 145 |
+
view->obj = NULL;
|
| 146 |
+
Py_DECREF(obj);
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
#endif /* PY_MAJOR_VERSION < 3 */
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
/////////////// BufferGetAndValidate.proto ///////////////
|
| 153 |
+
|
| 154 |
+
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack) \
|
| 155 |
+
((obj == Py_None || obj == NULL) ? \
|
| 156 |
+
(__Pyx_ZeroBuffer(buf), 0) : \
|
| 157 |
+
__Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
|
| 158 |
+
|
| 159 |
+
static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
|
| 160 |
+
__Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
|
| 161 |
+
static void __Pyx_ZeroBuffer(Py_buffer* buf);
|
| 162 |
+
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);/*proto*/
|
| 163 |
+
|
| 164 |
+
static Py_ssize_t __Pyx_minusones[] = { {{ ", ".join(["-1"] * max_dims) }} };
|
| 165 |
+
static Py_ssize_t __Pyx_zeros[] = { {{ ", ".join(["0"] * max_dims) }} };
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
/////////////// BufferGetAndValidate ///////////////
|
| 169 |
+
//@requires: BufferFormatCheck
|
| 170 |
+
|
| 171 |
+
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
|
| 172 |
+
if (unlikely(info->buf == NULL)) return;
|
| 173 |
+
if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
|
| 174 |
+
__Pyx_ReleaseBuffer(info);
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
static void __Pyx_ZeroBuffer(Py_buffer* buf) {
|
| 178 |
+
buf->buf = NULL;
|
| 179 |
+
buf->obj = NULL;
|
| 180 |
+
buf->strides = __Pyx_zeros;
|
| 181 |
+
buf->shape = __Pyx_zeros;
|
| 182 |
+
buf->suboffsets = __Pyx_minusones;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
static int __Pyx__GetBufferAndValidate(
|
| 186 |
+
Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
|
| 187 |
+
int nd, int cast, __Pyx_BufFmt_StackElem* stack)
|
| 188 |
+
{
|
| 189 |
+
buf->buf = NULL;
|
| 190 |
+
if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
|
| 191 |
+
__Pyx_ZeroBuffer(buf);
|
| 192 |
+
return -1;
|
| 193 |
+
}
|
| 194 |
+
// From this point on, we have acquired the buffer and must release it on errors.
|
| 195 |
+
if (unlikely(buf->ndim != nd)) {
|
| 196 |
+
PyErr_Format(PyExc_ValueError,
|
| 197 |
+
"Buffer has wrong number of dimensions (expected %d, got %d)",
|
| 198 |
+
nd, buf->ndim);
|
| 199 |
+
goto fail;
|
| 200 |
+
}
|
| 201 |
+
if (!cast) {
|
| 202 |
+
__Pyx_BufFmt_Context ctx;
|
| 203 |
+
__Pyx_BufFmt_Init(&ctx, stack, dtype);
|
| 204 |
+
if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
|
| 205 |
+
}
|
| 206 |
+
if (unlikely((size_t)buf->itemsize != dtype->size)) {
|
| 207 |
+
PyErr_Format(PyExc_ValueError,
|
| 208 |
+
"Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
|
| 209 |
+
buf->itemsize, (buf->itemsize > 1) ? "s" : "",
|
| 210 |
+
dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
|
| 211 |
+
goto fail;
|
| 212 |
+
}
|
| 213 |
+
if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
|
| 214 |
+
return 0;
|
| 215 |
+
fail:;
|
| 216 |
+
__Pyx_SafeReleaseBuffer(buf);
|
| 217 |
+
return -1;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
/////////////// BufferFormatCheck.proto ///////////////
|
| 222 |
+
|
| 223 |
+
// Buffer format string checking
|
| 224 |
+
//
|
| 225 |
+
// Buffer type checking. Utility code for checking that acquired
|
| 226 |
+
// buffers match our assumptions. We only need to check ndim and
|
| 227 |
+
// the format string; the access mode/flags is checked by the
|
| 228 |
+
// exporter. See:
|
| 229 |
+
//
|
| 230 |
+
// https://docs.python.org/3/library/struct.html
|
| 231 |
+
// https://www.python.org/dev/peps/pep-3118/#additions-to-the-struct-string-syntax
|
| 232 |
+
//
|
| 233 |
+
// The alignment code is copied from _struct.c in Python.
|
| 234 |
+
|
| 235 |
+
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
|
| 236 |
+
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
|
| 237 |
+
__Pyx_BufFmt_StackElem* stack,
|
| 238 |
+
__Pyx_TypeInfo* type); /*proto*/
|
| 239 |
+
|
| 240 |
+
/////////////// BufferFormatCheck ///////////////
|
| 241 |
+
//@requires: ModuleSetupCode.c::IsLittleEndian
|
| 242 |
+
//@requires: BufferFormatStructs
|
| 243 |
+
|
| 244 |
+
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
|
| 245 |
+
__Pyx_BufFmt_StackElem* stack,
|
| 246 |
+
__Pyx_TypeInfo* type) {
|
| 247 |
+
stack[0].field = &ctx->root;
|
| 248 |
+
stack[0].parent_offset = 0;
|
| 249 |
+
ctx->root.type = type;
|
| 250 |
+
ctx->root.name = "buffer dtype";
|
| 251 |
+
ctx->root.offset = 0;
|
| 252 |
+
ctx->head = stack;
|
| 253 |
+
ctx->head->field = &ctx->root;
|
| 254 |
+
ctx->fmt_offset = 0;
|
| 255 |
+
ctx->head->parent_offset = 0;
|
| 256 |
+
ctx->new_packmode = '@';
|
| 257 |
+
ctx->enc_packmode = '@';
|
| 258 |
+
ctx->new_count = 1;
|
| 259 |
+
ctx->enc_count = 0;
|
| 260 |
+
ctx->enc_type = 0;
|
| 261 |
+
ctx->is_complex = 0;
|
| 262 |
+
ctx->is_valid_array = 0;
|
| 263 |
+
ctx->struct_alignment = 0;
|
| 264 |
+
while (type->typegroup == 'S') {
|
| 265 |
+
++ctx->head;
|
| 266 |
+
ctx->head->field = type->fields;
|
| 267 |
+
ctx->head->parent_offset = 0;
|
| 268 |
+
type = type->fields->type;
|
| 269 |
+
}
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
|
| 273 |
+
int count;
|
| 274 |
+
const char* t = *ts;
|
| 275 |
+
if (*t < '0' || *t > '9') {
|
| 276 |
+
return -1;
|
| 277 |
+
} else {
|
| 278 |
+
count = *t++ - '0';
|
| 279 |
+
while (*t >= '0' && *t <= '9') {
|
| 280 |
+
count *= 10;
|
| 281 |
+
count += *t++ - '0';
|
| 282 |
+
}
|
| 283 |
+
}
|
| 284 |
+
*ts = t;
|
| 285 |
+
return count;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
|
| 289 |
+
int number = __Pyx_BufFmt_ParseNumber(ts);
|
| 290 |
+
if (number == -1) /* First char was not a digit */
|
| 291 |
+
PyErr_Format(PyExc_ValueError,\
|
| 292 |
+
"Does not understand character buffer dtype format string ('%c')", **ts);
|
| 293 |
+
return number;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
|
| 297 |
+
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
|
| 298 |
+
PyErr_Format(PyExc_ValueError,
|
| 299 |
+
"Unexpected format string character: '%c'", ch);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
|
| 303 |
+
switch (ch) {
|
| 304 |
+
case '?': return "'bool'";
|
| 305 |
+
case 'c': return "'char'";
|
| 306 |
+
case 'b': return "'signed char'";
|
| 307 |
+
case 'B': return "'unsigned char'";
|
| 308 |
+
case 'h': return "'short'";
|
| 309 |
+
case 'H': return "'unsigned short'";
|
| 310 |
+
case 'i': return "'int'";
|
| 311 |
+
case 'I': return "'unsigned int'";
|
| 312 |
+
case 'l': return "'long'";
|
| 313 |
+
case 'L': return "'unsigned long'";
|
| 314 |
+
case 'q': return "'long long'";
|
| 315 |
+
case 'Q': return "'unsigned long long'";
|
| 316 |
+
case 'f': return (is_complex ? "'complex float'" : "'float'");
|
| 317 |
+
case 'd': return (is_complex ? "'complex double'" : "'double'");
|
| 318 |
+
case 'g': return (is_complex ? "'complex long double'" : "'long double'");
|
| 319 |
+
case 'T': return "a struct";
|
| 320 |
+
case 'O': return "Python object";
|
| 321 |
+
case 'P': return "a pointer";
|
| 322 |
+
case 's': case 'p': return "a string";
|
| 323 |
+
case 0: return "end";
|
| 324 |
+
default: return "unparsable format string";
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
|
| 329 |
+
switch (ch) {
|
| 330 |
+
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
|
| 331 |
+
case 'h': case 'H': return 2;
|
| 332 |
+
case 'i': case 'I': case 'l': case 'L': return 4;
|
| 333 |
+
case 'q': case 'Q': return 8;
|
| 334 |
+
case 'f': return (is_complex ? 8 : 4);
|
| 335 |
+
case 'd': return (is_complex ? 16 : 8);
|
| 336 |
+
case 'g': {
|
| 337 |
+
PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
|
| 338 |
+
return 0;
|
| 339 |
+
}
|
| 340 |
+
case 'O': case 'P': return sizeof(void*);
|
| 341 |
+
default:
|
| 342 |
+
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
|
| 343 |
+
return 0;
|
| 344 |
+
}
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
|
| 348 |
+
switch (ch) {
|
| 349 |
+
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
|
| 350 |
+
case 'h': case 'H': return sizeof(short);
|
| 351 |
+
case 'i': case 'I': return sizeof(int);
|
| 352 |
+
case 'l': case 'L': return sizeof(long);
|
| 353 |
+
#ifdef HAVE_LONG_LONG
|
| 354 |
+
case 'q': case 'Q': return sizeof(PY_LONG_LONG);
|
| 355 |
+
#endif
|
| 356 |
+
case 'f': return sizeof(float) * (is_complex ? 2 : 1);
|
| 357 |
+
case 'd': return sizeof(double) * (is_complex ? 2 : 1);
|
| 358 |
+
case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
|
| 359 |
+
case 'O': case 'P': return sizeof(void*);
|
| 360 |
+
default: {
|
| 361 |
+
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
|
| 362 |
+
return 0;
|
| 363 |
+
}
|
| 364 |
+
}
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
typedef struct { char c; short x; } __Pyx_st_short;
|
| 368 |
+
typedef struct { char c; int x; } __Pyx_st_int;
|
| 369 |
+
typedef struct { char c; long x; } __Pyx_st_long;
|
| 370 |
+
typedef struct { char c; float x; } __Pyx_st_float;
|
| 371 |
+
typedef struct { char c; double x; } __Pyx_st_double;
|
| 372 |
+
typedef struct { char c; long double x; } __Pyx_st_longdouble;
|
| 373 |
+
typedef struct { char c; void *x; } __Pyx_st_void_p;
|
| 374 |
+
#ifdef HAVE_LONG_LONG
|
| 375 |
+
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
|
| 376 |
+
#endif
|
| 377 |
+
|
| 378 |
+
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
|
| 379 |
+
CYTHON_UNUSED_VAR(is_complex);
|
| 380 |
+
switch (ch) {
|
| 381 |
+
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
|
| 382 |
+
case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
|
| 383 |
+
case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
|
| 384 |
+
case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
|
| 385 |
+
#ifdef HAVE_LONG_LONG
|
| 386 |
+
case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
|
| 387 |
+
#endif
|
| 388 |
+
case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
|
| 389 |
+
case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
|
| 390 |
+
case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
|
| 391 |
+
case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
|
| 392 |
+
default:
|
| 393 |
+
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
|
| 394 |
+
return 0;
|
| 395 |
+
}
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
/* These are for computing the padding at the end of the struct to align
|
| 399 |
+
on the first member of the struct. This will probably the same as above,
|
| 400 |
+
but we don't have any guarantees.
|
| 401 |
+
*/
|
| 402 |
+
typedef struct { short x; char c; } __Pyx_pad_short;
|
| 403 |
+
typedef struct { int x; char c; } __Pyx_pad_int;
|
| 404 |
+
typedef struct { long x; char c; } __Pyx_pad_long;
|
| 405 |
+
typedef struct { float x; char c; } __Pyx_pad_float;
|
| 406 |
+
typedef struct { double x; char c; } __Pyx_pad_double;
|
| 407 |
+
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
|
| 408 |
+
typedef struct { void *x; char c; } __Pyx_pad_void_p;
|
| 409 |
+
#ifdef HAVE_LONG_LONG
|
| 410 |
+
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
|
| 411 |
+
#endif
|
| 412 |
+
|
| 413 |
+
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
|
| 414 |
+
CYTHON_UNUSED_VAR(is_complex);
|
| 415 |
+
switch (ch) {
|
| 416 |
+
case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
|
| 417 |
+
case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
|
| 418 |
+
case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
|
| 419 |
+
case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
|
| 420 |
+
#ifdef HAVE_LONG_LONG
|
| 421 |
+
case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
|
| 422 |
+
#endif
|
| 423 |
+
case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
|
| 424 |
+
case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
|
| 425 |
+
case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
|
| 426 |
+
case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
|
| 427 |
+
default:
|
| 428 |
+
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
|
| 429 |
+
return 0;
|
| 430 |
+
}
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
|
| 434 |
+
switch (ch) {
|
| 435 |
+
case 'c':
|
| 436 |
+
return 'H';
|
| 437 |
+
case 'b': case 'h': case 'i':
|
| 438 |
+
case 'l': case 'q': case 's': case 'p':
|
| 439 |
+
return 'I';
|
| 440 |
+
case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
|
| 441 |
+
return 'U';
|
| 442 |
+
case 'f': case 'd': case 'g':
|
| 443 |
+
return (is_complex ? 'C' : 'R');
|
| 444 |
+
case 'O':
|
| 445 |
+
return 'O';
|
| 446 |
+
case 'P':
|
| 447 |
+
return 'P';
|
| 448 |
+
default: {
|
| 449 |
+
__Pyx_BufFmt_RaiseUnexpectedChar(ch);
|
| 450 |
+
return 0;
|
| 451 |
+
}
|
| 452 |
+
}
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
|
| 456 |
+
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
|
| 457 |
+
if (ctx->head == NULL || ctx->head->field == &ctx->root) {
|
| 458 |
+
const char* expected;
|
| 459 |
+
const char* quote;
|
| 460 |
+
if (ctx->head == NULL) {
|
| 461 |
+
expected = "end";
|
| 462 |
+
quote = "";
|
| 463 |
+
} else {
|
| 464 |
+
expected = ctx->head->field->type->name;
|
| 465 |
+
quote = "'";
|
| 466 |
+
}
|
| 467 |
+
PyErr_Format(PyExc_ValueError,
|
| 468 |
+
"Buffer dtype mismatch, expected %s%s%s but got %s",
|
| 469 |
+
quote, expected, quote,
|
| 470 |
+
__Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
|
| 471 |
+
} else {
|
| 472 |
+
__Pyx_StructField* field = ctx->head->field;
|
| 473 |
+
__Pyx_StructField* parent = (ctx->head - 1)->field;
|
| 474 |
+
PyErr_Format(PyExc_ValueError,
|
| 475 |
+
"Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
|
| 476 |
+
field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
|
| 477 |
+
parent->type->name, field->name);
|
| 478 |
+
}
|
| 479 |
+
}
|
| 480 |
+
|
| 481 |
+
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
|
| 482 |
+
char group;
|
| 483 |
+
size_t size, offset, arraysize = 1;
|
| 484 |
+
|
| 485 |
+
/* printf("processing... %s\n", ctx->head->field->type->name); */
|
| 486 |
+
|
| 487 |
+
if (ctx->enc_type == 0) return 0;
|
| 488 |
+
|
| 489 |
+
/* Validate array size */
|
| 490 |
+
if (ctx->head->field->type->arraysize[0]) {
|
| 491 |
+
int i, ndim = 0;
|
| 492 |
+
|
| 493 |
+
/* handle strings ('s' and 'p') */
|
| 494 |
+
if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
|
| 495 |
+
ctx->is_valid_array = ctx->head->field->type->ndim == 1;
|
| 496 |
+
ndim = 1;
|
| 497 |
+
if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
|
| 498 |
+
PyErr_Format(PyExc_ValueError,
|
| 499 |
+
"Expected a dimension of size %zu, got %zu",
|
| 500 |
+
ctx->head->field->type->arraysize[0], ctx->enc_count);
|
| 501 |
+
return -1;
|
| 502 |
+
}
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
if (!ctx->is_valid_array) {
|
| 506 |
+
PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
|
| 507 |
+
ctx->head->field->type->ndim, ndim);
|
| 508 |
+
return -1;
|
| 509 |
+
}
|
| 510 |
+
for (i = 0; i < ctx->head->field->type->ndim; i++) {
|
| 511 |
+
arraysize *= ctx->head->field->type->arraysize[i];
|
| 512 |
+
}
|
| 513 |
+
ctx->is_valid_array = 0;
|
| 514 |
+
ctx->enc_count = 1;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
|
| 518 |
+
do {
|
| 519 |
+
__Pyx_StructField* field = ctx->head->field;
|
| 520 |
+
__Pyx_TypeInfo* type = field->type;
|
| 521 |
+
|
| 522 |
+
if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
|
| 523 |
+
size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
|
| 524 |
+
} else {
|
| 525 |
+
size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
if (ctx->enc_packmode == '@') {
|
| 529 |
+
size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
|
| 530 |
+
size_t align_mod_offset;
|
| 531 |
+
if (align_at == 0) return -1;
|
| 532 |
+
align_mod_offset = ctx->fmt_offset % align_at;
|
| 533 |
+
if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
|
| 534 |
+
|
| 535 |
+
if (ctx->struct_alignment == 0)
|
| 536 |
+
ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
|
| 537 |
+
ctx->is_complex);
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
if (type->size != size || type->typegroup != group) {
|
| 541 |
+
if (type->typegroup == 'C' && type->fields != NULL) {
|
| 542 |
+
/* special case -- treat as struct rather than complex number */
|
| 543 |
+
size_t parent_offset = ctx->head->parent_offset + field->offset;
|
| 544 |
+
++ctx->head;
|
| 545 |
+
ctx->head->field = type->fields;
|
| 546 |
+
ctx->head->parent_offset = parent_offset;
|
| 547 |
+
continue;
|
| 548 |
+
}
|
| 549 |
+
|
| 550 |
+
if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
|
| 551 |
+
/* special case -- chars don't care about sign */
|
| 552 |
+
} else {
|
| 553 |
+
__Pyx_BufFmt_RaiseExpected(ctx);
|
| 554 |
+
return -1;
|
| 555 |
+
}
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
offset = ctx->head->parent_offset + field->offset;
|
| 559 |
+
if (ctx->fmt_offset != offset) {
|
| 560 |
+
PyErr_Format(PyExc_ValueError,
|
| 561 |
+
"Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
|
| 562 |
+
(Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
|
| 563 |
+
return -1;
|
| 564 |
+
}
|
| 565 |
+
|
| 566 |
+
ctx->fmt_offset += size;
|
| 567 |
+
if (arraysize)
|
| 568 |
+
ctx->fmt_offset += (arraysize - 1) * size;
|
| 569 |
+
|
| 570 |
+
--ctx->enc_count; /* Consume from buffer string */
|
| 571 |
+
|
| 572 |
+
/* Done checking, move to next field, pushing or popping struct stack if needed */
|
| 573 |
+
while (1) {
|
| 574 |
+
if (field == &ctx->root) {
|
| 575 |
+
ctx->head = NULL;
|
| 576 |
+
if (ctx->enc_count != 0) {
|
| 577 |
+
__Pyx_BufFmt_RaiseExpected(ctx);
|
| 578 |
+
return -1;
|
| 579 |
+
}
|
| 580 |
+
break; /* breaks both loops as ctx->enc_count == 0 */
|
| 581 |
+
}
|
| 582 |
+
ctx->head->field = ++field;
|
| 583 |
+
if (field->type == NULL) {
|
| 584 |
+
--ctx->head;
|
| 585 |
+
field = ctx->head->field;
|
| 586 |
+
continue;
|
| 587 |
+
} else if (field->type->typegroup == 'S') {
|
| 588 |
+
size_t parent_offset = ctx->head->parent_offset + field->offset;
|
| 589 |
+
if (field->type->fields->type == NULL) continue; /* empty struct */
|
| 590 |
+
field = field->type->fields;
|
| 591 |
+
++ctx->head;
|
| 592 |
+
ctx->head->field = field;
|
| 593 |
+
ctx->head->parent_offset = parent_offset;
|
| 594 |
+
break;
|
| 595 |
+
} else {
|
| 596 |
+
break;
|
| 597 |
+
}
|
| 598 |
+
}
|
| 599 |
+
} while (ctx->enc_count);
|
| 600 |
+
ctx->enc_type = 0;
|
| 601 |
+
ctx->is_complex = 0;
|
| 602 |
+
return 0;
|
| 603 |
+
}
|
| 604 |
+
|
| 605 |
+
// Parse an array in the format string (e.g. (1,2,3))
|
| 606 |
+
// Return 0 on success, -1 on error
|
| 607 |
+
static int
|
| 608 |
+
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
|
| 609 |
+
{
|
| 610 |
+
const char *ts = *tsp;
|
| 611 |
+
int i = 0, number, ndim;
|
| 612 |
+
|
| 613 |
+
++ts;
|
| 614 |
+
if (ctx->new_count != 1) {
|
| 615 |
+
PyErr_SetString(PyExc_ValueError,
|
| 616 |
+
"Cannot handle repeated arrays in format string");
|
| 617 |
+
return -1;
|
| 618 |
+
}
|
| 619 |
+
|
| 620 |
+
/* Process the previous element */
|
| 621 |
+
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
|
| 622 |
+
|
| 623 |
+
// store ndim now, as field advanced by __Pyx_BufFmt_ProcessTypeChunk call
|
| 624 |
+
ndim = ctx->head->field->type->ndim;
|
| 625 |
+
|
| 626 |
+
/* Parse all numbers in the format string */
|
| 627 |
+
while (*ts && *ts != ')') {
|
| 628 |
+
// ignore space characters (not using isspace() due to C/C++ problem on MacOS-X)
|
| 629 |
+
switch (*ts) {
|
| 630 |
+
case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
|
| 631 |
+
default: break; /* not a 'break' in the loop */
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
number = __Pyx_BufFmt_ExpectNumber(&ts);
|
| 635 |
+
if (number == -1) return -1;
|
| 636 |
+
|
| 637 |
+
if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
|
| 638 |
+
PyErr_Format(PyExc_ValueError,
|
| 639 |
+
"Expected a dimension of size %zu, got %d",
|
| 640 |
+
ctx->head->field->type->arraysize[i], number);
|
| 641 |
+
return -1;
|
| 642 |
+
}
|
| 643 |
+
|
| 644 |
+
if (*ts != ',' && *ts != ')') {
|
| 645 |
+
PyErr_Format(PyExc_ValueError,
|
| 646 |
+
"Expected a comma in format string, got '%c'", *ts);
|
| 647 |
+
return -1;
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
if (*ts == ',') ts++;
|
| 651 |
+
i++;
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
+
if (i != ndim) {
|
| 655 |
+
PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
|
| 656 |
+
ctx->head->field->type->ndim, i);
|
| 657 |
+
return -1;
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
if (!*ts) {
|
| 661 |
+
PyErr_SetString(PyExc_ValueError,
|
| 662 |
+
"Unexpected end of format string, expected ')'");
|
| 663 |
+
return -1;
|
| 664 |
+
}
|
| 665 |
+
|
| 666 |
+
ctx->is_valid_array = 1;
|
| 667 |
+
ctx->new_count = 1;
|
| 668 |
+
*tsp = ++ts;
|
| 669 |
+
return 0;
|
| 670 |
+
}
|
| 671 |
+
|
| 672 |
+
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
|
| 673 |
+
int got_Z = 0;
|
| 674 |
+
|
| 675 |
+
while (1) {
|
| 676 |
+
/* puts(ts); */
|
| 677 |
+
switch(*ts) {
|
| 678 |
+
case 0:
|
| 679 |
+
if (ctx->enc_type != 0 && ctx->head == NULL) {
|
| 680 |
+
__Pyx_BufFmt_RaiseExpected(ctx);
|
| 681 |
+
return NULL;
|
| 682 |
+
}
|
| 683 |
+
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
|
| 684 |
+
if (ctx->head != NULL) {
|
| 685 |
+
__Pyx_BufFmt_RaiseExpected(ctx);
|
| 686 |
+
return NULL;
|
| 687 |
+
}
|
| 688 |
+
return ts;
|
| 689 |
+
case ' ':
|
| 690 |
+
case '\r':
|
| 691 |
+
case '\n':
|
| 692 |
+
++ts;
|
| 693 |
+
break;
|
| 694 |
+
case '<':
|
| 695 |
+
if (!__Pyx_Is_Little_Endian()) {
|
| 696 |
+
PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
|
| 697 |
+
return NULL;
|
| 698 |
+
}
|
| 699 |
+
ctx->new_packmode = '=';
|
| 700 |
+
++ts;
|
| 701 |
+
break;
|
| 702 |
+
case '>':
|
| 703 |
+
case '!':
|
| 704 |
+
if (__Pyx_Is_Little_Endian()) {
|
| 705 |
+
PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
|
| 706 |
+
return NULL;
|
| 707 |
+
}
|
| 708 |
+
ctx->new_packmode = '=';
|
| 709 |
+
++ts;
|
| 710 |
+
break;
|
| 711 |
+
case '=':
|
| 712 |
+
case '@':
|
| 713 |
+
case '^':
|
| 714 |
+
ctx->new_packmode = *ts++;
|
| 715 |
+
break;
|
| 716 |
+
case 'T': /* substruct */
|
| 717 |
+
{
|
| 718 |
+
const char* ts_after_sub;
|
| 719 |
+
size_t i, struct_count = ctx->new_count;
|
| 720 |
+
size_t struct_alignment = ctx->struct_alignment;
|
| 721 |
+
ctx->new_count = 1;
|
| 722 |
+
++ts;
|
| 723 |
+
if (*ts != '{') {
|
| 724 |
+
PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
|
| 725 |
+
return NULL;
|
| 726 |
+
}
|
| 727 |
+
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
|
| 728 |
+
ctx->enc_type = 0; /* Erase processed last struct element */
|
| 729 |
+
ctx->enc_count = 0;
|
| 730 |
+
ctx->struct_alignment = 0;
|
| 731 |
+
++ts;
|
| 732 |
+
ts_after_sub = ts;
|
| 733 |
+
for (i = 0; i != struct_count; ++i) {
|
| 734 |
+
ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
|
| 735 |
+
if (!ts_after_sub) return NULL;
|
| 736 |
+
}
|
| 737 |
+
ts = ts_after_sub;
|
| 738 |
+
if (struct_alignment) ctx->struct_alignment = struct_alignment;
|
| 739 |
+
}
|
| 740 |
+
break;
|
| 741 |
+
case '}': /* end of substruct; either repeat or move on */
|
| 742 |
+
{
|
| 743 |
+
size_t alignment = ctx->struct_alignment;
|
| 744 |
+
++ts;
|
| 745 |
+
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
|
| 746 |
+
ctx->enc_type = 0; /* Erase processed last struct element */
|
| 747 |
+
if (alignment && ctx->fmt_offset % alignment) {
|
| 748 |
+
/* Pad struct on size of the first member */
|
| 749 |
+
ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
|
| 750 |
+
}
|
| 751 |
+
}
|
| 752 |
+
return ts;
|
| 753 |
+
case 'x':
|
| 754 |
+
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
|
| 755 |
+
ctx->fmt_offset += ctx->new_count;
|
| 756 |
+
ctx->new_count = 1;
|
| 757 |
+
ctx->enc_count = 0;
|
| 758 |
+
ctx->enc_type = 0;
|
| 759 |
+
ctx->enc_packmode = ctx->new_packmode;
|
| 760 |
+
++ts;
|
| 761 |
+
break;
|
| 762 |
+
case 'Z':
|
| 763 |
+
got_Z = 1;
|
| 764 |
+
++ts;
|
| 765 |
+
if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
|
| 766 |
+
__Pyx_BufFmt_RaiseUnexpectedChar('Z');
|
| 767 |
+
return NULL;
|
| 768 |
+
}
|
| 769 |
+
CYTHON_FALLTHROUGH;
|
| 770 |
+
case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
|
| 771 |
+
case 'l': case 'L': case 'q': case 'Q':
|
| 772 |
+
case 'f': case 'd': case 'g':
|
| 773 |
+
case 'O': case 'p':
|
| 774 |
+
if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
|
| 775 |
+
(ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
|
| 776 |
+
/* Continue pooling same type */
|
| 777 |
+
ctx->enc_count += ctx->new_count;
|
| 778 |
+
ctx->new_count = 1;
|
| 779 |
+
got_Z = 0;
|
| 780 |
+
++ts;
|
| 781 |
+
break;
|
| 782 |
+
}
|
| 783 |
+
CYTHON_FALLTHROUGH;
|
| 784 |
+
case 's':
|
| 785 |
+
/* 's' or new type (cannot be added to current pool) */
|
| 786 |
+
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
|
| 787 |
+
ctx->enc_count = ctx->new_count;
|
| 788 |
+
ctx->enc_packmode = ctx->new_packmode;
|
| 789 |
+
ctx->enc_type = *ts;
|
| 790 |
+
ctx->is_complex = got_Z;
|
| 791 |
+
++ts;
|
| 792 |
+
ctx->new_count = 1;
|
| 793 |
+
got_Z = 0;
|
| 794 |
+
break;
|
| 795 |
+
case ':':
|
| 796 |
+
++ts;
|
| 797 |
+
while(*ts != ':') ++ts;
|
| 798 |
+
++ts;
|
| 799 |
+
break;
|
| 800 |
+
case '(':
|
| 801 |
+
if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
|
| 802 |
+
break;
|
| 803 |
+
default:
|
| 804 |
+
{
|
| 805 |
+
int number = __Pyx_BufFmt_ExpectNumber(&ts);
|
| 806 |
+
if (number == -1) return NULL;
|
| 807 |
+
ctx->new_count = (size_t)number;
|
| 808 |
+
}
|
| 809 |
+
}
|
| 810 |
+
}
|
| 811 |
+
}
|
| 812 |
+
|
| 813 |
+
/////////////// TypeInfoCompare.proto ///////////////
|
| 814 |
+
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
|
| 815 |
+
|
| 816 |
+
/////////////// TypeInfoCompare ///////////////
|
| 817 |
+
//@requires: BufferFormatStructs
|
| 818 |
+
|
| 819 |
+
// See if two dtypes are equal
|
| 820 |
+
static int
|
| 821 |
+
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
|
| 822 |
+
{
|
| 823 |
+
int i;
|
| 824 |
+
|
| 825 |
+
if (!a || !b)
|
| 826 |
+
return 0;
|
| 827 |
+
|
| 828 |
+
if (a == b)
|
| 829 |
+
return 1;
|
| 830 |
+
|
| 831 |
+
if (a->size != b->size || a->typegroup != b->typegroup ||
|
| 832 |
+
a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
|
| 833 |
+
if (a->typegroup == 'H' || b->typegroup == 'H') {
|
| 834 |
+
/* Special case for chars */
|
| 835 |
+
return a->size == b->size;
|
| 836 |
+
} else {
|
| 837 |
+
return 0;
|
| 838 |
+
}
|
| 839 |
+
}
|
| 840 |
+
|
| 841 |
+
if (a->ndim) {
|
| 842 |
+
/* Verify multidimensional C arrays */
|
| 843 |
+
for (i = 0; i < a->ndim; i++)
|
| 844 |
+
if (a->arraysize[i] != b->arraysize[i])
|
| 845 |
+
return 0;
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
if (a->typegroup == 'S') {
|
| 849 |
+
/* Check for packed struct */
|
| 850 |
+
if (a->flags != b->flags)
|
| 851 |
+
return 0;
|
| 852 |
+
|
| 853 |
+
/* compare all struct fields */
|
| 854 |
+
if (a->fields || b->fields) {
|
| 855 |
+
/* Check if both have fields */
|
| 856 |
+
if (!(a->fields && b->fields))
|
| 857 |
+
return 0;
|
| 858 |
+
|
| 859 |
+
/* compare */
|
| 860 |
+
for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
|
| 861 |
+
__Pyx_StructField *field_a = a->fields + i;
|
| 862 |
+
__Pyx_StructField *field_b = b->fields + i;
|
| 863 |
+
|
| 864 |
+
if (field_a->offset != field_b->offset ||
|
| 865 |
+
!__pyx_typeinfo_cmp(field_a->type, field_b->type))
|
| 866 |
+
return 0;
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
/* If all fields are processed, we have a match */
|
| 870 |
+
return !a->fields[i].type && !b->fields[i].type;
|
| 871 |
+
}
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
return 1;
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
+
|
| 878 |
+
/////////////// TypeInfoToFormat.proto ///////////////
|
| 879 |
+
struct __pyx_typeinfo_string {
|
| 880 |
+
char string[3];
|
| 881 |
+
};
|
| 882 |
+
static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
|
| 883 |
+
|
| 884 |
+
/////////////// TypeInfoToFormat ///////////////
|
| 885 |
+
//@requires: BufferFormatStructs
|
| 886 |
+
|
| 887 |
+
// See also MemoryView.pyx:BufferFormatFromTypeInfo
|
| 888 |
+
|
| 889 |
+
static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
|
| 890 |
+
struct __pyx_typeinfo_string result = { {0} };
|
| 891 |
+
char *buf = (char *) result.string;
|
| 892 |
+
size_t size = type->size;
|
| 893 |
+
|
| 894 |
+
switch (type->typegroup) {
|
| 895 |
+
case 'H':
|
| 896 |
+
*buf = 'c';
|
| 897 |
+
break;
|
| 898 |
+
case 'I':
|
| 899 |
+
case 'U':
|
| 900 |
+
if (size == 1)
|
| 901 |
+
*buf = (type->is_unsigned) ? 'B' : 'b';
|
| 902 |
+
else if (size == 2)
|
| 903 |
+
*buf = (type->is_unsigned) ? 'H' : 'h';
|
| 904 |
+
else if (size == 4)
|
| 905 |
+
*buf = (type->is_unsigned) ? 'I' : 'i';
|
| 906 |
+
else if (size == 8)
|
| 907 |
+
*buf = (type->is_unsigned) ? 'Q' : 'q';
|
| 908 |
+
break;
|
| 909 |
+
case 'P':
|
| 910 |
+
*buf = 'P';
|
| 911 |
+
break;
|
| 912 |
+
case 'C':
|
| 913 |
+
{
|
| 914 |
+
__Pyx_TypeInfo complex_type = *type;
|
| 915 |
+
complex_type.typegroup = 'R';
|
| 916 |
+
complex_type.size /= 2;
|
| 917 |
+
|
| 918 |
+
*buf++ = 'Z';
|
| 919 |
+
*buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
|
| 920 |
+
break;
|
| 921 |
+
}
|
| 922 |
+
case 'R':
|
| 923 |
+
if (size == 4)
|
| 924 |
+
*buf = 'f';
|
| 925 |
+
else if (size == 8)
|
| 926 |
+
*buf = 'd';
|
| 927 |
+
else
|
| 928 |
+
*buf = 'g';
|
| 929 |
+
break;
|
| 930 |
+
}
|
| 931 |
+
|
| 932 |
+
return result;
|
| 933 |
+
}
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/CppSupport.cpp
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/////////////// CppExceptionConversion.proto ///////////////
|
| 2 |
+
|
| 3 |
+
#ifndef __Pyx_CppExn2PyErr
|
| 4 |
+
#include <new>
|
| 5 |
+
#include <typeinfo>
|
| 6 |
+
#include <stdexcept>
|
| 7 |
+
#include <ios>
|
| 8 |
+
|
| 9 |
+
static void __Pyx_CppExn2PyErr() {
|
| 10 |
+
// Catch a handful of different errors here and turn them into the
|
| 11 |
+
// equivalent Python errors.
|
| 12 |
+
try {
|
| 13 |
+
if (PyErr_Occurred())
|
| 14 |
+
; // let the latest Python exn pass through and ignore the current one
|
| 15 |
+
else
|
| 16 |
+
throw;
|
| 17 |
+
} catch (const std::bad_alloc& exn) {
|
| 18 |
+
PyErr_SetString(PyExc_MemoryError, exn.what());
|
| 19 |
+
} catch (const std::bad_cast& exn) {
|
| 20 |
+
PyErr_SetString(PyExc_TypeError, exn.what());
|
| 21 |
+
} catch (const std::bad_typeid& exn) {
|
| 22 |
+
PyErr_SetString(PyExc_TypeError, exn.what());
|
| 23 |
+
} catch (const std::domain_error& exn) {
|
| 24 |
+
PyErr_SetString(PyExc_ValueError, exn.what());
|
| 25 |
+
} catch (const std::invalid_argument& exn) {
|
| 26 |
+
PyErr_SetString(PyExc_ValueError, exn.what());
|
| 27 |
+
} catch (const std::ios_base::failure& exn) {
|
| 28 |
+
// Unfortunately, in standard C++ we have no way of distinguishing EOF
|
| 29 |
+
// from other errors here; be careful with the exception mask
|
| 30 |
+
PyErr_SetString(PyExc_IOError, exn.what());
|
| 31 |
+
} catch (const std::out_of_range& exn) {
|
| 32 |
+
// Change out_of_range to IndexError
|
| 33 |
+
PyErr_SetString(PyExc_IndexError, exn.what());
|
| 34 |
+
} catch (const std::overflow_error& exn) {
|
| 35 |
+
PyErr_SetString(PyExc_OverflowError, exn.what());
|
| 36 |
+
} catch (const std::range_error& exn) {
|
| 37 |
+
PyErr_SetString(PyExc_ArithmeticError, exn.what());
|
| 38 |
+
} catch (const std::underflow_error& exn) {
|
| 39 |
+
PyErr_SetString(PyExc_ArithmeticError, exn.what());
|
| 40 |
+
} catch (const std::exception& exn) {
|
| 41 |
+
PyErr_SetString(PyExc_RuntimeError, exn.what());
|
| 42 |
+
}
|
| 43 |
+
catch (...)
|
| 44 |
+
{
|
| 45 |
+
PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
#endif
|
| 49 |
+
|
| 50 |
+
/////////////// PythranConversion.proto ///////////////
|
| 51 |
+
|
| 52 |
+
template <class T>
|
| 53 |
+
auto __Pyx_pythran_to_python(T &&value) -> decltype(to_python(
|
| 54 |
+
typename pythonic::returnable<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::type{std::forward<T>(value)}))
|
| 55 |
+
{
|
| 56 |
+
using returnable_type = typename pythonic::returnable<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::type;
|
| 57 |
+
return to_python(returnable_type{std::forward<T>(value)});
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
#define __Pyx_PythranShapeAccessor(x) (pythonic::builtins::getattr(pythonic::types::attr::SHAPE{}, x))
|
| 61 |
+
|
| 62 |
+
////////////// MoveIfSupported.proto //////////////////
|
| 63 |
+
|
| 64 |
+
#if CYTHON_USE_CPP_STD_MOVE
|
| 65 |
+
#include <utility>
|
| 66 |
+
#define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
|
| 67 |
+
#else
|
| 68 |
+
#define __PYX_STD_MOVE_IF_SUPPORTED(x) x
|
| 69 |
+
#endif
|
| 70 |
+
|
| 71 |
+
////////////// EnumClassDecl.proto //////////////////
|
| 72 |
+
//@proto_block: utility_code_proto_before_types
|
| 73 |
+
|
| 74 |
+
#if defined (_MSC_VER)
|
| 75 |
+
#if _MSC_VER >= 1910
|
| 76 |
+
#define __PYX_ENUM_CLASS_DECL enum
|
| 77 |
+
#else
|
| 78 |
+
#define __PYX_ENUM_CLASS_DECL
|
| 79 |
+
#endif
|
| 80 |
+
#else
|
| 81 |
+
#define __PYX_ENUM_CLASS_DECL enum
|
| 82 |
+
#endif
|
| 83 |
+
|
| 84 |
+
////////////// OptionalLocals.proto ////////////////
|
| 85 |
+
//@proto_block: utility_code_proto_before_types
|
| 86 |
+
|
| 87 |
+
#include <utility>
|
| 88 |
+
#if defined(CYTHON_USE_BOOST_OPTIONAL)
|
| 89 |
+
// fallback mode - std::optional is preferred but this gives
|
| 90 |
+
// people with a less up-to-date compiler a chance
|
| 91 |
+
#include <boost/optional.hpp>
|
| 92 |
+
#define __Pyx_Optional_BaseType boost::optional
|
| 93 |
+
#else
|
| 94 |
+
#include <optional>
|
| 95 |
+
// since std::optional is a C++17 features, a templated using declaration should be safe
|
| 96 |
+
// (although it could be replaced with a define)
|
| 97 |
+
template <typename T>
|
| 98 |
+
using __Pyx_Optional_BaseType = std::optional<T>;
|
| 99 |
+
#endif
|
| 100 |
+
|
| 101 |
+
// This class reuses as much of the implementation of std::optional as possible.
|
| 102 |
+
// The only place it differs significantly is the assignment operators, which use
|
| 103 |
+
// "emplace" (thus requiring move/copy constructors, but not move/copy
|
| 104 |
+
// assignment operators). This is preferred because it lets us work with assignable
|
| 105 |
+
// types (for example those with const members)
|
| 106 |
+
template <typename T>
|
| 107 |
+
class __Pyx_Optional_Type : private __Pyx_Optional_BaseType<T> {
|
| 108 |
+
public:
|
| 109 |
+
using __Pyx_Optional_BaseType<T>::__Pyx_Optional_BaseType;
|
| 110 |
+
using __Pyx_Optional_BaseType<T>::has_value;
|
| 111 |
+
using __Pyx_Optional_BaseType<T>::operator*;
|
| 112 |
+
using __Pyx_Optional_BaseType<T>::operator->;
|
| 113 |
+
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
|
| 114 |
+
__Pyx_Optional_Type& operator=(const __Pyx_Optional_Type& rhs) {
|
| 115 |
+
this->emplace(*rhs);
|
| 116 |
+
return *this;
|
| 117 |
+
}
|
| 118 |
+
__Pyx_Optional_Type& operator=(__Pyx_Optional_Type&& rhs) {
|
| 119 |
+
this->emplace(std::move(*rhs));
|
| 120 |
+
return *this;
|
| 121 |
+
}
|
| 122 |
+
template <typename U=T>
|
| 123 |
+
__Pyx_Optional_Type& operator=(U&& rhs) {
|
| 124 |
+
this->emplace(std::forward<U>(rhs));
|
| 125 |
+
return *this;
|
| 126 |
+
}
|
| 127 |
+
#else
|
| 128 |
+
// Note - the "cpp_locals" feature is designed to require C++14.
|
| 129 |
+
// This pre-c++11 fallback is largely untested, and definitely won't work
|
| 130 |
+
// in all the cases that the more modern version does
|
| 131 |
+
using __Pyx_Optional_BaseType<T>::operator=; // the chances are emplace can't work...
|
| 132 |
+
#endif
|
| 133 |
+
};
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Dataclasses.py
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
################### Dataclasses_fallback ###############################
|
| 2 |
+
|
| 3 |
+
# This is the fallback dataclass code if the stdlib module isn't available.
|
| 4 |
+
# It defines enough of the support types to be used with cdef classes
|
| 5 |
+
# and to fail if used on regular types.
|
| 6 |
+
|
| 7 |
+
# (Intended to be included as py code - not compiled)
|
| 8 |
+
|
| 9 |
+
from collections import namedtuple
|
| 10 |
+
try:
|
| 11 |
+
from types import MappingProxyType
|
| 12 |
+
except ImportError:
|
| 13 |
+
# mutable fallback if unavailable
|
| 14 |
+
MappingProxyType = lambda x: x
|
| 15 |
+
|
| 16 |
+
class _MISSING_TYPE(object):
|
| 17 |
+
pass
|
| 18 |
+
MISSING = _MISSING_TYPE()
|
| 19 |
+
|
| 20 |
+
_DataclassParams = namedtuple('_DataclassParams',
|
| 21 |
+
["init", "repr", "eq", "order", "unsafe_hash", "frozen",
|
| 22 |
+
"match_args", "kw_only", "slots", "weakref_slot"])
|
| 23 |
+
class Field(object):
|
| 24 |
+
__slots__ = ('name',
|
| 25 |
+
'type',
|
| 26 |
+
'default',
|
| 27 |
+
'default_factory',
|
| 28 |
+
'repr',
|
| 29 |
+
'hash',
|
| 30 |
+
'init',
|
| 31 |
+
'compare',
|
| 32 |
+
'metadata',
|
| 33 |
+
'kw_only',
|
| 34 |
+
'_field_type', # Private: not to be used by user code.
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
def __init__(self, default, default_factory, init, repr, hash, compare,
|
| 38 |
+
metadata, kw_only):
|
| 39 |
+
self.name = None
|
| 40 |
+
self.type = None
|
| 41 |
+
self.default = default
|
| 42 |
+
self.default_factory = default_factory
|
| 43 |
+
self.init = init
|
| 44 |
+
self.repr = repr
|
| 45 |
+
self.hash = hash
|
| 46 |
+
self.compare = compare
|
| 47 |
+
# Be aware that if MappingProxyType is unavailable (i.e. py2?) then we
|
| 48 |
+
# don't enforce non-mutability that the real module does
|
| 49 |
+
self.metadata = (MappingProxyType({})
|
| 50 |
+
if metadata is None else
|
| 51 |
+
MappingProxyType(metadata))
|
| 52 |
+
self.kw_only = kw_only
|
| 53 |
+
self._field_type = None
|
| 54 |
+
|
| 55 |
+
def __repr__(self):
|
| 56 |
+
return ('Field('
|
| 57 |
+
'name={0!r},'
|
| 58 |
+
'type={1!r},'
|
| 59 |
+
'default={2!r},'
|
| 60 |
+
'default_factory={3!r},'
|
| 61 |
+
'init={4!r},'
|
| 62 |
+
'repr={5!r},'
|
| 63 |
+
'hash={6!r},'
|
| 64 |
+
'compare={7!r},'
|
| 65 |
+
'metadata={8!r},'
|
| 66 |
+
'kwonly={9!r},'
|
| 67 |
+
')'.format(self.name, self.type, self.default,
|
| 68 |
+
self.default_factory, self.init,
|
| 69 |
+
self.repr, self.hash, self.compare,
|
| 70 |
+
self.metadata, self.kw_only))
|
| 71 |
+
|
| 72 |
+
# A sentinel object for default values to signal that a default
|
| 73 |
+
# factory will be used. This is given a nice repr() which will appear
|
| 74 |
+
# in the function signature of dataclasses' constructors.
|
| 75 |
+
class _HAS_DEFAULT_FACTORY_CLASS:
|
| 76 |
+
def __repr__(self):
|
| 77 |
+
return '<factory>'
|
| 78 |
+
_HAS_DEFAULT_FACTORY = _HAS_DEFAULT_FACTORY_CLASS()
|
| 79 |
+
|
| 80 |
+
def dataclass(*args, **kwds):
|
| 81 |
+
raise NotImplementedError("Standard library 'dataclasses' module"
|
| 82 |
+
"is unavailable, likely due to the version of Python you're using.")
|
| 83 |
+
|
| 84 |
+
# Markers for the various kinds of fields and pseudo-fields.
|
| 85 |
+
class _FIELD_BASE:
|
| 86 |
+
def __init__(self, name):
|
| 87 |
+
self.name = name
|
| 88 |
+
def __repr__(self):
|
| 89 |
+
return self.name
|
| 90 |
+
_FIELD = _FIELD_BASE('_FIELD')
|
| 91 |
+
_FIELD_CLASSVAR = _FIELD_BASE('_FIELD_CLASSVAR')
|
| 92 |
+
_FIELD_INITVAR = _FIELD_BASE('_FIELD_INITVAR')
|
| 93 |
+
|
| 94 |
+
def field(*ignore, **kwds):
|
| 95 |
+
default = kwds.pop("default", MISSING)
|
| 96 |
+
default_factory = kwds.pop("default_factory", MISSING)
|
| 97 |
+
init = kwds.pop("init", True)
|
| 98 |
+
repr = kwds.pop("repr", True)
|
| 99 |
+
hash = kwds.pop("hash", None)
|
| 100 |
+
compare = kwds.pop("compare", True)
|
| 101 |
+
metadata = kwds.pop("metadata", None)
|
| 102 |
+
kw_only = kwds.pop("kw_only", None)
|
| 103 |
+
|
| 104 |
+
if kwds:
|
| 105 |
+
raise ValueError("field received unexpected keyword arguments: %s"
|
| 106 |
+
% list(kwds.keys()))
|
| 107 |
+
if default is not MISSING and default_factory is not MISSING:
|
| 108 |
+
raise ValueError('cannot specify both default and default_factory')
|
| 109 |
+
if ignore:
|
| 110 |
+
raise ValueError("'field' does not take any positional arguments")
|
| 111 |
+
return Field(default, default_factory, init,
|
| 112 |
+
repr, hash, compare, metadata, kw_only)
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Exceptions.c
ADDED
|
@@ -0,0 +1,1137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
| 1 |
+
// Exception raising code
|
| 2 |
+
//
|
| 3 |
+
// Exceptions are raised by __Pyx_Raise() and stored as plain
|
| 4 |
+
// type/value/tb in PyThreadState->curexc_*. When being caught by an
|
| 5 |
+
// 'except' statement, curexc_* is moved over to exc_* by
|
| 6 |
+
// __Pyx_GetException()
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
/////////////// AssertionsEnabled.init ///////////////
|
| 10 |
+
|
| 11 |
+
if (likely(__Pyx_init_assertions_enabled() == 0)); else
|
| 12 |
+
// error propagation code is appended automatically
|
| 13 |
+
|
| 14 |
+
/////////////// AssertionsEnabled.proto ///////////////
|
| 15 |
+
|
| 16 |
+
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
|
| 17 |
+
#define __Pyx_init_assertions_enabled() (0)
|
| 18 |
+
#define __pyx_assertions_enabled() (1)
|
| 19 |
+
#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
|
| 20 |
+
// Py_OptimizeFlag is deprecated in Py3.12+ and not available in the Limited API.
|
| 21 |
+
static int __pyx_assertions_enabled_flag;
|
| 22 |
+
#define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
|
| 23 |
+
|
| 24 |
+
static int __Pyx_init_assertions_enabled(void) {
|
| 25 |
+
PyObject *builtins, *debug, *debug_str;
|
| 26 |
+
int flag;
|
| 27 |
+
builtins = PyEval_GetBuiltins();
|
| 28 |
+
if (!builtins) goto bad;
|
| 29 |
+
debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
|
| 30 |
+
if (!debug_str) goto bad;
|
| 31 |
+
debug = PyObject_GetItem(builtins, debug_str);
|
| 32 |
+
Py_DECREF(debug_str);
|
| 33 |
+
if (!debug) goto bad;
|
| 34 |
+
flag = PyObject_IsTrue(debug);
|
| 35 |
+
Py_DECREF(debug);
|
| 36 |
+
if (flag == -1) goto bad;
|
| 37 |
+
__pyx_assertions_enabled_flag = flag;
|
| 38 |
+
return 0;
|
| 39 |
+
bad:
|
| 40 |
+
__pyx_assertions_enabled_flag = 1;
|
| 41 |
+
// We (rarely) may not have an exception set, but the calling code will call PyErr_Occurred() either way.
|
| 42 |
+
return -1;
|
| 43 |
+
}
|
| 44 |
+
#else
|
| 45 |
+
#define __Pyx_init_assertions_enabled() (0)
|
| 46 |
+
#define __pyx_assertions_enabled() (!Py_OptimizeFlag)
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
/////////////// ErrOccurredWithGIL.proto ///////////////
|
| 51 |
+
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* proto */
|
| 52 |
+
|
| 53 |
+
/////////////// ErrOccurredWithGIL ///////////////
|
| 54 |
+
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
|
| 55 |
+
int err;
|
| 56 |
+
#ifdef WITH_THREAD
|
| 57 |
+
PyGILState_STATE _save = PyGILState_Ensure();
|
| 58 |
+
#endif
|
| 59 |
+
err = !!PyErr_Occurred();
|
| 60 |
+
#ifdef WITH_THREAD
|
| 61 |
+
PyGILState_Release(_save);
|
| 62 |
+
#endif
|
| 63 |
+
return err;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
/////////////// PyThreadStateGet.proto ///////////////
|
| 68 |
+
//@substitute: naming
|
| 69 |
+
|
| 70 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 71 |
+
#define __Pyx_PyThreadState_declare PyThreadState *$local_tstate_cname;
|
| 72 |
+
#define __Pyx_PyThreadState_assign $local_tstate_cname = __Pyx_PyThreadState_Current;
|
| 73 |
+
#if PY_VERSION_HEX >= 0x030C00A6
|
| 74 |
+
#define __Pyx_PyErr_Occurred() ($local_tstate_cname->current_exception != NULL)
|
| 75 |
+
#define __Pyx_PyErr_CurrentExceptionType() ($local_tstate_cname->current_exception ? (PyObject*) Py_TYPE($local_tstate_cname->current_exception) : (PyObject*) NULL)
|
| 76 |
+
#else
|
| 77 |
+
#define __Pyx_PyErr_Occurred() ($local_tstate_cname->curexc_type != NULL)
|
| 78 |
+
#define __Pyx_PyErr_CurrentExceptionType() ($local_tstate_cname->curexc_type)
|
| 79 |
+
#endif
|
| 80 |
+
#else
|
| 81 |
+
// !CYTHON_FAST_THREAD_STATE
|
| 82 |
+
#define __Pyx_PyThreadState_declare
|
| 83 |
+
#define __Pyx_PyThreadState_assign
|
| 84 |
+
#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
|
| 85 |
+
#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
|
| 86 |
+
#endif
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
/////////////// PyErrExceptionMatches.proto ///////////////
|
| 90 |
+
//@substitute: naming
|
| 91 |
+
|
| 92 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 93 |
+
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState($local_tstate_cname, err)
|
| 94 |
+
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
|
| 95 |
+
#else
|
| 96 |
+
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
/////////////// PyErrExceptionMatches ///////////////
|
| 100 |
+
|
| 101 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 102 |
+
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
|
| 103 |
+
Py_ssize_t i, n;
|
| 104 |
+
n = PyTuple_GET_SIZE(tuple);
|
| 105 |
+
#if PY_MAJOR_VERSION >= 3
|
| 106 |
+
// the tighter subtype checking in Py3 allows faster out-of-order comparison
|
| 107 |
+
for (i=0; i<n; i++) {
|
| 108 |
+
if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
|
| 109 |
+
}
|
| 110 |
+
#endif
|
| 111 |
+
for (i=0; i<n; i++) {
|
| 112 |
+
if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
|
| 113 |
+
}
|
| 114 |
+
return 0;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
|
| 118 |
+
int result;
|
| 119 |
+
PyObject *exc_type;
|
| 120 |
+
#if PY_VERSION_HEX >= 0x030C00A6
|
| 121 |
+
PyObject *current_exception = tstate->current_exception;
|
| 122 |
+
if (unlikely(!current_exception)) return 0;
|
| 123 |
+
exc_type = (PyObject*) Py_TYPE(current_exception);
|
| 124 |
+
if (exc_type == err) return 1;
|
| 125 |
+
#else
|
| 126 |
+
exc_type = tstate->curexc_type;
|
| 127 |
+
if (exc_type == err) return 1;
|
| 128 |
+
if (unlikely(!exc_type)) return 0;
|
| 129 |
+
#endif
|
| 130 |
+
#if CYTHON_AVOID_BORROWED_REFS
|
| 131 |
+
Py_INCREF(exc_type);
|
| 132 |
+
#endif
|
| 133 |
+
if (unlikely(PyTuple_Check(err))) {
|
| 134 |
+
result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
|
| 135 |
+
} else {
|
| 136 |
+
result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
|
| 137 |
+
}
|
| 138 |
+
#if CYTHON_AVOID_BORROWED_REFS
|
| 139 |
+
Py_DECREF(exc_type);
|
| 140 |
+
#endif
|
| 141 |
+
return result;
|
| 142 |
+
}
|
| 143 |
+
#endif
|
| 144 |
+
|
| 145 |
+
/////////////// PyErrFetchRestore.proto ///////////////
|
| 146 |
+
//@substitute: naming
|
| 147 |
+
//@requires: PyThreadStateGet
|
| 148 |
+
|
| 149 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 150 |
+
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
|
| 151 |
+
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
|
| 152 |
+
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
|
| 153 |
+
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState($local_tstate_cname, type, value, tb)
|
| 154 |
+
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState($local_tstate_cname, type, value, tb)
|
| 155 |
+
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); /*proto*/
|
| 156 |
+
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
| 157 |
+
|
| 158 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
|
| 159 |
+
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
|
| 160 |
+
#else
|
| 161 |
+
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
| 162 |
+
#endif
|
| 163 |
+
|
| 164 |
+
#else
|
| 165 |
+
#define __Pyx_PyErr_Clear() PyErr_Clear()
|
| 166 |
+
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
| 167 |
+
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
|
| 168 |
+
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
|
| 169 |
+
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
|
| 170 |
+
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
|
| 171 |
+
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
|
| 172 |
+
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
|
| 173 |
+
#endif
|
| 174 |
+
|
| 175 |
+
/////////////// PyErrFetchRestore ///////////////
|
| 176 |
+
|
| 177 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 178 |
+
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
|
| 179 |
+
#if PY_VERSION_HEX >= 0x030C00A6
|
| 180 |
+
PyObject *tmp_value;
|
| 181 |
+
assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
|
| 182 |
+
if (value) {
|
| 183 |
+
#if CYTHON_COMPILING_IN_CPYTHON
|
| 184 |
+
if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
|
| 185 |
+
#endif
|
| 186 |
+
// If this fails, we may lose the traceback but still set the expected exception below.
|
| 187 |
+
PyException_SetTraceback(value, tb);
|
| 188 |
+
}
|
| 189 |
+
tmp_value = tstate->current_exception;
|
| 190 |
+
tstate->current_exception = value;
|
| 191 |
+
Py_XDECREF(tmp_value);
|
| 192 |
+
Py_XDECREF(type);
|
| 193 |
+
Py_XDECREF(tb);
|
| 194 |
+
#else
|
| 195 |
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
| 196 |
+
tmp_type = tstate->curexc_type;
|
| 197 |
+
tmp_value = tstate->curexc_value;
|
| 198 |
+
tmp_tb = tstate->curexc_traceback;
|
| 199 |
+
tstate->curexc_type = type;
|
| 200 |
+
tstate->curexc_value = value;
|
| 201 |
+
tstate->curexc_traceback = tb;
|
| 202 |
+
Py_XDECREF(tmp_type);
|
| 203 |
+
Py_XDECREF(tmp_value);
|
| 204 |
+
Py_XDECREF(tmp_tb);
|
| 205 |
+
#endif
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
| 209 |
+
#if PY_VERSION_HEX >= 0x030C00A6
|
| 210 |
+
PyObject* exc_value;
|
| 211 |
+
exc_value = tstate->current_exception;
|
| 212 |
+
tstate->current_exception = 0;
|
| 213 |
+
*value = exc_value;
|
| 214 |
+
*type = NULL;
|
| 215 |
+
*tb = NULL;
|
| 216 |
+
if (exc_value) {
|
| 217 |
+
*type = (PyObject*) Py_TYPE(exc_value);
|
| 218 |
+
Py_INCREF(*type);
|
| 219 |
+
#if CYTHON_COMPILING_IN_CPYTHON
|
| 220 |
+
*tb = ((PyBaseExceptionObject*) exc_value)->traceback;
|
| 221 |
+
Py_XINCREF(*tb);
|
| 222 |
+
#else
|
| 223 |
+
*tb = PyException_GetTraceback(exc_value);
|
| 224 |
+
#endif
|
| 225 |
+
}
|
| 226 |
+
#else
|
| 227 |
+
*type = tstate->curexc_type;
|
| 228 |
+
*value = tstate->curexc_value;
|
| 229 |
+
*tb = tstate->curexc_traceback;
|
| 230 |
+
tstate->curexc_type = 0;
|
| 231 |
+
tstate->curexc_value = 0;
|
| 232 |
+
tstate->curexc_traceback = 0;
|
| 233 |
+
#endif
|
| 234 |
+
}
|
| 235 |
+
#endif
|
| 236 |
+
|
| 237 |
+
/////////////// RaiseException.proto ///////////////
|
| 238 |
+
|
| 239 |
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
|
| 240 |
+
|
| 241 |
+
/////////////// RaiseException ///////////////
|
| 242 |
+
//@requires: PyErrFetchRestore
|
| 243 |
+
//@requires: PyThreadStateGet
|
| 244 |
+
|
| 245 |
+
// The following function is based on do_raise() from ceval.c. There
|
| 246 |
+
// are separate versions for Python2 and Python3 as exception handling
|
| 247 |
+
// has changed quite a lot between the two versions.
|
| 248 |
+
|
| 249 |
+
#if PY_MAJOR_VERSION < 3
|
| 250 |
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
| 251 |
+
__Pyx_PyThreadState_declare
|
| 252 |
+
CYTHON_UNUSED_VAR(cause);
|
| 253 |
+
/* 'cause' is only used in Py3 */
|
| 254 |
+
Py_XINCREF(type);
|
| 255 |
+
if (!value || value == Py_None)
|
| 256 |
+
value = NULL;
|
| 257 |
+
else
|
| 258 |
+
Py_INCREF(value);
|
| 259 |
+
|
| 260 |
+
if (!tb || tb == Py_None)
|
| 261 |
+
tb = NULL;
|
| 262 |
+
else {
|
| 263 |
+
Py_INCREF(tb);
|
| 264 |
+
if (!PyTraceBack_Check(tb)) {
|
| 265 |
+
PyErr_SetString(PyExc_TypeError,
|
| 266 |
+
"raise: arg 3 must be a traceback or None");
|
| 267 |
+
goto raise_error;
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
if (PyType_Check(type)) {
|
| 272 |
+
/* instantiate the type now (we don't know when and how it will be caught) */
|
| 273 |
+
#if CYTHON_COMPILING_IN_PYPY
|
| 274 |
+
/* PyPy can't handle value == NULL */
|
| 275 |
+
if (!value) {
|
| 276 |
+
Py_INCREF(Py_None);
|
| 277 |
+
value = Py_None;
|
| 278 |
+
}
|
| 279 |
+
#endif
|
| 280 |
+
PyErr_NormalizeException(&type, &value, &tb);
|
| 281 |
+
|
| 282 |
+
} else {
|
| 283 |
+
/* Raising an instance. The value should be a dummy. */
|
| 284 |
+
if (value) {
|
| 285 |
+
PyErr_SetString(PyExc_TypeError,
|
| 286 |
+
"instance exception may not have a separate value");
|
| 287 |
+
goto raise_error;
|
| 288 |
+
}
|
| 289 |
+
/* Normalize to raise <class>, <instance> */
|
| 290 |
+
value = type;
|
| 291 |
+
type = (PyObject*) Py_TYPE(type);
|
| 292 |
+
Py_INCREF(type);
|
| 293 |
+
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
|
| 294 |
+
PyErr_SetString(PyExc_TypeError,
|
| 295 |
+
"raise: exception class must be a subclass of BaseException");
|
| 296 |
+
goto raise_error;
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
__Pyx_PyThreadState_assign
|
| 301 |
+
__Pyx_ErrRestore(type, value, tb);
|
| 302 |
+
return;
|
| 303 |
+
raise_error:
|
| 304 |
+
Py_XDECREF(value);
|
| 305 |
+
Py_XDECREF(type);
|
| 306 |
+
Py_XDECREF(tb);
|
| 307 |
+
return;
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
#else /* Python 3+ */
|
| 311 |
+
|
| 312 |
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
| 313 |
+
PyObject* owned_instance = NULL;
|
| 314 |
+
if (tb == Py_None) {
|
| 315 |
+
tb = 0;
|
| 316 |
+
} else if (tb && !PyTraceBack_Check(tb)) {
|
| 317 |
+
PyErr_SetString(PyExc_TypeError,
|
| 318 |
+
"raise: arg 3 must be a traceback or None");
|
| 319 |
+
goto bad;
|
| 320 |
+
}
|
| 321 |
+
if (value == Py_None)
|
| 322 |
+
value = 0;
|
| 323 |
+
|
| 324 |
+
if (PyExceptionInstance_Check(type)) {
|
| 325 |
+
if (value) {
|
| 326 |
+
PyErr_SetString(PyExc_TypeError,
|
| 327 |
+
"instance exception may not have a separate value");
|
| 328 |
+
goto bad;
|
| 329 |
+
}
|
| 330 |
+
value = type;
|
| 331 |
+
type = (PyObject*) Py_TYPE(value);
|
| 332 |
+
} else if (PyExceptionClass_Check(type)) {
|
| 333 |
+
// make sure value is an exception instance of type
|
| 334 |
+
PyObject *instance_class = NULL;
|
| 335 |
+
if (value && PyExceptionInstance_Check(value)) {
|
| 336 |
+
instance_class = (PyObject*) Py_TYPE(value);
|
| 337 |
+
if (instance_class != type) {
|
| 338 |
+
int is_subclass = PyObject_IsSubclass(instance_class, type);
|
| 339 |
+
if (!is_subclass) {
|
| 340 |
+
instance_class = NULL;
|
| 341 |
+
} else if (unlikely(is_subclass == -1)) {
|
| 342 |
+
// error on subclass test
|
| 343 |
+
goto bad;
|
| 344 |
+
} else {
|
| 345 |
+
// believe the instance
|
| 346 |
+
type = instance_class;
|
| 347 |
+
}
|
| 348 |
+
}
|
| 349 |
+
}
|
| 350 |
+
if (!instance_class) {
|
| 351 |
+
// instantiate the type now (we don't know when and how it will be caught)
|
| 352 |
+
// assuming that 'value' is an argument to the type's constructor
|
| 353 |
+
// not using PyErr_NormalizeException() to avoid ref-counting problems
|
| 354 |
+
PyObject *args;
|
| 355 |
+
if (!value)
|
| 356 |
+
args = PyTuple_New(0);
|
| 357 |
+
else if (PyTuple_Check(value)) {
|
| 358 |
+
Py_INCREF(value);
|
| 359 |
+
args = value;
|
| 360 |
+
} else
|
| 361 |
+
args = PyTuple_Pack(1, value);
|
| 362 |
+
if (!args)
|
| 363 |
+
goto bad;
|
| 364 |
+
owned_instance = PyObject_Call(type, args, NULL);
|
| 365 |
+
Py_DECREF(args);
|
| 366 |
+
if (!owned_instance)
|
| 367 |
+
goto bad;
|
| 368 |
+
value = owned_instance;
|
| 369 |
+
if (!PyExceptionInstance_Check(value)) {
|
| 370 |
+
PyErr_Format(PyExc_TypeError,
|
| 371 |
+
"calling %R should have returned an instance of "
|
| 372 |
+
"BaseException, not %R",
|
| 373 |
+
type, Py_TYPE(value));
|
| 374 |
+
goto bad;
|
| 375 |
+
}
|
| 376 |
+
}
|
| 377 |
+
} else {
|
| 378 |
+
PyErr_SetString(PyExc_TypeError,
|
| 379 |
+
"raise: exception class must be a subclass of BaseException");
|
| 380 |
+
goto bad;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
if (cause) {
|
| 384 |
+
PyObject *fixed_cause;
|
| 385 |
+
if (cause == Py_None) {
|
| 386 |
+
// raise ... from None
|
| 387 |
+
fixed_cause = NULL;
|
| 388 |
+
} else if (PyExceptionClass_Check(cause)) {
|
| 389 |
+
fixed_cause = PyObject_CallObject(cause, NULL);
|
| 390 |
+
if (fixed_cause == NULL)
|
| 391 |
+
goto bad;
|
| 392 |
+
} else if (PyExceptionInstance_Check(cause)) {
|
| 393 |
+
fixed_cause = cause;
|
| 394 |
+
Py_INCREF(fixed_cause);
|
| 395 |
+
} else {
|
| 396 |
+
PyErr_SetString(PyExc_TypeError,
|
| 397 |
+
"exception causes must derive from "
|
| 398 |
+
"BaseException");
|
| 399 |
+
goto bad;
|
| 400 |
+
}
|
| 401 |
+
PyException_SetCause(value, fixed_cause);
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
PyErr_SetObject(type, value);
|
| 405 |
+
|
| 406 |
+
if (tb) {
|
| 407 |
+
#if PY_VERSION_HEX >= 0x030C00A6
|
| 408 |
+
// If this fails, we just get a different exception, so ignore the return value.
|
| 409 |
+
PyException_SetTraceback(value, tb);
|
| 410 |
+
#elif CYTHON_FAST_THREAD_STATE
|
| 411 |
+
PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
| 412 |
+
PyObject* tmp_tb = tstate->curexc_traceback;
|
| 413 |
+
if (tb != tmp_tb) {
|
| 414 |
+
Py_INCREF(tb);
|
| 415 |
+
tstate->curexc_traceback = tb;
|
| 416 |
+
Py_XDECREF(tmp_tb);
|
| 417 |
+
}
|
| 418 |
+
#else
|
| 419 |
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
| 420 |
+
PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
|
| 421 |
+
Py_INCREF(tb);
|
| 422 |
+
PyErr_Restore(tmp_type, tmp_value, tb);
|
| 423 |
+
Py_XDECREF(tmp_tb);
|
| 424 |
+
#endif
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
bad:
|
| 428 |
+
Py_XDECREF(owned_instance);
|
| 429 |
+
return;
|
| 430 |
+
}
|
| 431 |
+
#endif
|
| 432 |
+
|
| 433 |
+
|
| 434 |
+
/////////////// GetTopmostException.proto ///////////////
|
| 435 |
+
|
| 436 |
+
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
|
| 437 |
+
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
|
| 438 |
+
#endif
|
| 439 |
+
|
| 440 |
+
/////////////// GetTopmostException ///////////////
|
| 441 |
+
|
| 442 |
+
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
|
| 443 |
+
// Copied from errors.c in CPython.
|
| 444 |
+
static _PyErr_StackItem *
|
| 445 |
+
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
|
| 446 |
+
{
|
| 447 |
+
_PyErr_StackItem *exc_info = tstate->exc_info;
|
| 448 |
+
while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
|
| 449 |
+
exc_info->previous_item != NULL)
|
| 450 |
+
{
|
| 451 |
+
exc_info = exc_info->previous_item;
|
| 452 |
+
}
|
| 453 |
+
return exc_info;
|
| 454 |
+
}
|
| 455 |
+
#endif
|
| 456 |
+
|
| 457 |
+
|
| 458 |
+
/////////////// GetException.proto ///////////////
|
| 459 |
+
//@substitute: naming
|
| 460 |
+
//@requires: PyThreadStateGet
|
| 461 |
+
|
| 462 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 463 |
+
#define __Pyx_GetException(type, value, tb) __Pyx__GetException($local_tstate_cname, type, value, tb)
|
| 464 |
+
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
| 465 |
+
#else
|
| 466 |
+
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
| 467 |
+
#endif
|
| 468 |
+
|
| 469 |
+
/////////////// GetException ///////////////
|
| 470 |
+
|
| 471 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 472 |
+
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
|
| 473 |
+
#else
|
| 474 |
+
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
|
| 475 |
+
#endif
|
| 476 |
+
{
|
| 477 |
+
PyObject *local_type = NULL, *local_value, *local_tb = NULL;
|
| 478 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 479 |
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
| 480 |
+
#if PY_VERSION_HEX >= 0x030C00A6
|
| 481 |
+
local_value = tstate->current_exception;
|
| 482 |
+
tstate->current_exception = 0;
|
| 483 |
+
if (likely(local_value)) {
|
| 484 |
+
local_type = (PyObject*) Py_TYPE(local_value);
|
| 485 |
+
Py_INCREF(local_type);
|
| 486 |
+
local_tb = PyException_GetTraceback(local_value);
|
| 487 |
+
}
|
| 488 |
+
#else
|
| 489 |
+
local_type = tstate->curexc_type;
|
| 490 |
+
local_value = tstate->curexc_value;
|
| 491 |
+
local_tb = tstate->curexc_traceback;
|
| 492 |
+
tstate->curexc_type = 0;
|
| 493 |
+
tstate->curexc_value = 0;
|
| 494 |
+
tstate->curexc_traceback = 0;
|
| 495 |
+
#endif
|
| 496 |
+
#else
|
| 497 |
+
PyErr_Fetch(&local_type, &local_value, &local_tb);
|
| 498 |
+
#endif
|
| 499 |
+
|
| 500 |
+
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
|
| 501 |
+
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
|
| 502 |
+
if (unlikely(tstate->current_exception))
|
| 503 |
+
#elif CYTHON_FAST_THREAD_STATE
|
| 504 |
+
if (unlikely(tstate->curexc_type))
|
| 505 |
+
#else
|
| 506 |
+
if (unlikely(PyErr_Occurred()))
|
| 507 |
+
#endif
|
| 508 |
+
goto bad;
|
| 509 |
+
|
| 510 |
+
#if PY_MAJOR_VERSION >= 3
|
| 511 |
+
if (local_tb) {
|
| 512 |
+
if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
|
| 513 |
+
goto bad;
|
| 514 |
+
}
|
| 515 |
+
#endif
|
| 516 |
+
|
| 517 |
+
// traceback may be NULL for freshly raised exceptions
|
| 518 |
+
Py_XINCREF(local_tb);
|
| 519 |
+
// exception state may be temporarily empty in parallel loops (race condition)
|
| 520 |
+
Py_XINCREF(local_type);
|
| 521 |
+
Py_XINCREF(local_value);
|
| 522 |
+
*type = local_type;
|
| 523 |
+
*value = local_value;
|
| 524 |
+
*tb = local_tb;
|
| 525 |
+
|
| 526 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 527 |
+
#if CYTHON_USE_EXC_INFO_STACK
|
| 528 |
+
{
|
| 529 |
+
_PyErr_StackItem *exc_info = tstate->exc_info;
|
| 530 |
+
#if PY_VERSION_HEX >= 0x030B00a4
|
| 531 |
+
tmp_value = exc_info->exc_value;
|
| 532 |
+
exc_info->exc_value = local_value;
|
| 533 |
+
tmp_type = NULL;
|
| 534 |
+
tmp_tb = NULL;
|
| 535 |
+
Py_XDECREF(local_type);
|
| 536 |
+
Py_XDECREF(local_tb);
|
| 537 |
+
#else
|
| 538 |
+
tmp_type = exc_info->exc_type;
|
| 539 |
+
tmp_value = exc_info->exc_value;
|
| 540 |
+
tmp_tb = exc_info->exc_traceback;
|
| 541 |
+
exc_info->exc_type = local_type;
|
| 542 |
+
exc_info->exc_value = local_value;
|
| 543 |
+
exc_info->exc_traceback = local_tb;
|
| 544 |
+
#endif
|
| 545 |
+
}
|
| 546 |
+
#else
|
| 547 |
+
tmp_type = tstate->exc_type;
|
| 548 |
+
tmp_value = tstate->exc_value;
|
| 549 |
+
tmp_tb = tstate->exc_traceback;
|
| 550 |
+
tstate->exc_type = local_type;
|
| 551 |
+
tstate->exc_value = local_value;
|
| 552 |
+
tstate->exc_traceback = local_tb;
|
| 553 |
+
#endif
|
| 554 |
+
// Make sure tstate is in a consistent state when we XDECREF
|
| 555 |
+
// these objects (DECREF may run arbitrary code).
|
| 556 |
+
Py_XDECREF(tmp_type);
|
| 557 |
+
Py_XDECREF(tmp_value);
|
| 558 |
+
Py_XDECREF(tmp_tb);
|
| 559 |
+
#else
|
| 560 |
+
PyErr_SetExcInfo(local_type, local_value, local_tb);
|
| 561 |
+
#endif
|
| 562 |
+
|
| 563 |
+
return 0;
|
| 564 |
+
|
| 565 |
+
bad:
|
| 566 |
+
*type = 0;
|
| 567 |
+
*value = 0;
|
| 568 |
+
*tb = 0;
|
| 569 |
+
Py_XDECREF(local_type);
|
| 570 |
+
Py_XDECREF(local_value);
|
| 571 |
+
Py_XDECREF(local_tb);
|
| 572 |
+
return -1;
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
/////////////// ReRaiseException.proto ///////////////
|
| 576 |
+
|
| 577 |
+
static CYTHON_INLINE void __Pyx_ReraiseException(void); /*proto*/
|
| 578 |
+
|
| 579 |
+
/////////////// ReRaiseException ///////////////
|
| 580 |
+
//@requires: GetTopmostException
|
| 581 |
+
|
| 582 |
+
static CYTHON_INLINE void __Pyx_ReraiseException(void) {
|
| 583 |
+
PyObject *type = NULL, *value = NULL, *tb = NULL;
|
| 584 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 585 |
+
PyThreadState *tstate = PyThreadState_GET();
|
| 586 |
+
#if CYTHON_USE_EXC_INFO_STACK
|
| 587 |
+
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
|
| 588 |
+
value = exc_info->exc_value;
|
| 589 |
+
#if PY_VERSION_HEX >= 0x030B00a4
|
| 590 |
+
if (unlikely(value == Py_None)) {
|
| 591 |
+
value = NULL;
|
| 592 |
+
} else if (value) {
|
| 593 |
+
Py_INCREF(value);
|
| 594 |
+
type = (PyObject*) Py_TYPE(value);
|
| 595 |
+
Py_INCREF(type);
|
| 596 |
+
tb = PyException_GetTraceback(value);
|
| 597 |
+
}
|
| 598 |
+
#else
|
| 599 |
+
type = exc_info->exc_type;
|
| 600 |
+
tb = exc_info->exc_traceback;
|
| 601 |
+
Py_XINCREF(type);
|
| 602 |
+
Py_XINCREF(value);
|
| 603 |
+
Py_XINCREF(tb);
|
| 604 |
+
#endif
|
| 605 |
+
#else
|
| 606 |
+
type = tstate->exc_type;
|
| 607 |
+
value = tstate->exc_value;
|
| 608 |
+
tb = tstate->exc_traceback;
|
| 609 |
+
Py_XINCREF(type);
|
| 610 |
+
Py_XINCREF(value);
|
| 611 |
+
Py_XINCREF(tb);
|
| 612 |
+
#endif
|
| 613 |
+
#else
|
| 614 |
+
PyErr_GetExcInfo(&type, &value, &tb);
|
| 615 |
+
#endif
|
| 616 |
+
if (unlikely(!type || type == Py_None)) {
|
| 617 |
+
Py_XDECREF(type);
|
| 618 |
+
Py_XDECREF(value);
|
| 619 |
+
Py_XDECREF(tb);
|
| 620 |
+
// message copied from Py3
|
| 621 |
+
PyErr_SetString(PyExc_RuntimeError,
|
| 622 |
+
"No active exception to reraise");
|
| 623 |
+
} else {
|
| 624 |
+
PyErr_Restore(type, value, tb);
|
| 625 |
+
}
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
/////////////// SaveResetException.proto ///////////////
|
| 629 |
+
//@substitute: naming
|
| 630 |
+
//@requires: PyThreadStateGet
|
| 631 |
+
|
| 632 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 633 |
+
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave($local_tstate_cname, type, value, tb)
|
| 634 |
+
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
| 635 |
+
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset($local_tstate_cname, type, value, tb)
|
| 636 |
+
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); /*proto*/
|
| 637 |
+
|
| 638 |
+
#else
|
| 639 |
+
|
| 640 |
+
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
|
| 641 |
+
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
|
| 642 |
+
#endif
|
| 643 |
+
|
| 644 |
+
/////////////// SaveResetException ///////////////
|
| 645 |
+
//@requires: GetTopmostException
|
| 646 |
+
|
| 647 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 648 |
+
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
| 649 |
+
#if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
|
| 650 |
+
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
|
| 651 |
+
PyObject *exc_value = exc_info->exc_value;
|
| 652 |
+
if (exc_value == NULL || exc_value == Py_None) {
|
| 653 |
+
*value = NULL;
|
| 654 |
+
*type = NULL;
|
| 655 |
+
*tb = NULL;
|
| 656 |
+
} else {
|
| 657 |
+
*value = exc_value;
|
| 658 |
+
Py_INCREF(*value);
|
| 659 |
+
*type = (PyObject*) Py_TYPE(exc_value);
|
| 660 |
+
Py_INCREF(*type);
|
| 661 |
+
*tb = PyException_GetTraceback(exc_value);
|
| 662 |
+
}
|
| 663 |
+
#elif CYTHON_USE_EXC_INFO_STACK
|
| 664 |
+
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
|
| 665 |
+
*type = exc_info->exc_type;
|
| 666 |
+
*value = exc_info->exc_value;
|
| 667 |
+
*tb = exc_info->exc_traceback;
|
| 668 |
+
Py_XINCREF(*type);
|
| 669 |
+
Py_XINCREF(*value);
|
| 670 |
+
Py_XINCREF(*tb);
|
| 671 |
+
#else
|
| 672 |
+
*type = tstate->exc_type;
|
| 673 |
+
*value = tstate->exc_value;
|
| 674 |
+
*tb = tstate->exc_traceback;
|
| 675 |
+
Py_XINCREF(*type);
|
| 676 |
+
Py_XINCREF(*value);
|
| 677 |
+
Py_XINCREF(*tb);
|
| 678 |
+
#endif
|
| 679 |
+
}
|
| 680 |
+
|
| 681 |
+
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
|
| 682 |
+
#if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
|
| 683 |
+
_PyErr_StackItem *exc_info = tstate->exc_info;
|
| 684 |
+
PyObject *tmp_value = exc_info->exc_value;
|
| 685 |
+
exc_info->exc_value = value;
|
| 686 |
+
Py_XDECREF(tmp_value);
|
| 687 |
+
// TODO: avoid passing these at all
|
| 688 |
+
Py_XDECREF(type);
|
| 689 |
+
Py_XDECREF(tb);
|
| 690 |
+
#else
|
| 691 |
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
| 692 |
+
#if CYTHON_USE_EXC_INFO_STACK
|
| 693 |
+
_PyErr_StackItem *exc_info = tstate->exc_info;
|
| 694 |
+
tmp_type = exc_info->exc_type;
|
| 695 |
+
tmp_value = exc_info->exc_value;
|
| 696 |
+
tmp_tb = exc_info->exc_traceback;
|
| 697 |
+
exc_info->exc_type = type;
|
| 698 |
+
exc_info->exc_value = value;
|
| 699 |
+
exc_info->exc_traceback = tb;
|
| 700 |
+
#else
|
| 701 |
+
tmp_type = tstate->exc_type;
|
| 702 |
+
tmp_value = tstate->exc_value;
|
| 703 |
+
tmp_tb = tstate->exc_traceback;
|
| 704 |
+
tstate->exc_type = type;
|
| 705 |
+
tstate->exc_value = value;
|
| 706 |
+
tstate->exc_traceback = tb;
|
| 707 |
+
#endif
|
| 708 |
+
Py_XDECREF(tmp_type);
|
| 709 |
+
Py_XDECREF(tmp_value);
|
| 710 |
+
Py_XDECREF(tmp_tb);
|
| 711 |
+
#endif
|
| 712 |
+
}
|
| 713 |
+
#endif
|
| 714 |
+
|
| 715 |
+
/////////////// SwapException.proto ///////////////
|
| 716 |
+
//@substitute: naming
|
| 717 |
+
//@requires: PyThreadStateGet
|
| 718 |
+
|
| 719 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 720 |
+
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap($local_tstate_cname, type, value, tb)
|
| 721 |
+
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
| 722 |
+
#else
|
| 723 |
+
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
| 724 |
+
#endif
|
| 725 |
+
|
| 726 |
+
/////////////// SwapException ///////////////
|
| 727 |
+
|
| 728 |
+
#if CYTHON_FAST_THREAD_STATE
|
| 729 |
+
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
| 730 |
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
| 731 |
+
#if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
|
| 732 |
+
_PyErr_StackItem *exc_info = tstate->exc_info;
|
| 733 |
+
tmp_value = exc_info->exc_value;
|
| 734 |
+
exc_info->exc_value = *value;
|
| 735 |
+
if (tmp_value == NULL || tmp_value == Py_None) {
|
| 736 |
+
Py_XDECREF(tmp_value);
|
| 737 |
+
tmp_value = NULL;
|
| 738 |
+
tmp_type = NULL;
|
| 739 |
+
tmp_tb = NULL;
|
| 740 |
+
} else {
|
| 741 |
+
// TODO: avoid swapping these at all
|
| 742 |
+
tmp_type = (PyObject*) Py_TYPE(tmp_value);
|
| 743 |
+
Py_INCREF(tmp_type);
|
| 744 |
+
#if CYTHON_COMPILING_IN_CPYTHON
|
| 745 |
+
tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
|
| 746 |
+
Py_XINCREF(tmp_tb);
|
| 747 |
+
#else
|
| 748 |
+
tmp_tb = PyException_GetTraceback(tmp_value);
|
| 749 |
+
#endif
|
| 750 |
+
}
|
| 751 |
+
#elif CYTHON_USE_EXC_INFO_STACK
|
| 752 |
+
_PyErr_StackItem *exc_info = tstate->exc_info;
|
| 753 |
+
tmp_type = exc_info->exc_type;
|
| 754 |
+
tmp_value = exc_info->exc_value;
|
| 755 |
+
tmp_tb = exc_info->exc_traceback;
|
| 756 |
+
|
| 757 |
+
exc_info->exc_type = *type;
|
| 758 |
+
exc_info->exc_value = *value;
|
| 759 |
+
exc_info->exc_traceback = *tb;
|
| 760 |
+
#else
|
| 761 |
+
tmp_type = tstate->exc_type;
|
| 762 |
+
tmp_value = tstate->exc_value;
|
| 763 |
+
tmp_tb = tstate->exc_traceback;
|
| 764 |
+
|
| 765 |
+
tstate->exc_type = *type;
|
| 766 |
+
tstate->exc_value = *value;
|
| 767 |
+
tstate->exc_traceback = *tb;
|
| 768 |
+
#endif
|
| 769 |
+
|
| 770 |
+
*type = tmp_type;
|
| 771 |
+
*value = tmp_value;
|
| 772 |
+
*tb = tmp_tb;
|
| 773 |
+
}
|
| 774 |
+
|
| 775 |
+
#else
|
| 776 |
+
|
| 777 |
+
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
|
| 778 |
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
| 779 |
+
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
|
| 780 |
+
PyErr_SetExcInfo(*type, *value, *tb);
|
| 781 |
+
*type = tmp_type;
|
| 782 |
+
*value = tmp_value;
|
| 783 |
+
*tb = tmp_tb;
|
| 784 |
+
}
|
| 785 |
+
#endif
|
| 786 |
+
|
| 787 |
+
/////////////// WriteUnraisableException.proto ///////////////
|
| 788 |
+
|
| 789 |
+
static void __Pyx_WriteUnraisable(const char *name, int clineno,
|
| 790 |
+
int lineno, const char *filename,
|
| 791 |
+
int full_traceback, int nogil); /*proto*/
|
| 792 |
+
|
| 793 |
+
/////////////// WriteUnraisableException ///////////////
|
| 794 |
+
//@requires: PyErrFetchRestore
|
| 795 |
+
//@requires: PyThreadStateGet
|
| 796 |
+
|
| 797 |
+
static void __Pyx_WriteUnraisable(const char *name, int clineno,
|
| 798 |
+
int lineno, const char *filename,
|
| 799 |
+
int full_traceback, int nogil) {
|
| 800 |
+
PyObject *old_exc, *old_val, *old_tb;
|
| 801 |
+
PyObject *ctx;
|
| 802 |
+
__Pyx_PyThreadState_declare
|
| 803 |
+
#ifdef WITH_THREAD
|
| 804 |
+
PyGILState_STATE state;
|
| 805 |
+
if (nogil)
|
| 806 |
+
state = PyGILState_Ensure();
|
| 807 |
+
/* arbitrary, to suppress warning */
|
| 808 |
+
else state = (PyGILState_STATE)0;
|
| 809 |
+
#endif
|
| 810 |
+
CYTHON_UNUSED_VAR(clineno);
|
| 811 |
+
CYTHON_UNUSED_VAR(lineno);
|
| 812 |
+
CYTHON_UNUSED_VAR(filename);
|
| 813 |
+
CYTHON_MAYBE_UNUSED_VAR(nogil);
|
| 814 |
+
|
| 815 |
+
__Pyx_PyThreadState_assign
|
| 816 |
+
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
|
| 817 |
+
if (full_traceback) {
|
| 818 |
+
Py_XINCREF(old_exc);
|
| 819 |
+
Py_XINCREF(old_val);
|
| 820 |
+
Py_XINCREF(old_tb);
|
| 821 |
+
__Pyx_ErrRestore(old_exc, old_val, old_tb);
|
| 822 |
+
PyErr_PrintEx(0);
|
| 823 |
+
}
|
| 824 |
+
#if PY_MAJOR_VERSION < 3
|
| 825 |
+
ctx = PyString_FromString(name);
|
| 826 |
+
#else
|
| 827 |
+
ctx = PyUnicode_FromString(name);
|
| 828 |
+
#endif
|
| 829 |
+
__Pyx_ErrRestore(old_exc, old_val, old_tb);
|
| 830 |
+
if (!ctx) {
|
| 831 |
+
PyErr_WriteUnraisable(Py_None);
|
| 832 |
+
} else {
|
| 833 |
+
PyErr_WriteUnraisable(ctx);
|
| 834 |
+
Py_DECREF(ctx);
|
| 835 |
+
}
|
| 836 |
+
#ifdef WITH_THREAD
|
| 837 |
+
if (nogil)
|
| 838 |
+
PyGILState_Release(state);
|
| 839 |
+
#endif
|
| 840 |
+
}
|
| 841 |
+
|
| 842 |
+
/////////////// CLineInTraceback.proto ///////////////
|
| 843 |
+
|
| 844 |
+
#ifdef CYTHON_CLINE_IN_TRACEBACK /* 0 or 1 to disable/enable C line display in tracebacks at C compile time */
|
| 845 |
+
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
|
| 846 |
+
#else
|
| 847 |
+
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);/*proto*/
|
| 848 |
+
#endif
|
| 849 |
+
|
| 850 |
+
/////////////// CLineInTraceback ///////////////
|
| 851 |
+
//@requires: ObjectHandling.c::PyObjectGetAttrStrNoError
|
| 852 |
+
//@requires: ObjectHandling.c::PyDictVersioning
|
| 853 |
+
//@requires: PyErrFetchRestore
|
| 854 |
+
//@substitute: naming
|
| 855 |
+
|
| 856 |
+
#ifndef CYTHON_CLINE_IN_TRACEBACK
|
| 857 |
+
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
|
| 858 |
+
PyObject *use_cline;
|
| 859 |
+
PyObject *ptype, *pvalue, *ptraceback;
|
| 860 |
+
#if CYTHON_COMPILING_IN_CPYTHON
|
| 861 |
+
PyObject **cython_runtime_dict;
|
| 862 |
+
#endif
|
| 863 |
+
|
| 864 |
+
CYTHON_MAYBE_UNUSED_VAR(tstate);
|
| 865 |
+
|
| 866 |
+
if (unlikely(!${cython_runtime_cname})) {
|
| 867 |
+
// Very early error where the runtime module is not set up yet.
|
| 868 |
+
return c_line;
|
| 869 |
+
}
|
| 870 |
+
|
| 871 |
+
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
| 872 |
+
|
| 873 |
+
#if CYTHON_COMPILING_IN_CPYTHON
|
| 874 |
+
cython_runtime_dict = _PyObject_GetDictPtr(${cython_runtime_cname});
|
| 875 |
+
if (likely(cython_runtime_dict)) {
|
| 876 |
+
__PYX_PY_DICT_LOOKUP_IF_MODIFIED(
|
| 877 |
+
use_cline, *cython_runtime_dict,
|
| 878 |
+
__Pyx_PyDict_GetItemStr(*cython_runtime_dict, PYIDENT("cline_in_traceback")))
|
| 879 |
+
} else
|
| 880 |
+
#endif
|
| 881 |
+
{
|
| 882 |
+
PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(${cython_runtime_cname}, PYIDENT("cline_in_traceback"));
|
| 883 |
+
if (use_cline_obj) {
|
| 884 |
+
use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
|
| 885 |
+
Py_DECREF(use_cline_obj);
|
| 886 |
+
} else {
|
| 887 |
+
PyErr_Clear();
|
| 888 |
+
use_cline = NULL;
|
| 889 |
+
}
|
| 890 |
+
}
|
| 891 |
+
if (!use_cline) {
|
| 892 |
+
c_line = 0;
|
| 893 |
+
// No need to handle errors here when we reset the exception state just afterwards.
|
| 894 |
+
(void) PyObject_SetAttr(${cython_runtime_cname}, PYIDENT("cline_in_traceback"), Py_False);
|
| 895 |
+
}
|
| 896 |
+
else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
|
| 897 |
+
c_line = 0;
|
| 898 |
+
}
|
| 899 |
+
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
| 900 |
+
return c_line;
|
| 901 |
+
}
|
| 902 |
+
#endif
|
| 903 |
+
|
| 904 |
+
/////////////// AddTraceback.proto ///////////////
|
| 905 |
+
|
| 906 |
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
| 907 |
+
int py_line, const char *filename); /*proto*/
|
| 908 |
+
|
| 909 |
+
/////////////// AddTraceback ///////////////
|
| 910 |
+
//@requires: ModuleSetupCode.c::CodeObjectCache
|
| 911 |
+
//@requires: CLineInTraceback
|
| 912 |
+
//@substitute: naming
|
| 913 |
+
|
| 914 |
+
#include "compile.h"
|
| 915 |
+
#include "frameobject.h"
|
| 916 |
+
#include "traceback.h"
|
| 917 |
+
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
|
| 918 |
+
#ifndef Py_BUILD_CORE
|
| 919 |
+
#define Py_BUILD_CORE 1
|
| 920 |
+
#endif
|
| 921 |
+
#include "internal/pycore_frame.h"
|
| 922 |
+
#endif
|
| 923 |
+
|
| 924 |
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
| 925 |
+
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
|
| 926 |
+
PyObject *firstlineno, PyObject *name) {
|
| 927 |
+
PyObject *replace = NULL;
|
| 928 |
+
if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
|
| 929 |
+
if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
|
| 930 |
+
|
| 931 |
+
replace = PyObject_GetAttrString(code, "replace");
|
| 932 |
+
if (likely(replace)) {
|
| 933 |
+
PyObject *result;
|
| 934 |
+
result = PyObject_Call(replace, $empty_tuple, scratch_dict);
|
| 935 |
+
Py_DECREF(replace);
|
| 936 |
+
return result;
|
| 937 |
+
}
|
| 938 |
+
PyErr_Clear();
|
| 939 |
+
|
| 940 |
+
#if __PYX_LIMITED_VERSION_HEX < 0x030780000
|
| 941 |
+
// If we're here, we're probably on Python <=3.7 which doesn't have code.replace.
|
| 942 |
+
// In this we take a lazy interpreted route (without regard to performance
|
| 943 |
+
// since it's fairly old and this is mostly just to get something working)
|
| 944 |
+
{
|
| 945 |
+
PyObject *compiled = NULL, *result = NULL;
|
| 946 |
+
if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
|
| 947 |
+
if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
|
| 948 |
+
compiled = Py_CompileString(
|
| 949 |
+
"out = type(code)(\n"
|
| 950 |
+
" code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
|
| 951 |
+
" code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
|
| 952 |
+
" code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
|
| 953 |
+
" code.co_lnotab)\n", "<dummy>", Py_file_input);
|
| 954 |
+
if (!compiled) return NULL;
|
| 955 |
+
result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
|
| 956 |
+
Py_DECREF(compiled);
|
| 957 |
+
if (!result) PyErr_Print();
|
| 958 |
+
Py_DECREF(result);
|
| 959 |
+
result = PyDict_GetItemString(scratch_dict, "out");
|
| 960 |
+
if (result) Py_INCREF(result);
|
| 961 |
+
return result;
|
| 962 |
+
}
|
| 963 |
+
#else
|
| 964 |
+
return NULL;
|
| 965 |
+
#endif
|
| 966 |
+
}
|
| 967 |
+
|
| 968 |
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
| 969 |
+
int py_line, const char *filename) {
|
| 970 |
+
PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
|
| 971 |
+
PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
|
| 972 |
+
PyObject *exc_type, *exc_value, *exc_traceback;
|
| 973 |
+
int success = 0;
|
| 974 |
+
if (c_line) {
|
| 975 |
+
// Avoid "unused" warning as long as we don't use this.
|
| 976 |
+
(void) $cfilenm_cname;
|
| 977 |
+
(void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
|
| 978 |
+
}
|
| 979 |
+
|
| 980 |
+
// DW - this is a horrendous hack, but I'm quite proud of it. Essentially
|
| 981 |
+
// we need to generate a frame with the right line number/filename/funcname.
|
| 982 |
+
// We do this by compiling a small bit of code that uses sys._getframe to get a
|
| 983 |
+
// frame, and then customizing the details of the code to match.
|
| 984 |
+
// We then run the code object and use the generated frame to set the traceback.
|
| 985 |
+
|
| 986 |
+
PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
|
| 987 |
+
|
| 988 |
+
code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
|
| 989 |
+
if (unlikely(!code_object)) goto bad;
|
| 990 |
+
py_py_line = PyLong_FromLong(py_line);
|
| 991 |
+
if (unlikely(!py_py_line)) goto bad;
|
| 992 |
+
py_funcname = PyUnicode_FromString(funcname);
|
| 993 |
+
if (unlikely(!py_funcname)) goto bad;
|
| 994 |
+
dict = PyDict_New();
|
| 995 |
+
if (unlikely(!dict)) goto bad;
|
| 996 |
+
{
|
| 997 |
+
PyObject *old_code_object = code_object;
|
| 998 |
+
code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
|
| 999 |
+
Py_DECREF(old_code_object);
|
| 1000 |
+
}
|
| 1001 |
+
if (unlikely(!code_object)) goto bad;
|
| 1002 |
+
|
| 1003 |
+
// Note that getframe is borrowed
|
| 1004 |
+
getframe = PySys_GetObject("_getframe");
|
| 1005 |
+
if (unlikely(!getframe)) goto bad;
|
| 1006 |
+
// reuse dict as globals (nothing conflicts, and it saves an allocation)
|
| 1007 |
+
if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
|
| 1008 |
+
|
| 1009 |
+
frame = PyEval_EvalCode(code_object, dict, dict);
|
| 1010 |
+
if (unlikely(!frame) || frame == Py_None) goto bad;
|
| 1011 |
+
success = 1;
|
| 1012 |
+
|
| 1013 |
+
bad:
|
| 1014 |
+
PyErr_Restore(exc_type, exc_value, exc_traceback);
|
| 1015 |
+
Py_XDECREF(code_object);
|
| 1016 |
+
Py_XDECREF(py_py_line);
|
| 1017 |
+
Py_XDECREF(py_funcname);
|
| 1018 |
+
Py_XDECREF(dict);
|
| 1019 |
+
Py_XDECREF(replace);
|
| 1020 |
+
|
| 1021 |
+
if (success) {
|
| 1022 |
+
// Unfortunately an easy way to check the type of frame isn't in the
|
| 1023 |
+
// limited API. The check against None should cover the most
|
| 1024 |
+
// likely wrong answer though.
|
| 1025 |
+
PyTraceBack_Here(
|
| 1026 |
+
// Python < 0x03090000 didn't expose PyFrameObject
|
| 1027 |
+
// but they all expose struct _frame as an opaque type
|
| 1028 |
+
(struct _frame*)frame);
|
| 1029 |
+
}
|
| 1030 |
+
|
| 1031 |
+
Py_XDECREF(frame);
|
| 1032 |
+
}
|
| 1033 |
+
#else
|
| 1034 |
+
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
| 1035 |
+
const char *funcname, int c_line,
|
| 1036 |
+
int py_line, const char *filename) {
|
| 1037 |
+
PyCodeObject *py_code = NULL;
|
| 1038 |
+
PyObject *py_funcname = NULL;
|
| 1039 |
+
#if PY_MAJOR_VERSION < 3
|
| 1040 |
+
PyObject *py_srcfile = NULL;
|
| 1041 |
+
|
| 1042 |
+
py_srcfile = PyString_FromString(filename);
|
| 1043 |
+
if (!py_srcfile) goto bad;
|
| 1044 |
+
#endif
|
| 1045 |
+
|
| 1046 |
+
if (c_line) {
|
| 1047 |
+
#if PY_MAJOR_VERSION < 3
|
| 1048 |
+
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, $cfilenm_cname, c_line);
|
| 1049 |
+
if (!py_funcname) goto bad;
|
| 1050 |
+
#else
|
| 1051 |
+
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, $cfilenm_cname, c_line);
|
| 1052 |
+
if (!py_funcname) goto bad;
|
| 1053 |
+
funcname = PyUnicode_AsUTF8(py_funcname);
|
| 1054 |
+
if (!funcname) goto bad;
|
| 1055 |
+
#endif
|
| 1056 |
+
}
|
| 1057 |
+
else {
|
| 1058 |
+
#if PY_MAJOR_VERSION < 3
|
| 1059 |
+
py_funcname = PyString_FromString(funcname);
|
| 1060 |
+
if (!py_funcname) goto bad;
|
| 1061 |
+
#endif
|
| 1062 |
+
}
|
| 1063 |
+
#if PY_MAJOR_VERSION < 3
|
| 1064 |
+
py_code = __Pyx_PyCode_New(
|
| 1065 |
+
0, /*int argcount,*/
|
| 1066 |
+
0, /*int posonlyargcount,*/
|
| 1067 |
+
0, /*int kwonlyargcount,*/
|
| 1068 |
+
0, /*int nlocals,*/
|
| 1069 |
+
0, /*int stacksize,*/
|
| 1070 |
+
0, /*int flags,*/
|
| 1071 |
+
$empty_bytes, /*PyObject *code,*/
|
| 1072 |
+
$empty_tuple, /*PyObject *consts,*/
|
| 1073 |
+
$empty_tuple, /*PyObject *names,*/
|
| 1074 |
+
$empty_tuple, /*PyObject *varnames,*/
|
| 1075 |
+
$empty_tuple, /*PyObject *freevars,*/
|
| 1076 |
+
$empty_tuple, /*PyObject *cellvars,*/
|
| 1077 |
+
py_srcfile, /*PyObject *filename,*/
|
| 1078 |
+
py_funcname, /*PyObject *name,*/
|
| 1079 |
+
py_line, /*int firstlineno,*/
|
| 1080 |
+
$empty_bytes /*PyObject *lnotab*/
|
| 1081 |
+
);
|
| 1082 |
+
Py_DECREF(py_srcfile);
|
| 1083 |
+
#else
|
| 1084 |
+
py_code = PyCode_NewEmpty(filename, funcname, py_line);
|
| 1085 |
+
#endif
|
| 1086 |
+
Py_XDECREF(py_funcname); /* XDECREF since it's only set on Py3 if cline */
|
| 1087 |
+
return py_code;
|
| 1088 |
+
bad:
|
| 1089 |
+
Py_XDECREF(py_funcname);
|
| 1090 |
+
#if PY_MAJOR_VERSION < 3
|
| 1091 |
+
Py_XDECREF(py_srcfile);
|
| 1092 |
+
#endif
|
| 1093 |
+
return NULL;
|
| 1094 |
+
}
|
| 1095 |
+
|
| 1096 |
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
| 1097 |
+
int py_line, const char *filename) {
|
| 1098 |
+
PyCodeObject *py_code = 0;
|
| 1099 |
+
PyFrameObject *py_frame = 0;
|
| 1100 |
+
PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
| 1101 |
+
PyObject *ptype, *pvalue, *ptraceback;
|
| 1102 |
+
|
| 1103 |
+
if (c_line) {
|
| 1104 |
+
c_line = __Pyx_CLineForTraceback(tstate, c_line);
|
| 1105 |
+
}
|
| 1106 |
+
|
| 1107 |
+
// Negate to avoid collisions between py and c lines.
|
| 1108 |
+
py_code = $global_code_object_cache_find(c_line ? -c_line : py_line);
|
| 1109 |
+
if (!py_code) {
|
| 1110 |
+
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
| 1111 |
+
py_code = __Pyx_CreateCodeObjectForTraceback(
|
| 1112 |
+
funcname, c_line, py_line, filename);
|
| 1113 |
+
if (!py_code) {
|
| 1114 |
+
/* If the code object creation fails, then we should clear the
|
| 1115 |
+
fetched exception references and propagate the new exception */
|
| 1116 |
+
Py_XDECREF(ptype);
|
| 1117 |
+
Py_XDECREF(pvalue);
|
| 1118 |
+
Py_XDECREF(ptraceback);
|
| 1119 |
+
goto bad;
|
| 1120 |
+
}
|
| 1121 |
+
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
| 1122 |
+
$global_code_object_cache_insert(c_line ? -c_line : py_line, py_code);
|
| 1123 |
+
}
|
| 1124 |
+
py_frame = PyFrame_New(
|
| 1125 |
+
tstate, /*PyThreadState *tstate,*/
|
| 1126 |
+
py_code, /*PyCodeObject *code,*/
|
| 1127 |
+
$moddict_cname, /*PyObject *globals,*/
|
| 1128 |
+
0 /*PyObject *locals*/
|
| 1129 |
+
);
|
| 1130 |
+
if (!py_frame) goto bad;
|
| 1131 |
+
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
|
| 1132 |
+
PyTraceBack_Here(py_frame);
|
| 1133 |
+
bad:
|
| 1134 |
+
Py_XDECREF(py_code);
|
| 1135 |
+
Py_XDECREF(py_frame);
|
| 1136 |
+
}
|
| 1137 |
+
#endif
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/NumpyImportArray.c
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
///////////////////////// NumpyImportArray.init ////////////////////
|
| 2 |
+
|
| 3 |
+
// comment below is deliberately kept in the generated C file to
|
| 4 |
+
// help users debug where this came from:
|
| 5 |
+
/*
|
| 6 |
+
* Cython has automatically inserted a call to _import_array since
|
| 7 |
+
* you didn't include one when you cimported numpy. To disable this
|
| 8 |
+
* add the line
|
| 9 |
+
* <void>numpy._import_array
|
| 10 |
+
*/
|
| 11 |
+
#ifdef NPY_FEATURE_VERSION /* This is a public define that makes us reasonably confident it's "real" Numpy */
|
| 12 |
+
// NO_IMPORT_ARRAY is Numpy's mechanism for indicating that import_array is handled elsewhere
|
| 13 |
+
#ifndef NO_IMPORT_ARRAY /* https://numpy.org/doc/stable/reference/c-api/array.html#c.NO_IMPORT_ARRAY */
|
| 14 |
+
if (unlikely(_import_array() == -1)) {
|
| 15 |
+
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
|
| 16 |
+
"(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
|
| 17 |
+
"use '<void>numpy._import_array' to disable if you are certain you don't need it).");
|
| 18 |
+
}
|
| 19 |
+
#endif
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
///////////////////////// NumpyImportUFunc.init ////////////////////
|
| 23 |
+
|
| 24 |
+
// Unlike import_array, this is generated by the @cython.ufunc decorator
|
| 25 |
+
// so we're confident the right headers are present and don't need to override them
|
| 26 |
+
|
| 27 |
+
{
|
| 28 |
+
// NO_IMPORT_UFUNC is Numpy's mechanism for indicating that import_umath is handled elsewhere
|
| 29 |
+
#ifndef NO_IMPORT_UFUNC /* https://numpy.org/doc/stable/reference/c-api/ufunc.html#c.NO_IMPORT_UFUNC */
|
| 30 |
+
if (unlikely(_import_umath() == -1)) {
|
| 31 |
+
PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import "
|
| 32 |
+
"(auto-generated by @cython.ufunc).");
|
| 33 |
+
}
|
| 34 |
+
#else
|
| 35 |
+
if ((0)) {}
|
| 36 |
+
#endif
|
| 37 |
+
// NO_IMPORT_ARRAY is Numpy's mechanism for indicating that import_array is handled elsewhere
|
| 38 |
+
#ifndef NO_IMPORT_ARRAY /* https://numpy.org/doc/stable/reference/c-api/array.html#c.NO_IMPORT_ARRAY */
|
| 39 |
+
else if (unlikely(_import_array() == -1)) {
|
| 40 |
+
PyErr_SetString(PyExc_ImportError, "numpy.core.mult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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Optional optimisations of built-in functions and methods.
|
| 3 |
+
*
|
| 4 |
+
* Required replacements of builtins are in Builtins.c.
|
| 5 |
+
*
|
| 6 |
+
* General object operations and protocols are in ObjectHandling.c.
|
| 7 |
+
*/
|
| 8 |
+
|
| 9 |
+
/////////////// append.proto ///////////////
|
| 10 |
+
|
| 11 |
+
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/
|
| 12 |
+
|
| 13 |
+
/////////////// append ///////////////
|
| 14 |
+
//@requires: ListAppend
|
| 15 |
+
//@requires: ObjectHandling.c::PyObjectCallMethod1
|
| 16 |
+
|
| 17 |
+
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
|
| 18 |
+
if (likely(PyList_CheckExact(L))) {
|
| 19 |
+
if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
|
| 20 |
+
} else {
|
| 21 |
+
PyObject* retval = __Pyx_PyObject_CallMethod1(L, PYIDENT("append"), x);
|
| 22 |
+
if (unlikely(!retval))
|
| 23 |
+
return -1;
|
| 24 |
+
Py_DECREF(retval);
|
| 25 |
+
}
|
| 26 |
+
return 0;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/////////////// ListAppend.proto ///////////////
|
| 30 |
+
|
| 31 |
+
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
|
| 32 |
+
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
|
| 33 |
+
PyListObject* L = (PyListObject*) list;
|
| 34 |
+
Py_ssize_t len = Py_SIZE(list);
|
| 35 |
+
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
|
| 36 |
+
Py_INCREF(x);
|
| 37 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
| 38 |
+
// In Py3.13a1, PyList_SET_ITEM() checks that the end index is lower than the current size.
|
| 39 |
+
// However, extending the size *before* setting the value would not be correct,
|
| 40 |
+
// so we cannot call PyList_SET_ITEM().
|
| 41 |
+
L->ob_item[len] = x;
|
| 42 |
+
#else
|
| 43 |
+
PyList_SET_ITEM(list, len, x);
|
| 44 |
+
#endif
|
| 45 |
+
__Pyx_SET_SIZE(list, len + 1);
|
| 46 |
+
return 0;
|
| 47 |
+
}
|
| 48 |
+
return PyList_Append(list, x);
|
| 49 |
+
}
|
| 50 |
+
#else
|
| 51 |
+
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
|
| 52 |
+
#endif
|
| 53 |
+
|
| 54 |
+
/////////////// ListCompAppend.proto ///////////////
|
| 55 |
+
|
| 56 |
+
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
|
| 57 |
+
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
|
| 58 |
+
PyListObject* L = (PyListObject*) list;
|
| 59 |
+
Py_ssize_t len = Py_SIZE(list);
|
| 60 |
+
if (likely(L->allocated > len)) {
|
| 61 |
+
Py_INCREF(x);
|
| 62 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
| 63 |
+
// In Py3.13a1, PyList_SET_ITEM() checks that the end index is lower than the current size.
|
| 64 |
+
// However, extending the size *before* setting the value would not be correct,
|
| 65 |
+
// so we cannot call PyList_SET_ITEM().
|
| 66 |
+
L->ob_item[len] = x;
|
| 67 |
+
#else
|
| 68 |
+
PyList_SET_ITEM(list, len, x);
|
| 69 |
+
#endif
|
| 70 |
+
__Pyx_SET_SIZE(list, len + 1);
|
| 71 |
+
return 0;
|
| 72 |
+
}
|
| 73 |
+
return PyList_Append(list, x);
|
| 74 |
+
}
|
| 75 |
+
#else
|
| 76 |
+
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
//////////////////// ListExtend.proto ////////////////////
|
| 80 |
+
|
| 81 |
+
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
|
| 82 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
|
| 83 |
+
PyObject* none = _PyList_Extend((PyListObject*)L, v);
|
| 84 |
+
if (unlikely(!none))
|
| 85 |
+
return -1;
|
| 86 |
+
Py_DECREF(none);
|
| 87 |
+
return 0;
|
| 88 |
+
#else
|
| 89 |
+
return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
|
| 90 |
+
#endif
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/////////////// pop.proto ///////////////
|
| 94 |
+
|
| 95 |
+
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); /*proto*/
|
| 96 |
+
|
| 97 |
+
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
|
| 98 |
+
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); /*proto*/
|
| 99 |
+
#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ? \
|
| 100 |
+
__Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L))
|
| 101 |
+
|
| 102 |
+
#else
|
| 103 |
+
#define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L)
|
| 104 |
+
#define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L)
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
/////////////// pop ///////////////
|
| 108 |
+
//@requires: ObjectHandling.c::PyObjectCallMethod0
|
| 109 |
+
|
| 110 |
+
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
|
| 111 |
+
if (__Pyx_IS_TYPE(L, &PySet_Type)) {
|
| 112 |
+
return PySet_Pop(L);
|
| 113 |
+
}
|
| 114 |
+
return __Pyx_PyObject_CallMethod0(L, PYIDENT("pop"));
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
|
| 118 |
+
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
|
| 119 |
+
/* Check that both the size is positive and no reallocation shrinking needs to be done. */
|
| 120 |
+
if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
|
| 121 |
+
__Pyx_SET_SIZE(L, Py_SIZE(L) - 1);
|
| 122 |
+
return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
|
| 123 |
+
}
|
| 124 |
+
return CALL_UNBOUND_METHOD(PyList_Type, "pop", L);
|
| 125 |
+
}
|
| 126 |
+
#endif
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
/////////////// pop_index.proto ///////////////
|
| 130 |
+
|
| 131 |
+
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); /*proto*/
|
| 132 |
+
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); /*proto*/
|
| 133 |
+
|
| 134 |
+
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
|
| 135 |
+
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); /*proto*/
|
| 136 |
+
|
| 137 |
+
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) ( \
|
| 138 |
+
(likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ? \
|
| 139 |
+
__Pyx__PyList_PopIndex(L, py_ix, ix) : ( \
|
| 140 |
+
(unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) : \
|
| 141 |
+
__Pyx__PyObject_PopIndex(L, py_ix)))
|
| 142 |
+
|
| 143 |
+
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) ( \
|
| 144 |
+
__Pyx_fits_Py_ssize_t(ix, type, is_signed) ? \
|
| 145 |
+
__Pyx__PyList_PopIndex(L, py_ix, ix) : ( \
|
| 146 |
+
(unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) : \
|
| 147 |
+
__Pyx__PyObject_PopIndex(L, py_ix)))
|
| 148 |
+
|
| 149 |
+
#else
|
| 150 |
+
|
| 151 |
+
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) \
|
| 152 |
+
__Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)
|
| 153 |
+
|
| 154 |
+
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) ( \
|
| 155 |
+
(unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) : \
|
| 156 |
+
__Pyx__PyObject_PopIndex(L, py_ix))
|
| 157 |
+
#endif
|
| 158 |
+
|
| 159 |
+
/////////////// pop_index ///////////////
|
| 160 |
+
//@requires: ObjectHandling.c::PyObjectCallMethod1
|
| 161 |
+
|
| 162 |
+
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
|
| 163 |
+
PyObject *r;
|
| 164 |
+
if (unlikely(!py_ix)) return NULL;
|
| 165 |
+
r = __Pyx__PyObject_PopIndex(L, py_ix);
|
| 166 |
+
Py_DECREF(py_ix);
|
| 167 |
+
return r;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
|
| 171 |
+
return __Pyx_PyObject_CallMethod1(L, PYIDENT("pop"), py_ix);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
|
| 175 |
+
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
|
| 176 |
+
Py_ssize_t size = PyList_GET_SIZE(L);
|
| 177 |
+
if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
|
| 178 |
+
Py_ssize_t cix = ix;
|
| 179 |
+
if (cix < 0) {
|
| 180 |
+
cix += size;
|
| 181 |
+
}
|
| 182 |
+
if (likely(__Pyx_is_valid_index(cix, size))) {
|
| 183 |
+
PyObject* v = PyList_GET_ITEM(L, cix);
|
| 184 |
+
__Pyx_SET_SIZE(L, Py_SIZE(L) - 1);
|
| 185 |
+
size -= 1;
|
| 186 |
+
memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
|
| 187 |
+
return v;
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
if (py_ix == Py_None) {
|
| 191 |
+
return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
|
| 192 |
+
} else {
|
| 193 |
+
return __Pyx__PyObject_PopIndex(L, py_ix);
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
#endif
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
/////////////// dict_getitem_default.proto ///////////////
|
| 200 |
+
|
| 201 |
+
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /*proto*/
|
| 202 |
+
|
| 203 |
+
/////////////// dict_getitem_default ///////////////
|
| 204 |
+
|
| 205 |
+
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
|
| 206 |
+
PyObject* value;
|
| 207 |
+
#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
|
| 208 |
+
value = PyDict_GetItemWithError(d, key);
|
| 209 |
+
if (unlikely(!value)) {
|
| 210 |
+
if (unlikely(PyErr_Occurred()))
|
| 211 |
+
return NULL;
|
| 212 |
+
value = default_value;
|
| 213 |
+
}
|
| 214 |
+
Py_INCREF(value);
|
| 215 |
+
// avoid C compiler warning about unused utility functions
|
| 216 |
+
if ((1));
|
| 217 |
+
#else
|
| 218 |
+
if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
|
| 219 |
+
/* these presumably have safe hash functions */
|
| 220 |
+
value = PyDict_GetItem(d, key);
|
| 221 |
+
if (unlikely(!value)) {
|
| 222 |
+
value = default_value;
|
| 223 |
+
}
|
| 224 |
+
Py_INCREF(value);
|
| 225 |
+
}
|
| 226 |
+
#endif
|
| 227 |
+
else {
|
| 228 |
+
if (default_value == Py_None)
|
| 229 |
+
value = CALL_UNBOUND_METHOD(PyDict_Type, "get", d, key);
|
| 230 |
+
else
|
| 231 |
+
value = CALL_UNBOUND_METHOD(PyDict_Type, "get", d, key, default_value);
|
| 232 |
+
}
|
| 233 |
+
return value;
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
/////////////// dict_setdefault.proto ///////////////
|
| 238 |
+
|
| 239 |
+
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); /*proto*/
|
| 240 |
+
|
| 241 |
+
/////////////// dict_setdefault ///////////////
|
| 242 |
+
|
| 243 |
+
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value,
|
| 244 |
+
int is_safe_type) {
|
| 245 |
+
PyObject* value;
|
| 246 |
+
CYTHON_MAYBE_UNUSED_VAR(is_safe_type);
|
| 247 |
+
#if PY_VERSION_HEX >= 0x030400A0
|
| 248 |
+
// we keep the method call at the end to avoid "unused" C compiler warnings
|
| 249 |
+
if ((1)) {
|
| 250 |
+
value = PyDict_SetDefault(d, key, default_value);
|
| 251 |
+
if (unlikely(!value)) return NULL;
|
| 252 |
+
Py_INCREF(value);
|
| 253 |
+
#else
|
| 254 |
+
if (is_safe_type == 1 || (is_safe_type == -1 &&
|
| 255 |
+
/* the following builtins presumably have repeatably safe and fast hash functions */
|
| 256 |
+
#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
|
| 257 |
+
(PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) {
|
| 258 |
+
value = PyDict_GetItemWithError(d, key);
|
| 259 |
+
if (unlikely(!value)) {
|
| 260 |
+
if (unlikely(PyErr_Occurred()))
|
| 261 |
+
return NULL;
|
| 262 |
+
if (unlikely(PyDict_SetItem(d, key, default_value) == -1))
|
| 263 |
+
return NULL;
|
| 264 |
+
value = default_value;
|
| 265 |
+
}
|
| 266 |
+
Py_INCREF(value);
|
| 267 |
+
#else
|
| 268 |
+
(PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key) || PyLong_CheckExact(key)))) {
|
| 269 |
+
value = PyDict_GetItem(d, key);
|
| 270 |
+
if (unlikely(!value)) {
|
| 271 |
+
if (unlikely(PyDict_SetItem(d, key, default_value) == -1))
|
| 272 |
+
return NULL;
|
| 273 |
+
value = default_value;
|
| 274 |
+
}
|
| 275 |
+
Py_INCREF(value);
|
| 276 |
+
#endif
|
| 277 |
+
#endif
|
| 278 |
+
} else {
|
| 279 |
+
value = CALL_UNBOUND_METHOD(PyDict_Type, "setdefault", d, key, default_value);
|
| 280 |
+
}
|
| 281 |
+
return value;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
|
| 285 |
+
/////////////// py_dict_clear.proto ///////////////
|
| 286 |
+
|
| 287 |
+
#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
/////////////// py_dict_pop.proto ///////////////
|
| 291 |
+
|
| 292 |
+
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); /*proto*/
|
| 293 |
+
|
| 294 |
+
/////////////// py_dict_pop ///////////////
|
| 295 |
+
|
| 296 |
+
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) {
|
| 297 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 & PY_VERSION_HEX < 0x030d0000
|
| 298 |
+
if ((1)) {
|
| 299 |
+
return _PyDict_Pop(d, key, default_value);
|
| 300 |
+
} else
|
| 301 |
+
// avoid "function unused" warnings
|
| 302 |
+
#endif
|
| 303 |
+
if (default_value) {
|
| 304 |
+
return CALL_UNBOUND_METHOD(PyDict_Type, "pop", d, key, default_value);
|
| 305 |
+
} else {
|
| 306 |
+
return CALL_UNBOUND_METHOD(PyDict_Type, "pop", d, key);
|
| 307 |
+
}
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
/////////////// dict_iter.proto ///////////////
|
| 312 |
+
|
| 313 |
+
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
|
| 314 |
+
Py_ssize_t* p_orig_length, int* p_is_dict);
|
| 315 |
+
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
|
| 316 |
+
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
|
| 317 |
+
|
| 318 |
+
/////////////// dict_iter ///////////////
|
| 319 |
+
//@requires: ObjectHandling.c::UnpackTuple2
|
| 320 |
+
//@requires: ObjectHandling.c::IterFinish
|
| 321 |
+
//@requires: ObjectHandling.c::PyObjectCallMethod0
|
| 322 |
+
|
| 323 |
+
#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
| 324 |
+
#include <string.h>
|
| 325 |
+
#endif
|
| 326 |
+
|
| 327 |
+
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
|
| 328 |
+
Py_ssize_t* p_orig_length, int* p_source_is_dict) {
|
| 329 |
+
is_dict = is_dict || likely(PyDict_CheckExact(iterable));
|
| 330 |
+
*p_source_is_dict = is_dict;
|
| 331 |
+
if (is_dict) {
|
| 332 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 333 |
+
*p_orig_length = PyDict_Size(iterable);
|
| 334 |
+
Py_INCREF(iterable);
|
| 335 |
+
return iterable;
|
| 336 |
+
#elif PY_MAJOR_VERSION >= 3
|
| 337 |
+
// On PyPy3, we need to translate manually a few method names.
|
| 338 |
+
// This logic is not needed on CPython thanks to the fast case above.
|
| 339 |
+
static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
|
| 340 |
+
PyObject **pp = NULL;
|
| 341 |
+
if (method_name) {
|
| 342 |
+
const char *name = PyUnicode_AsUTF8(method_name);
|
| 343 |
+
if (strcmp(name, "iteritems") == 0) pp = &py_items;
|
| 344 |
+
else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
|
| 345 |
+
else if (strcmp(name, "itervalues") == 0) pp = &py_values;
|
| 346 |
+
if (pp) {
|
| 347 |
+
if (!*pp) {
|
| 348 |
+
*pp = PyUnicode_FromString(name + 4);
|
| 349 |
+
if (!*pp)
|
| 350 |
+
return NULL;
|
| 351 |
+
}
|
| 352 |
+
method_name = *pp;
|
| 353 |
+
}
|
| 354 |
+
}
|
| 355 |
+
#endif
|
| 356 |
+
}
|
| 357 |
+
*p_orig_length = 0;
|
| 358 |
+
if (method_name) {
|
| 359 |
+
PyObject* iter;
|
| 360 |
+
iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
|
| 361 |
+
if (!iterable)
|
| 362 |
+
return NULL;
|
| 363 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 364 |
+
if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
|
| 365 |
+
return iterable;
|
| 366 |
+
#endif
|
| 367 |
+
iter = PyObject_GetIter(iterable);
|
| 368 |
+
Py_DECREF(iterable);
|
| 369 |
+
return iter;
|
| 370 |
+
}
|
| 371 |
+
return PyObject_GetIter(iterable);
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
static CYTHON_INLINE int __Pyx_dict_iter_next(
|
| 375 |
+
PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
|
| 376 |
+
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
|
| 377 |
+
PyObject* next_item;
|
| 378 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 379 |
+
if (source_is_dict) {
|
| 380 |
+
PyObject *key, *value;
|
| 381 |
+
if (unlikely(orig_length != PyDict_Size(iter_obj))) {
|
| 382 |
+
PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
|
| 383 |
+
return -1;
|
| 384 |
+
}
|
| 385 |
+
if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
|
| 386 |
+
return 0;
|
| 387 |
+
}
|
| 388 |
+
if (pitem) {
|
| 389 |
+
PyObject* tuple = PyTuple_New(2);
|
| 390 |
+
if (unlikely(!tuple)) {
|
| 391 |
+
return -1;
|
| 392 |
+
}
|
| 393 |
+
Py_INCREF(key);
|
| 394 |
+
Py_INCREF(value);
|
| 395 |
+
PyTuple_SET_ITEM(tuple, 0, key);
|
| 396 |
+
PyTuple_SET_ITEM(tuple, 1, value);
|
| 397 |
+
*pitem = tuple;
|
| 398 |
+
} else {
|
| 399 |
+
if (pkey) {
|
| 400 |
+
Py_INCREF(key);
|
| 401 |
+
*pkey = key;
|
| 402 |
+
}
|
| 403 |
+
if (pvalue) {
|
| 404 |
+
Py_INCREF(value);
|
| 405 |
+
*pvalue = value;
|
| 406 |
+
}
|
| 407 |
+
}
|
| 408 |
+
return 1;
|
| 409 |
+
} else if (PyTuple_CheckExact(iter_obj)) {
|
| 410 |
+
Py_ssize_t pos = *ppos;
|
| 411 |
+
if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
|
| 412 |
+
*ppos = pos + 1;
|
| 413 |
+
next_item = PyTuple_GET_ITEM(iter_obj, pos);
|
| 414 |
+
Py_INCREF(next_item);
|
| 415 |
+
} else if (PyList_CheckExact(iter_obj)) {
|
| 416 |
+
Py_ssize_t pos = *ppos;
|
| 417 |
+
if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
|
| 418 |
+
*ppos = pos + 1;
|
| 419 |
+
next_item = PyList_GET_ITEM(iter_obj, pos);
|
| 420 |
+
Py_INCREF(next_item);
|
| 421 |
+
} else
|
| 422 |
+
#endif
|
| 423 |
+
{
|
| 424 |
+
next_item = PyIter_Next(iter_obj);
|
| 425 |
+
if (unlikely(!next_item)) {
|
| 426 |
+
return __Pyx_IterFinish();
|
| 427 |
+
}
|
| 428 |
+
}
|
| 429 |
+
if (pitem) {
|
| 430 |
+
*pitem = next_item;
|
| 431 |
+
} else if (pkey && pvalue) {
|
| 432 |
+
if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
|
| 433 |
+
return -1;
|
| 434 |
+
} else if (pkey) {
|
| 435 |
+
*pkey = next_item;
|
| 436 |
+
} else {
|
| 437 |
+
*pvalue = next_item;
|
| 438 |
+
}
|
| 439 |
+
return 1;
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
/////////////// set_iter.proto ///////////////
|
| 444 |
+
|
| 445 |
+
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
|
| 446 |
+
Py_ssize_t* p_orig_length, int* p_source_is_set); /*proto*/
|
| 447 |
+
static CYTHON_INLINE int __Pyx_set_iter_next(
|
| 448 |
+
PyObject* iter_obj, Py_ssize_t orig_length,
|
| 449 |
+
Py_ssize_t* ppos, PyObject **value,
|
| 450 |
+
int source_is_set); /*proto*/
|
| 451 |
+
|
| 452 |
+
/////////////// set_iter ///////////////
|
| 453 |
+
//@requires: ObjectHandling.c::IterFinish
|
| 454 |
+
|
| 455 |
+
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
|
| 456 |
+
Py_ssize_t* p_orig_length, int* p_source_is_set) {
|
| 457 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
|
| 458 |
+
is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
|
| 459 |
+
*p_source_is_set = is_set;
|
| 460 |
+
if (likely(is_set)) {
|
| 461 |
+
*p_orig_length = PySet_Size(iterable);
|
| 462 |
+
Py_INCREF(iterable);
|
| 463 |
+
return iterable;
|
| 464 |
+
}
|
| 465 |
+
#else
|
| 466 |
+
CYTHON_UNUSED_VAR(is_set);
|
| 467 |
+
*p_source_is_set = 0;
|
| 468 |
+
#endif
|
| 469 |
+
*p_orig_length = 0;
|
| 470 |
+
return PyObject_GetIter(iterable);
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
static CYTHON_INLINE int __Pyx_set_iter_next(
|
| 474 |
+
PyObject* iter_obj, Py_ssize_t orig_length,
|
| 475 |
+
Py_ssize_t* ppos, PyObject **value,
|
| 476 |
+
int source_is_set) {
|
| 477 |
+
if (!CYTHON_COMPILING_IN_CPYTHON || PY_VERSION_HEX >= 0x030d0000 || unlikely(!source_is_set)) {
|
| 478 |
+
*value = PyIter_Next(iter_obj);
|
| 479 |
+
if (unlikely(!*value)) {
|
| 480 |
+
return __Pyx_IterFinish();
|
| 481 |
+
}
|
| 482 |
+
CYTHON_UNUSED_VAR(orig_length);
|
| 483 |
+
CYTHON_UNUSED_VAR(ppos);
|
| 484 |
+
return 1;
|
| 485 |
+
}
|
| 486 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
|
| 487 |
+
if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
|
| 488 |
+
PyErr_SetString(
|
| 489 |
+
PyExc_RuntimeError,
|
| 490 |
+
"set changed size during iteration");
|
| 491 |
+
return -1;
|
| 492 |
+
}
|
| 493 |
+
{
|
| 494 |
+
Py_hash_t hash;
|
| 495 |
+
int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
|
| 496 |
+
// CPython does not raise errors here, only if !isinstance(iter_obj, set/frozenset)
|
| 497 |
+
assert (ret != -1);
|
| 498 |
+
if (likely(ret)) {
|
| 499 |
+
Py_INCREF(*value);
|
| 500 |
+
return 1;
|
| 501 |
+
}
|
| 502 |
+
}
|
| 503 |
+
#endif
|
| 504 |
+
return 0;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
/////////////// py_set_discard_unhashable ///////////////
|
| 508 |
+
//@requires: Builtins.c::pyfrozenset_new
|
| 509 |
+
|
| 510 |
+
static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) {
|
| 511 |
+
PyObject *tmpkey;
|
| 512 |
+
int rv;
|
| 513 |
+
|
| 514 |
+
if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)))
|
| 515 |
+
return -1;
|
| 516 |
+
PyErr_Clear();
|
| 517 |
+
tmpkey = __Pyx_PyFrozenSet_New(key);
|
| 518 |
+
if (tmpkey == NULL)
|
| 519 |
+
return -1;
|
| 520 |
+
rv = PySet_Discard(set, tmpkey);
|
| 521 |
+
Py_DECREF(tmpkey);
|
| 522 |
+
return rv;
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
|
| 526 |
+
/////////////// py_set_discard.proto ///////////////
|
| 527 |
+
|
| 528 |
+
static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key); /*proto*/
|
| 529 |
+
|
| 530 |
+
/////////////// py_set_discard ///////////////
|
| 531 |
+
//@requires: py_set_discard_unhashable
|
| 532 |
+
|
| 533 |
+
static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) {
|
| 534 |
+
int found = PySet_Discard(set, key);
|
| 535 |
+
// Convert *key* to frozenset if necessary
|
| 536 |
+
if (unlikely(found < 0)) {
|
| 537 |
+
found = __Pyx_PySet_DiscardUnhashable(set, key);
|
| 538 |
+
}
|
| 539 |
+
// note: returns -1 on error, 0 (not found) or 1 (found) otherwise => error check for -1 or < 0 works
|
| 540 |
+
return found;
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
|
| 544 |
+
/////////////// py_set_remove.proto ///////////////
|
| 545 |
+
|
| 546 |
+
static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key); /*proto*/
|
| 547 |
+
|
| 548 |
+
/////////////// py_set_remove ///////////////
|
| 549 |
+
//@requires: py_set_discard_unhashable
|
| 550 |
+
|
| 551 |
+
static int __Pyx_PySet_RemoveNotFound(PyObject *set, PyObject *key, int found) {
|
| 552 |
+
// Convert *key* to frozenset if necessary
|
| 553 |
+
if (unlikely(found < 0)) {
|
| 554 |
+
found = __Pyx_PySet_DiscardUnhashable(set, key);
|
| 555 |
+
}
|
| 556 |
+
if (likely(found == 0)) {
|
| 557 |
+
// Not found
|
| 558 |
+
PyObject *tup;
|
| 559 |
+
tup = PyTuple_Pack(1, key);
|
| 560 |
+
if (!tup)
|
| 561 |
+
return -1;
|
| 562 |
+
PyErr_SetObject(PyExc_KeyError, tup);
|
| 563 |
+
Py_DECREF(tup);
|
| 564 |
+
return -1;
|
| 565 |
+
}
|
| 566 |
+
// note: returns -1 on error, 0 (not found) or 1 (found) otherwise => error check for -1 or < 0 works
|
| 567 |
+
return found;
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key) {
|
| 571 |
+
int found = PySet_Discard(set, key);
|
| 572 |
+
if (unlikely(found != 1)) {
|
| 573 |
+
// note: returns -1 on error, 0 (not found) or 1 (found) otherwise => error check for -1 or < 0 works
|
| 574 |
+
return __Pyx_PySet_RemoveNotFound(set, key, found);
|
| 575 |
+
}
|
| 576 |
+
return 0;
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
|
| 580 |
+
/////////////// unicode_iter.proto ///////////////
|
| 581 |
+
|
| 582 |
+
static CYTHON_INLINE int __Pyx_init_unicode_iteration(
|
| 583 |
+
PyObject* ustring, Py_ssize_t *length, void** data, int *kind); /* proto */
|
| 584 |
+
|
| 585 |
+
/////////////// unicode_iter ///////////////
|
| 586 |
+
|
| 587 |
+
static CYTHON_INLINE int __Pyx_init_unicode_iteration(
|
| 588 |
+
PyObject* ustring, Py_ssize_t *length, void** data, int *kind) {
|
| 589 |
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
| 590 |
+
// In the limited API we just point data to the unicode object
|
| 591 |
+
*kind = 0;
|
| 592 |
+
*length = PyUnicode_GetLength(ustring);
|
| 593 |
+
*data = (void*)ustring;
|
| 594 |
+
#elif CYTHON_PEP393_ENABLED
|
| 595 |
+
if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1;
|
| 596 |
+
*kind = PyUnicode_KIND(ustring);
|
| 597 |
+
*length = PyUnicode_GET_LENGTH(ustring);
|
| 598 |
+
*data = PyUnicode_DATA(ustring);
|
| 599 |
+
#else
|
| 600 |
+
*kind = 0;
|
| 601 |
+
*length = PyUnicode_GET_SIZE(ustring);
|
| 602 |
+
*data = (void*)PyUnicode_AS_UNICODE(ustring);
|
| 603 |
+
#endif
|
| 604 |
+
return 0;
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
/////////////// pyobject_as_double.proto ///////////////
|
| 608 |
+
|
| 609 |
+
static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
|
| 610 |
+
|
| 611 |
+
#if CYTHON_COMPILING_IN_PYPY
|
| 612 |
+
#define __Pyx_PyObject_AsDouble(obj) \
|
| 613 |
+
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
|
| 614 |
+
likely(PyInt_CheckExact(obj)) ? \
|
| 615 |
+
PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
|
| 616 |
+
#else
|
| 617 |
+
#define __Pyx_PyObject_AsDouble(obj) \
|
| 618 |
+
((likely(PyFloat_CheckExact(obj))) ? PyFloat_AS_DOUBLE(obj) : \
|
| 619 |
+
likely(PyLong_CheckExact(obj)) ? \
|
| 620 |
+
PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
|
| 621 |
+
#endif
|
| 622 |
+
|
| 623 |
+
/////////////// pyobject_as_double ///////////////
|
| 624 |
+
//@requires: pybytes_as_double
|
| 625 |
+
//@requires: pyunicode_as_double
|
| 626 |
+
//@requires: ObjectHandling.c::PyObjectCallOneArg
|
| 627 |
+
|
| 628 |
+
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
|
| 629 |
+
if (PyUnicode_CheckExact(obj)) {
|
| 630 |
+
return __Pyx_PyUnicode_AsDouble(obj);
|
| 631 |
+
} else if (PyBytes_CheckExact(obj)) {
|
| 632 |
+
return __Pyx_PyBytes_AsDouble(obj);
|
| 633 |
+
} else if (PyByteArray_CheckExact(obj)) {
|
| 634 |
+
return __Pyx_PyByteArray_AsDouble(obj);
|
| 635 |
+
} else {
|
| 636 |
+
PyObject* float_value;
|
| 637 |
+
#if !CYTHON_USE_TYPE_SLOTS
|
| 638 |
+
float_value = PyNumber_Float(obj); if ((0)) goto bad;
|
| 639 |
+
// avoid "unused" warnings
|
| 640 |
+
(void)__Pyx_PyObject_CallOneArg;
|
| 641 |
+
#else
|
| 642 |
+
PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
|
| 643 |
+
if (likely(nb) && likely(nb->nb_float)) {
|
| 644 |
+
float_value = nb->nb_float(obj);
|
| 645 |
+
if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
|
| 646 |
+
__Pyx_TypeName float_value_type_name = __Pyx_PyType_GetName(Py_TYPE(float_value));
|
| 647 |
+
PyErr_Format(PyExc_TypeError,
|
| 648 |
+
"__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
|
| 649 |
+
float_value_type_name);
|
| 650 |
+
__Pyx_DECREF_TypeName(float_value_type_name);
|
| 651 |
+
Py_DECREF(float_value);
|
| 652 |
+
goto bad;
|
| 653 |
+
}
|
| 654 |
+
} else {
|
| 655 |
+
float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
|
| 656 |
+
}
|
| 657 |
+
#endif
|
| 658 |
+
if (likely(float_value)) {
|
| 659 |
+
double value = PyFloat_AS_DOUBLE(float_value);
|
| 660 |
+
Py_DECREF(float_value);
|
| 661 |
+
return value;
|
| 662 |
+
}
|
| 663 |
+
}
|
| 664 |
+
bad:
|
| 665 |
+
return (double)-1;
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
|
| 669 |
+
/////////////// pystring_as_double.proto ///////////////
|
| 670 |
+
//@requires: pyunicode_as_double
|
| 671 |
+
//@requires: pybytes_as_double
|
| 672 |
+
|
| 673 |
+
static CYTHON_INLINE double __Pyx_PyString_AsDouble(PyObject *obj) {
|
| 674 |
+
#if PY_MAJOR_VERSION >= 3
|
| 675 |
+
(void)__Pyx_PyBytes_AsDouble;
|
| 676 |
+
return __Pyx_PyUnicode_AsDouble(obj);
|
| 677 |
+
#else
|
| 678 |
+
(void)__Pyx_PyUnicode_AsDouble;
|
| 679 |
+
return __Pyx_PyBytes_AsDouble(obj);
|
| 680 |
+
#endif
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
|
| 684 |
+
/////////////// pyunicode_as_double.proto ///////////////
|
| 685 |
+
|
| 686 |
+
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj);/*proto*/
|
| 687 |
+
|
| 688 |
+
/////////////// pyunicode_as_double.proto ///////////////
|
| 689 |
+
//@requires: pybytes_as_double
|
| 690 |
+
|
| 691 |
+
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
|
| 692 |
+
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
|
| 693 |
+
int last_was_punctuation;
|
| 694 |
+
Py_ssize_t i;
|
| 695 |
+
// number must not start with punctuation
|
| 696 |
+
last_was_punctuation = 1;
|
| 697 |
+
for (i=start; i <= end; i++) {
|
| 698 |
+
Py_UCS4 chr = PyUnicode_READ(kind, data, i);
|
| 699 |
+
int is_punctuation = (chr == '_') | (chr == '.');
|
| 700 |
+
*buffer = (char)chr;
|
| 701 |
+
// reject sequences of '_' and '.'
|
| 702 |
+
buffer += (chr != '_');
|
| 703 |
+
if (unlikely(chr > 127)) goto parse_failure;
|
| 704 |
+
if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
|
| 705 |
+
last_was_punctuation = is_punctuation;
|
| 706 |
+
}
|
| 707 |
+
if (unlikely(last_was_punctuation)) goto parse_failure;
|
| 708 |
+
*buffer = '\0';
|
| 709 |
+
return buffer;
|
| 710 |
+
|
| 711 |
+
parse_failure:
|
| 712 |
+
return NULL;
|
| 713 |
+
}
|
| 714 |
+
|
| 715 |
+
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
|
| 716 |
+
int matches = 1;
|
| 717 |
+
Py_UCS4 chr;
|
| 718 |
+
Py_UCS4 sign = PyUnicode_READ(kind, data, start);
|
| 719 |
+
int is_signed = (sign == '-') | (sign == '+');
|
| 720 |
+
start += is_signed;
|
| 721 |
+
length -= is_signed;
|
| 722 |
+
|
| 723 |
+
switch (PyUnicode_READ(kind, data, start)) {
|
| 724 |
+
#ifdef Py_NAN
|
| 725 |
+
case 'n':
|
| 726 |
+
case 'N':
|
| 727 |
+
if (unlikely(length != 3)) goto parse_failure;
|
| 728 |
+
chr = PyUnicode_READ(kind, data, start+1);
|
| 729 |
+
matches &= (chr == 'a') | (chr == 'A');
|
| 730 |
+
chr = PyUnicode_READ(kind, data, start+2);
|
| 731 |
+
matches &= (chr == 'n') | (chr == 'N');
|
| 732 |
+
if (unlikely(!matches)) goto parse_failure;
|
| 733 |
+
return (sign == '-') ? -Py_NAN : Py_NAN;
|
| 734 |
+
#endif
|
| 735 |
+
case 'i':
|
| 736 |
+
case 'I':
|
| 737 |
+
if (unlikely(length < 3)) goto parse_failure;
|
| 738 |
+
chr = PyUnicode_READ(kind, data, start+1);
|
| 739 |
+
matches &= (chr == 'n') | (chr == 'N');
|
| 740 |
+
chr = PyUnicode_READ(kind, data, start+2);
|
| 741 |
+
matches &= (chr == 'f') | (chr == 'F');
|
| 742 |
+
if (likely(length == 3 && matches))
|
| 743 |
+
return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
|
| 744 |
+
if (unlikely(length != 8)) goto parse_failure;
|
| 745 |
+
chr = PyUnicode_READ(kind, data, start+3);
|
| 746 |
+
matches &= (chr == 'i') | (chr == 'I');
|
| 747 |
+
chr = PyUnicode_READ(kind, data, start+4);
|
| 748 |
+
matches &= (chr == 'n') | (chr == 'N');
|
| 749 |
+
chr = PyUnicode_READ(kind, data, start+5);
|
| 750 |
+
matches &= (chr == 'i') | (chr == 'I');
|
| 751 |
+
chr = PyUnicode_READ(kind, data, start+6);
|
| 752 |
+
matches &= (chr == 't') | (chr == 'T');
|
| 753 |
+
chr = PyUnicode_READ(kind, data, start+7);
|
| 754 |
+
matches &= (chr == 'y') | (chr == 'Y');
|
| 755 |
+
if (unlikely(!matches)) goto parse_failure;
|
| 756 |
+
return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
|
| 757 |
+
case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
|
| 758 |
+
break;
|
| 759 |
+
default:
|
| 760 |
+
goto parse_failure;
|
| 761 |
+
}
|
| 762 |
+
return 0.0;
|
| 763 |
+
parse_failure:
|
| 764 |
+
return -1.0;
|
| 765 |
+
}
|
| 766 |
+
|
| 767 |
+
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
|
| 768 |
+
double value;
|
| 769 |
+
const char *last;
|
| 770 |
+
char *end;
|
| 771 |
+
Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
|
| 772 |
+
const int kind = PyUnicode_KIND(obj);
|
| 773 |
+
const void* data = PyUnicode_DATA(obj);
|
| 774 |
+
|
| 775 |
+
// strip spaces at start and end
|
| 776 |
+
start = 0;
|
| 777 |
+
while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
|
| 778 |
+
start++;
|
| 779 |
+
while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
|
| 780 |
+
length--;
|
| 781 |
+
length -= start;
|
| 782 |
+
if (unlikely(length <= 0)) goto fallback;
|
| 783 |
+
|
| 784 |
+
// parse NaN / inf
|
| 785 |
+
value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
|
| 786 |
+
if (unlikely(value == -1.0)) goto fallback;
|
| 787 |
+
if (value != 0.0) return value;
|
| 788 |
+
|
| 789 |
+
if (length < 40) {
|
| 790 |
+
char number[40];
|
| 791 |
+
last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
|
| 792 |
+
if (unlikely(!last)) goto fallback;
|
| 793 |
+
value = PyOS_string_to_double(number, &end, NULL);
|
| 794 |
+
} else {
|
| 795 |
+
char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
|
| 796 |
+
if (unlikely(!number)) goto fallback;
|
| 797 |
+
last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
|
| 798 |
+
if (unlikely(!last)) {
|
| 799 |
+
PyMem_Free(number);
|
| 800 |
+
goto fallback;
|
| 801 |
+
}
|
| 802 |
+
value = PyOS_string_to_double(number, &end, NULL);
|
| 803 |
+
PyMem_Free(number);
|
| 804 |
+
}
|
| 805 |
+
if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
|
| 806 |
+
return value;
|
| 807 |
+
}
|
| 808 |
+
fallback:
|
| 809 |
+
return __Pyx_SlowPyString_AsDouble(obj);
|
| 810 |
+
}
|
| 811 |
+
#endif
|
| 812 |
+
|
| 813 |
+
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
|
| 814 |
+
// Currently not optimised for Py2.7.
|
| 815 |
+
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
|
| 816 |
+
if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
|
| 817 |
+
return (double)-1;
|
| 818 |
+
if (likely(PyUnicode_IS_ASCII(obj))) {
|
| 819 |
+
const char *s;
|
| 820 |
+
Py_ssize_t length;
|
| 821 |
+
s = PyUnicode_AsUTF8AndSize(obj, &length);
|
| 822 |
+
return __Pyx__PyBytes_AsDouble(obj, s, length);
|
| 823 |
+
}
|
| 824 |
+
return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
|
| 825 |
+
#else
|
| 826 |
+
return __Pyx_SlowPyString_AsDouble(obj);
|
| 827 |
+
#endif
|
| 828 |
+
}
|
| 829 |
+
|
| 830 |
+
|
| 831 |
+
/////////////// pybytes_as_double.proto ///////////////
|
| 832 |
+
|
| 833 |
+
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);/*proto*/
|
| 834 |
+
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);/*proto*/
|
| 835 |
+
|
| 836 |
+
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
|
| 837 |
+
char* as_c_string;
|
| 838 |
+
Py_ssize_t size;
|
| 839 |
+
#if CYTHON_ASSUME_SAFE_MACROS
|
| 840 |
+
as_c_string = PyBytes_AS_STRING(obj);
|
| 841 |
+
size = PyBytes_GET_SIZE(obj);
|
| 842 |
+
#else
|
| 843 |
+
if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
|
| 844 |
+
return (double)-1;
|
| 845 |
+
}
|
| 846 |
+
#endif
|
| 847 |
+
return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
|
| 848 |
+
}
|
| 849 |
+
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
|
| 850 |
+
char* as_c_string;
|
| 851 |
+
Py_ssize_t size;
|
| 852 |
+
#if CYTHON_ASSUME_SAFE_MACROS
|
| 853 |
+
as_c_string = PyByteArray_AS_STRING(obj);
|
| 854 |
+
size = PyByteArray_GET_SIZE(obj);
|
| 855 |
+
#else
|
| 856 |
+
as_c_string = PyByteArray_AsString(obj);
|
| 857 |
+
if (as_c_string == NULL) {
|
| 858 |
+
return (double)-1;
|
| 859 |
+
}
|
| 860 |
+
size = PyByteArray_Size(obj);
|
| 861 |
+
#endif
|
| 862 |
+
return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
|
| 863 |
+
}
|
| 864 |
+
|
| 865 |
+
|
| 866 |
+
/////////////// pybytes_as_double ///////////////
|
| 867 |
+
|
| 868 |
+
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
|
| 869 |
+
PyObject *float_value;
|
| 870 |
+
#if PY_MAJOR_VERSION >= 3
|
| 871 |
+
float_value = PyFloat_FromString(obj);
|
| 872 |
+
#else
|
| 873 |
+
float_value = PyFloat_FromString(obj, 0);
|
| 874 |
+
#endif
|
| 875 |
+
if (likely(float_value)) {
|
| 876 |
+
#if CYTHON_ASSUME_SAFE_MACROS
|
| 877 |
+
double value = PyFloat_AS_DOUBLE(float_value);
|
| 878 |
+
#else
|
| 879 |
+
double value = PyFloat_AsDouble(float_value);
|
| 880 |
+
#endif
|
| 881 |
+
Py_DECREF(float_value);
|
| 882 |
+
return value;
|
| 883 |
+
}
|
| 884 |
+
return (double)-1;
|
| 885 |
+
}
|
| 886 |
+
|
| 887 |
+
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
|
| 888 |
+
// number must not start with punctuation
|
| 889 |
+
int last_was_punctuation = 1;
|
| 890 |
+
Py_ssize_t i;
|
| 891 |
+
for (i=0; i < length; i++) {
|
| 892 |
+
char chr = start[i];
|
| 893 |
+
int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
|
| 894 |
+
*buffer = chr;
|
| 895 |
+
buffer += (chr != '_');
|
| 896 |
+
// reject sequences of '_' and '.'
|
| 897 |
+
if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
|
| 898 |
+
last_was_punctuation = is_punctuation;
|
| 899 |
+
}
|
| 900 |
+
if (unlikely(last_was_punctuation)) goto parse_failure;
|
| 901 |
+
*buffer = '\0';
|
| 902 |
+
return buffer;
|
| 903 |
+
|
| 904 |
+
parse_failure:
|
| 905 |
+
return NULL;
|
| 906 |
+
}
|
| 907 |
+
|
| 908 |
+
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
|
| 909 |
+
int matches = 1;
|
| 910 |
+
char sign = start[0];
|
| 911 |
+
int is_signed = (sign == '+') | (sign == '-');
|
| 912 |
+
start += is_signed;
|
| 913 |
+
length -= is_signed;
|
| 914 |
+
|
| 915 |
+
switch (start[0]) {
|
| 916 |
+
#ifdef Py_NAN
|
| 917 |
+
case 'n':
|
| 918 |
+
case 'N':
|
| 919 |
+
if (unlikely(length != 3)) goto parse_failure;
|
| 920 |
+
matches &= (start[1] == 'a' || start[1] == 'A');
|
| 921 |
+
matches &= (start[2] == 'n' || start[2] == 'N');
|
| 922 |
+
if (unlikely(!matches)) goto parse_failure;
|
| 923 |
+
return (sign == '-') ? -Py_NAN : Py_NAN;
|
| 924 |
+
#endif
|
| 925 |
+
case 'i':
|
| 926 |
+
case 'I':
|
| 927 |
+
if (unlikely(length < 3)) goto parse_failure;
|
| 928 |
+
matches &= (start[1] == 'n' || start[1] == 'N');
|
| 929 |
+
matches &= (start[2] == 'f' || start[2] == 'F');
|
| 930 |
+
if (likely(length == 3 && matches))
|
| 931 |
+
return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
|
| 932 |
+
if (unlikely(length != 8)) goto parse_failure;
|
| 933 |
+
matches &= (start[3] == 'i' || start[3] == 'I');
|
| 934 |
+
matches &= (start[4] == 'n' || start[4] == 'N');
|
| 935 |
+
matches &= (start[5] == 'i' || start[5] == 'I');
|
| 936 |
+
matches &= (start[6] == 't' || start[6] == 'T');
|
| 937 |
+
matches &= (start[7] == 'y' || start[7] == 'Y');
|
| 938 |
+
if (unlikely(!matches)) goto parse_failure;
|
| 939 |
+
return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
|
| 940 |
+
case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
|
| 941 |
+
break;
|
| 942 |
+
default:
|
| 943 |
+
goto parse_failure;
|
| 944 |
+
}
|
| 945 |
+
return 0.0;
|
| 946 |
+
parse_failure:
|
| 947 |
+
return -1.0;
|
| 948 |
+
}
|
| 949 |
+
|
| 950 |
+
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
|
| 951 |
+
// see Py_ISSPACE() in CPython
|
| 952 |
+
// https://github.com/python/cpython/blob/master/Python/pyctype.c
|
| 953 |
+
return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
|
| 954 |
+
}
|
| 955 |
+
|
| 956 |
+
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
|
| 957 |
+
double value;
|
| 958 |
+
Py_ssize_t i, digits;
|
| 959 |
+
const char *last = start + length;
|
| 960 |
+
char *end;
|
| 961 |
+
|
| 962 |
+
// strip spaces at start and end
|
| 963 |
+
while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
|
| 964 |
+
start++;
|
| 965 |
+
while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
|
| 966 |
+
last--;
|
| 967 |
+
length = last - start;
|
| 968 |
+
if (unlikely(length <= 0)) goto fallback;
|
| 969 |
+
|
| 970 |
+
// parse NaN / inf
|
| 971 |
+
value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
|
| 972 |
+
if (unlikely(value == -1.0)) goto fallback;
|
| 973 |
+
if (value != 0.0) return value;
|
| 974 |
+
|
| 975 |
+
// look for underscores
|
| 976 |
+
digits = 0;
|
| 977 |
+
for (i=0; i < length; digits += start[i++] != '_');
|
| 978 |
+
|
| 979 |
+
if (likely(digits == length)) {
|
| 980 |
+
value = PyOS_string_to_double(start, &end, NULL);
|
| 981 |
+
} else if (digits < 40) {
|
| 982 |
+
char number[40];
|
| 983 |
+
last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
|
| 984 |
+
if (unlikely(!last)) goto fallback;
|
| 985 |
+
value = PyOS_string_to_double(number, &end, NULL);
|
| 986 |
+
} else {
|
| 987 |
+
char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
|
| 988 |
+
if (unlikely(!number)) goto fallback;
|
| 989 |
+
last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
|
| 990 |
+
if (unlikely(!last)) {
|
| 991 |
+
PyMem_Free(number);
|
| 992 |
+
goto fallback;
|
| 993 |
+
}
|
| 994 |
+
value = PyOS_string_to_double(number, &end, NULL);
|
| 995 |
+
PyMem_Free(number);
|
| 996 |
+
}
|
| 997 |
+
if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
|
| 998 |
+
return value;
|
| 999 |
+
}
|
| 1000 |
+
fallback:
|
| 1001 |
+
return __Pyx_SlowPyString_AsDouble(obj);
|
| 1002 |
+
}
|
| 1003 |
+
|
| 1004 |
+
|
| 1005 |
+
/////////////// PyNumberPow2.proto ///////////////
|
| 1006 |
+
|
| 1007 |
+
#define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1)
|
| 1008 |
+
#define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0)
|
| 1009 |
+
|
| 1010 |
+
static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace); /*proto*/
|
| 1011 |
+
|
| 1012 |
+
/////////////// PyNumberPow2 ///////////////
|
| 1013 |
+
|
| 1014 |
+
static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) {
|
| 1015 |
+
// in CPython, 1<<N is substantially faster than 2**N
|
| 1016 |
+
// see https://bugs.python.org/issue21420
|
| 1017 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 1018 |
+
Py_ssize_t shiftby;
|
| 1019 |
+
#if PY_MAJOR_VERSION < 3
|
| 1020 |
+
if (likely(PyInt_CheckExact(exp))) {
|
| 1021 |
+
shiftby = PyInt_AS_LONG(exp);
|
| 1022 |
+
} else
|
| 1023 |
+
#endif
|
| 1024 |
+
if (likely(PyLong_CheckExact(exp))) {
|
| 1025 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1026 |
+
if (__Pyx_PyLong_IsZero(exp)) {
|
| 1027 |
+
return PyInt_FromLong(1L);
|
| 1028 |
+
} else if (__Pyx_PyLong_IsNeg(exp)) {
|
| 1029 |
+
goto fallback;
|
| 1030 |
+
} else if (__Pyx_PyLong_IsCompact(exp)) {
|
| 1031 |
+
shiftby = __Pyx_PyLong_CompactValueUnsigned(exp);
|
| 1032 |
+
} else {
|
| 1033 |
+
shiftby = PyLong_AsSsize_t(exp);
|
| 1034 |
+
}
|
| 1035 |
+
#else
|
| 1036 |
+
shiftby = PyLong_AsSsize_t(exp);
|
| 1037 |
+
#endif
|
| 1038 |
+
} else {
|
| 1039 |
+
goto fallback;
|
| 1040 |
+
}
|
| 1041 |
+
if (likely(shiftby >= 0)) {
|
| 1042 |
+
if ((size_t)shiftby <= sizeof(long) * 8 - 2) {
|
| 1043 |
+
long value = 1L << shiftby;
|
| 1044 |
+
return PyInt_FromLong(value);
|
| 1045 |
+
#ifdef HAVE_LONG_LONG
|
| 1046 |
+
} else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) {
|
| 1047 |
+
unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby;
|
| 1048 |
+
return PyLong_FromUnsignedLongLong(value);
|
| 1049 |
+
#endif
|
| 1050 |
+
} else {
|
| 1051 |
+
PyObject *result, *one = PyInt_FromLong(1L);
|
| 1052 |
+
if (unlikely(!one)) return NULL;
|
| 1053 |
+
result = PyNumber_Lshift(one, exp);
|
| 1054 |
+
Py_DECREF(one);
|
| 1055 |
+
return result;
|
| 1056 |
+
}
|
| 1057 |
+
} else if (shiftby == -1 && PyErr_Occurred()) {
|
| 1058 |
+
PyErr_Clear();
|
| 1059 |
+
}
|
| 1060 |
+
fallback:
|
| 1061 |
+
#endif
|
| 1062 |
+
return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none);
|
| 1063 |
+
}
|
| 1064 |
+
|
| 1065 |
+
|
| 1066 |
+
/////////////// PyIntCompare.proto ///////////////
|
| 1067 |
+
|
| 1068 |
+
{{py: c_ret_type = 'PyObject*' if ret_type.is_pyobject else 'int'}}
|
| 1069 |
+
static CYTHON_INLINE {{c_ret_type}} __Pyx_PyInt_{{'' if ret_type.is_pyobject else 'Bool'}}{{op}}{{order}}(PyObject *op1, PyObject *op2, long intval, long inplace); /*proto*/
|
| 1070 |
+
|
| 1071 |
+
/////////////// PyIntCompare ///////////////
|
| 1072 |
+
|
| 1073 |
+
{{py: pyval, ival = ('op2', 'b') if order == 'CObj' else ('op1', 'a') }}
|
| 1074 |
+
{{py: c_ret_type = 'PyObject*' if ret_type.is_pyobject else 'int'}}
|
| 1075 |
+
{{py: return_true = 'Py_RETURN_TRUE' if ret_type.is_pyobject else 'return 1'}}
|
| 1076 |
+
{{py: return_false = 'Py_RETURN_FALSE' if ret_type.is_pyobject else 'return 0'}}
|
| 1077 |
+
{{py: slot_name = op.lower() }}
|
| 1078 |
+
{{py: c_op = {'Eq': '==', 'Ne': '!='}[op] }}
|
| 1079 |
+
{{py:
|
| 1080 |
+
return_compare = (
|
| 1081 |
+
(lambda a,b,c_op, return_true=return_true, return_false=return_false: "if ({a} {c_op} {b}) {return_true}; else {return_false};".format(
|
| 1082 |
+
a=a, b=b, c_op=c_op, return_true=return_true, return_false=return_false))
|
| 1083 |
+
if ret_type.is_pyobject else
|
| 1084 |
+
(lambda a,b,c_op: "return ({a} {c_op} {b});".format(a=a, b=b, c_op=c_op))
|
| 1085 |
+
)
|
| 1086 |
+
}}
|
| 1087 |
+
|
| 1088 |
+
static CYTHON_INLINE {{c_ret_type}} __Pyx_PyInt_{{'' if ret_type.is_pyobject else 'Bool'}}{{op}}{{order}}(PyObject *op1, PyObject *op2, long intval, long inplace) {
|
| 1089 |
+
CYTHON_MAYBE_UNUSED_VAR(intval);
|
| 1090 |
+
CYTHON_UNUSED_VAR(inplace);
|
| 1091 |
+
if (op1 == op2) {
|
| 1092 |
+
{{return_true if op == 'Eq' else return_false}};
|
| 1093 |
+
}
|
| 1094 |
+
|
| 1095 |
+
#if PY_MAJOR_VERSION < 3
|
| 1096 |
+
if (likely(PyInt_CheckExact({{pyval}}))) {
|
| 1097 |
+
const long {{'a' if order == 'CObj' else 'b'}} = intval;
|
| 1098 |
+
long {{ival}} = PyInt_AS_LONG({{pyval}});
|
| 1099 |
+
{{return_compare('a', 'b', c_op)}}
|
| 1100 |
+
}
|
| 1101 |
+
#endif
|
| 1102 |
+
|
| 1103 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1104 |
+
if (likely(PyLong_CheckExact({{pyval}}))) {
|
| 1105 |
+
int unequal;
|
| 1106 |
+
unsigned long uintval;
|
| 1107 |
+
Py_ssize_t size = __Pyx_PyLong_DigitCount({{pyval}});
|
| 1108 |
+
const digit* digits = __Pyx_PyLong_Digits({{pyval}});
|
| 1109 |
+
if (intval == 0) {
|
| 1110 |
+
{{return_compare('__Pyx_PyLong_IsZero(%s)' % pyval, '1', c_op)}}
|
| 1111 |
+
} else if (intval < 0) {
|
| 1112 |
+
if (__Pyx_PyLong_IsNonNeg({{pyval}}))
|
| 1113 |
+
{{return_false if op == 'Eq' else return_true}};
|
| 1114 |
+
// both are negative => can use absolute values now.
|
| 1115 |
+
intval = -intval;
|
| 1116 |
+
} else {
|
| 1117 |
+
// > 0 => Py_SIZE(pyval) > 0
|
| 1118 |
+
if (__Pyx_PyLong_IsNeg({{pyval}}))
|
| 1119 |
+
{{return_false if op == 'Eq' else return_true}};
|
| 1120 |
+
}
|
| 1121 |
+
// After checking that the sign is the same (and excluding 0), now compare the absolute values.
|
| 1122 |
+
// When inlining, the C compiler should select exactly one line from this unrolled loop.
|
| 1123 |
+
uintval = (unsigned long) intval;
|
| 1124 |
+
{{for _size in range(4, 0, -1)}}
|
| 1125 |
+
#if PyLong_SHIFT * {{_size}} < SIZEOF_LONG*8
|
| 1126 |
+
if (uintval >> (PyLong_SHIFT * {{_size}})) {
|
| 1127 |
+
// The C integer value is between (PyLong_BASE ** _size) and MIN(PyLong_BASE ** _size, LONG_MAX).
|
| 1128 |
+
unequal = (size != {{_size+1}}) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
|
| 1129 |
+
{{for _i in range(1, _size+1)}} | (digits[{{_i}}] != ((uintval >> ({{_i}} * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)){{endfor}};
|
| 1130 |
+
} else
|
| 1131 |
+
#endif
|
| 1132 |
+
{{endfor}}
|
| 1133 |
+
unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
|
| 1134 |
+
|
| 1135 |
+
{{return_compare('unequal', '0', c_op)}}
|
| 1136 |
+
}
|
| 1137 |
+
#endif
|
| 1138 |
+
|
| 1139 |
+
if (PyFloat_CheckExact({{pyval}})) {
|
| 1140 |
+
const long {{'a' if order == 'CObj' else 'b'}} = intval;
|
| 1141 |
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
| 1142 |
+
double {{ival}} = __pyx_PyFloat_AsDouble({{pyval}});
|
| 1143 |
+
#else
|
| 1144 |
+
double {{ival}} = PyFloat_AS_DOUBLE({{pyval}});
|
| 1145 |
+
#endif
|
| 1146 |
+
{{return_compare('(double)a', '(double)b', c_op)}}
|
| 1147 |
+
}
|
| 1148 |
+
|
| 1149 |
+
return {{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(
|
| 1150 |
+
PyObject_RichCompare(op1, op2, Py_{{op.upper()}}));
|
| 1151 |
+
}
|
| 1152 |
+
|
| 1153 |
+
|
| 1154 |
+
/////////////// PyIntBinop.proto ///////////////
|
| 1155 |
+
|
| 1156 |
+
{{py: c_ret_type = 'PyObject*' if ret_type.is_pyobject else 'int'}}
|
| 1157 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 1158 |
+
static {{c_ret_type}} __Pyx_PyInt_{{'' if ret_type.is_pyobject else 'Bool'}}{{op}}{{order}}(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); /*proto*/
|
| 1159 |
+
#else
|
| 1160 |
+
#define __Pyx_PyInt_{{'' if ret_type.is_pyobject else 'Bool'}}{{op}}{{order}}(op1, op2, intval, inplace, zerodivision_check) \
|
| 1161 |
+
{{if op in ('Eq', 'Ne')}}{{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(PyObject_RichCompare(op1, op2, Py_{{op.upper()}}))
|
| 1162 |
+
{{else}}(inplace ? PyNumber_InPlace{{op}}(op1, op2) : PyNumber_{{op}}(op1, op2))
|
| 1163 |
+
{{endif}}
|
| 1164 |
+
#endif
|
| 1165 |
+
|
| 1166 |
+
/////////////// PyIntBinop ///////////////
|
| 1167 |
+
|
| 1168 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 1169 |
+
{{py: from Cython.Utility import pylong_join }}
|
| 1170 |
+
{{py: pyval, ival = ('op2', 'b') if order == 'CObj' else ('op1', 'a') }}
|
| 1171 |
+
{{py: c_ret_type = 'PyObject*' if ret_type.is_pyobject else 'int'}}
|
| 1172 |
+
{{py: return_true = 'Py_RETURN_TRUE' if ret_type.is_pyobject else 'return 1'}}
|
| 1173 |
+
{{py: return_false = 'Py_RETURN_FALSE' if ret_type.is_pyobject else 'return 0'}}
|
| 1174 |
+
{{py: slot_name = {'TrueDivide': 'true_divide', 'FloorDivide': 'floor_divide'}.get(op, op.lower()) }}
|
| 1175 |
+
{{py: cfunc_name = '__Pyx_PyInt_%s%s%s' % ('' if ret_type.is_pyobject else 'Bool', op, order)}}
|
| 1176 |
+
{{py:
|
| 1177 |
+
c_op = {
|
| 1178 |
+
'Add': '+', 'Subtract': '-', 'Multiply': '*', 'Remainder': '%', 'TrueDivide': '/', 'FloorDivide': '/',
|
| 1179 |
+
'Or': '|', 'Xor': '^', 'And': '&', 'Rshift': '>>', 'Lshift': '<<',
|
| 1180 |
+
'Eq': '==', 'Ne': '!=',
|
| 1181 |
+
}[op]
|
| 1182 |
+
}}
|
| 1183 |
+
{{py:
|
| 1184 |
+
def zerodiv_check(operand, optype='integer', _is_mod=op == 'Remainder', _needs_check=(order == 'CObj' and c_op in '%/')):
|
| 1185 |
+
return (((
|
| 1186 |
+
'if (unlikely(zerodivision_check && ((%s) == 0))) {'
|
| 1187 |
+
' PyErr_SetString(PyExc_ZeroDivisionError, "%s division%s by zero");'
|
| 1188 |
+
' return NULL;'
|
| 1189 |
+
'}') % (operand, optype, ' or modulo' if _is_mod else '')
|
| 1190 |
+
) if _needs_check else '')
|
| 1191 |
+
}}
|
| 1192 |
+
|
| 1193 |
+
static {{c_ret_type}} {{cfunc_name}}(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
|
| 1194 |
+
CYTHON_MAYBE_UNUSED_VAR(intval);
|
| 1195 |
+
CYTHON_MAYBE_UNUSED_VAR(inplace);
|
| 1196 |
+
CYTHON_UNUSED_VAR(zerodivision_check);
|
| 1197 |
+
|
| 1198 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1199 |
+
if (op1 == op2) {
|
| 1200 |
+
{{return_true if op == 'Eq' else return_false}};
|
| 1201 |
+
}
|
| 1202 |
+
{{endif}}
|
| 1203 |
+
|
| 1204 |
+
#if PY_MAJOR_VERSION < 3
|
| 1205 |
+
if (likely(PyInt_CheckExact({{pyval}}))) {
|
| 1206 |
+
const long {{'a' if order == 'CObj' else 'b'}} = intval;
|
| 1207 |
+
{{if c_op in '+-%' or op == 'FloorDivide'}}
|
| 1208 |
+
long x;
|
| 1209 |
+
{{endif}}
|
| 1210 |
+
long {{ival}} = PyInt_AS_LONG({{pyval}});
|
| 1211 |
+
{{zerodiv_check('b')}}
|
| 1212 |
+
|
| 1213 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1214 |
+
if (a {{c_op}} b) {
|
| 1215 |
+
{{return_true}};
|
| 1216 |
+
} else {
|
| 1217 |
+
{{return_false}};
|
| 1218 |
+
}
|
| 1219 |
+
{{elif c_op in '+-'}}
|
| 1220 |
+
// adapted from intobject.c in Py2.7:
|
| 1221 |
+
// casts in the line below avoid undefined behaviour on overflow
|
| 1222 |
+
x = (long)((unsigned long)a {{c_op}} (unsigned long)b);
|
| 1223 |
+
if (likely((x^a) >= 0 || (x^{{ '~' if op == 'Subtract' else '' }}b) >= 0))
|
| 1224 |
+
return PyInt_FromLong(x);
|
| 1225 |
+
return PyLong_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1226 |
+
{{elif c_op == '%'}}
|
| 1227 |
+
// see CMath.c :: ModInt utility code
|
| 1228 |
+
x = a % b;
|
| 1229 |
+
x += ((x != 0) & ((x ^ b) < 0)) * b;
|
| 1230 |
+
return PyInt_FromLong(x);
|
| 1231 |
+
{{elif op == 'TrueDivide'}}
|
| 1232 |
+
if (8 * sizeof(long) <= 53 || likely(labs({{ival}}) <= ((PY_LONG_LONG)1 << 53))) {
|
| 1233 |
+
return PyFloat_FromDouble((double)a / (double)b);
|
| 1234 |
+
}
|
| 1235 |
+
// let Python do the rounding
|
| 1236 |
+
return PyInt_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1237 |
+
{{elif op == 'FloorDivide'}}
|
| 1238 |
+
// INT_MIN / -1 is the only case that overflows
|
| 1239 |
+
if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
|
| 1240 |
+
return PyInt_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1241 |
+
else {
|
| 1242 |
+
long q, r;
|
| 1243 |
+
// see CMath.c :: DivInt utility code
|
| 1244 |
+
q = a / b;
|
| 1245 |
+
r = a - q*b;
|
| 1246 |
+
q -= ((r != 0) & ((r ^ b) < 0));
|
| 1247 |
+
x = q;
|
| 1248 |
+
}
|
| 1249 |
+
return PyInt_FromLong(x);
|
| 1250 |
+
{{elif op == 'Lshift'}}
|
| 1251 |
+
if (likely(b < (long) (sizeof(long)*8) && a == (a << b) >> b) || !a) {
|
| 1252 |
+
return PyInt_FromLong(a {{c_op}} b);
|
| 1253 |
+
}
|
| 1254 |
+
{{elif c_op == '*'}}
|
| 1255 |
+
#ifdef HAVE_LONG_LONG
|
| 1256 |
+
if (sizeof(PY_LONG_LONG) > sizeof(long)) {
|
| 1257 |
+
PY_LONG_LONG result = (PY_LONG_LONG)a {{c_op}} (PY_LONG_LONG)b;
|
| 1258 |
+
return (result >= LONG_MIN && result <= LONG_MAX) ?
|
| 1259 |
+
PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
|
| 1260 |
+
}
|
| 1261 |
+
#endif
|
| 1262 |
+
#if CYTHON_USE_TYPE_SLOTS
|
| 1263 |
+
return PyInt_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1264 |
+
#else
|
| 1265 |
+
return PyNumber_{{op}}(op1, op2);
|
| 1266 |
+
#endif
|
| 1267 |
+
{{else}}
|
| 1268 |
+
// other operations are safe, no overflow
|
| 1269 |
+
return PyInt_FromLong(a {{c_op}} b);
|
| 1270 |
+
{{endif}}
|
| 1271 |
+
}
|
| 1272 |
+
#endif
|
| 1273 |
+
|
| 1274 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1275 |
+
if (likely(PyLong_CheckExact({{pyval}}))) {
|
| 1276 |
+
const long {{'a' if order == 'CObj' else 'b'}} = intval;
|
| 1277 |
+
long {{ival}}{{if op not in ('Eq', 'Ne')}}, x{{endif}};
|
| 1278 |
+
{{if op not in ('Eq', 'Ne', 'TrueDivide')}}
|
| 1279 |
+
#ifdef HAVE_LONG_LONG
|
| 1280 |
+
const PY_LONG_LONG ll{{'a' if order == 'CObj' else 'b'}} = intval;
|
| 1281 |
+
PY_LONG_LONG ll{{ival}}, llx;
|
| 1282 |
+
#endif
|
| 1283 |
+
{{endif}}
|
| 1284 |
+
{{if c_op == '&'}}
|
| 1285 |
+
// special case for &-ing arbitrarily large numbers with known single digit operands
|
| 1286 |
+
if ((intval & PyLong_MASK) == intval) {
|
| 1287 |
+
// Calling PyLong_CompactValue() requires the PyLong value to be compact, we only need the last digit.
|
| 1288 |
+
long last_digit = (long) __Pyx_PyLong_Digits({{pyval}})[0];
|
| 1289 |
+
long result = intval & (likely(__Pyx_PyLong_IsPos({{pyval}})) ? last_digit : (PyLong_MASK - last_digit + 1));
|
| 1290 |
+
return PyLong_FromLong(result);
|
| 1291 |
+
}
|
| 1292 |
+
{{endif}}
|
| 1293 |
+
// special cases for 0: + - * % / // | ^ & >> <<
|
| 1294 |
+
if (unlikely(__Pyx_PyLong_IsZero({{pyval}}))) {
|
| 1295 |
+
{{if order == 'CObj' and c_op in '%/'}}
|
| 1296 |
+
// division by zero!
|
| 1297 |
+
{{zerodiv_check('0')}}
|
| 1298 |
+
{{elif order == 'CObj' and c_op in '+-|^>><<'}}
|
| 1299 |
+
// x == x+0 == x-0 == x|0 == x^0 == x>>0 == x<<0
|
| 1300 |
+
return __Pyx_NewRef(op1);
|
| 1301 |
+
{{elif order == 'CObj' and c_op in '*&'}}
|
| 1302 |
+
// 0 == x*0 == x&0
|
| 1303 |
+
return __Pyx_NewRef(op2);
|
| 1304 |
+
{{elif order == 'ObjC' and c_op in '+|^'}}
|
| 1305 |
+
// x == 0+x == 0|x == 0^x
|
| 1306 |
+
return __Pyx_NewRef(op2);
|
| 1307 |
+
{{elif order == 'ObjC' and c_op == '-'}}
|
| 1308 |
+
// -x == 0-x
|
| 1309 |
+
return PyLong_FromLong(-intval);
|
| 1310 |
+
{{elif order == 'ObjC' and (c_op in '*%&>><<' or op == 'FloorDivide')}}
|
| 1311 |
+
// 0 == 0*x == 0%x == 0&x == 0>>x == 0<<x == 0//x
|
| 1312 |
+
return __Pyx_NewRef(op1);
|
| 1313 |
+
{{endif}}
|
| 1314 |
+
}
|
| 1315 |
+
// handle most common case first to avoid indirect branch and optimise branch prediction
|
| 1316 |
+
if (likely(__Pyx_PyLong_IsCompact({{pyval}}))) {
|
| 1317 |
+
{{ival}} = __Pyx_PyLong_CompactValue({{pyval}});
|
| 1318 |
+
} else {
|
| 1319 |
+
const digit* digits = __Pyx_PyLong_Digits({{pyval}});
|
| 1320 |
+
const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount({{pyval}});
|
| 1321 |
+
switch (size) {
|
| 1322 |
+
{{for _size in range(2, 5)}}
|
| 1323 |
+
{{for _case in (-_size, _size)}}
|
| 1324 |
+
case {{_case}}:
|
| 1325 |
+
if (8 * sizeof(long) - 1 > {{_size}} * PyLong_SHIFT{{if c_op == '*'}}+30{{endif}}{{if op == 'TrueDivide'}} && {{_size-1}} * PyLong_SHIFT < 53{{endif}}) {
|
| 1326 |
+
{{ival}} = {{'-' if _case < 0 else ''}}(long) {{pylong_join(_size, 'digits')}};
|
| 1327 |
+
break;
|
| 1328 |
+
{{if op not in ('Eq', 'Ne', 'TrueDivide')}}
|
| 1329 |
+
#ifdef HAVE_LONG_LONG
|
| 1330 |
+
} else if (8 * sizeof(PY_LONG_LONG) - 1 > {{_size}} * PyLong_SHIFT{{if c_op == '*'}}+30{{endif}}) {
|
| 1331 |
+
ll{{ival}} = {{'-' if _case < 0 else ''}}(PY_LONG_LONG) {{pylong_join(_size, 'digits', 'unsigned PY_LONG_LONG')}};
|
| 1332 |
+
goto long_long;
|
| 1333 |
+
#endif
|
| 1334 |
+
{{endif}}
|
| 1335 |
+
}
|
| 1336 |
+
// if size doesn't fit into a long or PY_LONG_LONG anymore, fall through to default
|
| 1337 |
+
CYTHON_FALLTHROUGH;
|
| 1338 |
+
{{endfor}}
|
| 1339 |
+
{{endfor}}
|
| 1340 |
+
|
| 1341 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1342 |
+
#if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
|
| 1343 |
+
// unusual setup - your fault
|
| 1344 |
+
default: return {{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(
|
| 1345 |
+
PyLong_Type.tp_richcompare({{'op1, op2' if order == 'ObjC' else 'op2, op1'}}, Py_{{op.upper()}}));
|
| 1346 |
+
#else
|
| 1347 |
+
// too large for the long values we allow => definitely not equal
|
| 1348 |
+
default: {{return_false if op == 'Eq' else return_true}};
|
| 1349 |
+
#endif
|
| 1350 |
+
{{else}}
|
| 1351 |
+
default: return PyLong_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1352 |
+
{{endif}}
|
| 1353 |
+
}
|
| 1354 |
+
}
|
| 1355 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1356 |
+
if (a {{c_op}} b) {
|
| 1357 |
+
{{return_true}};
|
| 1358 |
+
} else {
|
| 1359 |
+
{{return_false}};
|
| 1360 |
+
}
|
| 1361 |
+
{{else}}
|
| 1362 |
+
{{if c_op == '*'}}
|
| 1363 |
+
CYTHON_UNUSED_VAR(a);
|
| 1364 |
+
CYTHON_UNUSED_VAR(b);
|
| 1365 |
+
#ifdef HAVE_LONG_LONG
|
| 1366 |
+
ll{{ival}} = {{ival}};
|
| 1367 |
+
goto long_long;
|
| 1368 |
+
#else
|
| 1369 |
+
return PyLong_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1370 |
+
#endif
|
| 1371 |
+
{{elif c_op == '%'}}
|
| 1372 |
+
// see CMath.c :: ModInt utility code
|
| 1373 |
+
x = a % b;
|
| 1374 |
+
x += ((x != 0) & ((x ^ b) < 0)) * b;
|
| 1375 |
+
{{elif op == 'TrueDivide'}}
|
| 1376 |
+
if ((8 * sizeof(long) <= 53 || likely(labs({{ival}}) <= ((PY_LONG_LONG)1 << 53)))
|
| 1377 |
+
|| __Pyx_PyLong_DigitCount({{pyval}}) <= 52 / PyLong_SHIFT) {
|
| 1378 |
+
return PyFloat_FromDouble((double)a / (double)b);
|
| 1379 |
+
}
|
| 1380 |
+
return PyLong_Type.tp_as_number->nb_{{slot_name}}(op1, op2);
|
| 1381 |
+
{{elif op == 'FloorDivide'}}
|
| 1382 |
+
{
|
| 1383 |
+
long q, r;
|
| 1384 |
+
// see CMath.c :: DivInt utility code
|
| 1385 |
+
q = a / b;
|
| 1386 |
+
r = a - q*b;
|
| 1387 |
+
q -= ((r != 0) & ((r ^ b) < 0));
|
| 1388 |
+
x = q;
|
| 1389 |
+
}
|
| 1390 |
+
{{else}}
|
| 1391 |
+
x = a {{c_op}} b;
|
| 1392 |
+
{{if op == 'Lshift'}}
|
| 1393 |
+
#ifdef HAVE_LONG_LONG
|
| 1394 |
+
if (unlikely(!(b < (long) (sizeof(long)*8) && a == x >> b)) && a) {
|
| 1395 |
+
ll{{ival}} = {{ival}};
|
| 1396 |
+
goto long_long;
|
| 1397 |
+
}
|
| 1398 |
+
#else
|
| 1399 |
+
if (likely(b < (long) (sizeof(long)*8) && a == x >> b) || !a) /* execute return statement below */
|
| 1400 |
+
#endif
|
| 1401 |
+
{{endif}}
|
| 1402 |
+
{{endif}}
|
| 1403 |
+
return PyLong_FromLong(x);
|
| 1404 |
+
|
| 1405 |
+
{{if op != 'TrueDivide'}}
|
| 1406 |
+
#ifdef HAVE_LONG_LONG
|
| 1407 |
+
long_long:
|
| 1408 |
+
{{if c_op == '%'}}
|
| 1409 |
+
// see CMath.c :: ModInt utility code
|
| 1410 |
+
llx = lla % llb;
|
| 1411 |
+
llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
|
| 1412 |
+
{{elif op == 'FloorDivide'}}
|
| 1413 |
+
{
|
| 1414 |
+
PY_LONG_LONG q, r;
|
| 1415 |
+
// see CMath.c :: DivInt utility code
|
| 1416 |
+
q = lla / llb;
|
| 1417 |
+
r = lla - q*llb;
|
| 1418 |
+
q -= ((r != 0) & ((r ^ llb) < 0));
|
| 1419 |
+
llx = q;
|
| 1420 |
+
}
|
| 1421 |
+
{{else}}
|
| 1422 |
+
llx = lla {{c_op}} llb;
|
| 1423 |
+
{{if op == 'Lshift'}}
|
| 1424 |
+
if (likely(lla == llx >> llb)) /* then execute 'return' below */
|
| 1425 |
+
{{endif}}
|
| 1426 |
+
{{endif}}
|
| 1427 |
+
return PyLong_FromLongLong(llx);
|
| 1428 |
+
#endif
|
| 1429 |
+
{{endif}}{{# if op != 'TrueDivide' #}}
|
| 1430 |
+
{{endif}}{{# if op in ('Eq', 'Ne') #}}
|
| 1431 |
+
}
|
| 1432 |
+
#endif
|
| 1433 |
+
|
| 1434 |
+
{{if c_op in '+-*' or op in ('TrueDivide', 'Eq', 'Ne')}}
|
| 1435 |
+
if (PyFloat_CheckExact({{pyval}})) {
|
| 1436 |
+
const long {{'a' if order == 'CObj' else 'b'}} = intval;
|
| 1437 |
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
| 1438 |
+
double {{ival}} = __pyx_PyFloat_AsDouble({{pyval}});
|
| 1439 |
+
#else
|
| 1440 |
+
double {{ival}} = PyFloat_AS_DOUBLE({{pyval}});
|
| 1441 |
+
#endif
|
| 1442 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1443 |
+
if ((double)a {{c_op}} (double)b) {
|
| 1444 |
+
{{return_true}};
|
| 1445 |
+
} else {
|
| 1446 |
+
{{return_false}};
|
| 1447 |
+
}
|
| 1448 |
+
{{else}}
|
| 1449 |
+
double result;
|
| 1450 |
+
{{zerodiv_check('b', 'float')}}
|
| 1451 |
+
// copied from floatobject.c in Py3.5:
|
| 1452 |
+
PyFPE_START_PROTECT("{{op.lower() if not op.endswith('Divide') else 'divide'}}", return NULL)
|
| 1453 |
+
result = ((double)a) {{c_op}} (double)b;
|
| 1454 |
+
PyFPE_END_PROTECT(result)
|
| 1455 |
+
return PyFloat_FromDouble(result);
|
| 1456 |
+
{{endif}}
|
| 1457 |
+
}
|
| 1458 |
+
{{endif}}
|
| 1459 |
+
|
| 1460 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1461 |
+
return {{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(
|
| 1462 |
+
PyObject_RichCompare(op1, op2, Py_{{op.upper()}}));
|
| 1463 |
+
{{else}}
|
| 1464 |
+
return (inplace ? PyNumber_InPlace{{op}} : PyNumber_{{op}})(op1, op2);
|
| 1465 |
+
{{endif}}
|
| 1466 |
+
}
|
| 1467 |
+
#endif
|
| 1468 |
+
|
| 1469 |
+
/////////////// PyFloatBinop.proto ///////////////
|
| 1470 |
+
|
| 1471 |
+
{{py: c_ret_type = 'PyObject*' if ret_type.is_pyobject else 'int'}}
|
| 1472 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 1473 |
+
static {{c_ret_type}} __Pyx_PyFloat_{{'' if ret_type.is_pyobject else 'Bool'}}{{op}}{{order}}(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); /*proto*/
|
| 1474 |
+
#else
|
| 1475 |
+
#define __Pyx_PyFloat_{{'' if ret_type.is_pyobject else 'Bool'}}{{op}}{{order}}(op1, op2, floatval, inplace, zerodivision_check) \
|
| 1476 |
+
{{if op in ('Eq', 'Ne')}}{{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(PyObject_RichCompare(op1, op2, Py_{{op.upper()}}))
|
| 1477 |
+
{{elif op == 'Divide'}}((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
|
| 1478 |
+
{{else}}(inplace ? PyNumber_InPlace{{op}}(op1, op2) : PyNumber_{{op}}(op1, op2))
|
| 1479 |
+
{{endif}}
|
| 1480 |
+
#endif
|
| 1481 |
+
|
| 1482 |
+
/////////////// PyFloatBinop ///////////////
|
| 1483 |
+
|
| 1484 |
+
#if !CYTHON_COMPILING_IN_PYPY
|
| 1485 |
+
{{py: from Cython.Utility import pylong_join }}
|
| 1486 |
+
{{py: c_ret_type = 'PyObject*' if ret_type.is_pyobject else 'int'}}
|
| 1487 |
+
{{py: return_true = 'Py_RETURN_TRUE' if ret_type.is_pyobject else 'return 1'}}
|
| 1488 |
+
{{py: return_false = 'Py_RETURN_FALSE' if ret_type.is_pyobject else 'return 0'}}
|
| 1489 |
+
{{py: pyval, fval = ('op2', 'b') if order == 'CObj' else ('op1', 'a') }}
|
| 1490 |
+
{{py: cfunc_name = '__Pyx_PyFloat_%s%s%s' % ('' if ret_type.is_pyobject else 'Bool', op, order) }}
|
| 1491 |
+
{{py:
|
| 1492 |
+
c_op = {
|
| 1493 |
+
'Add': '+', 'Subtract': '-', 'TrueDivide': '/', 'Divide': '/', 'Remainder': '%',
|
| 1494 |
+
'Eq': '==', 'Ne': '!=',
|
| 1495 |
+
}[op]
|
| 1496 |
+
}}
|
| 1497 |
+
{{py:
|
| 1498 |
+
def zerodiv_check(operand, _is_mod=op == 'Remainder', _needs_check=(order == 'CObj' and c_op in '%/')):
|
| 1499 |
+
return (((
|
| 1500 |
+
'if (unlikely(zerodivision_check && ((%s) == 0.0))) {'
|
| 1501 |
+
' PyErr_SetString(PyExc_ZeroDivisionError, "float division%s by zero");'
|
| 1502 |
+
' return NULL;'
|
| 1503 |
+
'}') % (operand, ' or modulo' if _is_mod else '')
|
| 1504 |
+
) if _needs_check else '')
|
| 1505 |
+
}}
|
| 1506 |
+
|
| 1507 |
+
static {{c_ret_type}} {{cfunc_name}}(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
|
| 1508 |
+
const double {{'a' if order == 'CObj' else 'b'}} = floatval;
|
| 1509 |
+
double {{fval}}{{if op not in ('Eq', 'Ne')}}, result{{endif}};
|
| 1510 |
+
CYTHON_UNUSED_VAR(inplace);
|
| 1511 |
+
CYTHON_UNUSED_VAR(zerodivision_check);
|
| 1512 |
+
|
| 1513 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1514 |
+
if (op1 == op2) {
|
| 1515 |
+
{{return_true if op == 'Eq' else return_false}};
|
| 1516 |
+
}
|
| 1517 |
+
{{endif}}
|
| 1518 |
+
|
| 1519 |
+
if (likely(PyFloat_CheckExact({{pyval}}))) {
|
| 1520 |
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
| 1521 |
+
{{fval}} = __pyx_PyFloat_AsDouble({{pyval}});
|
| 1522 |
+
#else
|
| 1523 |
+
{{fval}} = PyFloat_AS_DOUBLE({{pyval}});
|
| 1524 |
+
#endif
|
| 1525 |
+
{{zerodiv_check(fval)}}
|
| 1526 |
+
} else
|
| 1527 |
+
|
| 1528 |
+
#if PY_MAJOR_VERSION < 3
|
| 1529 |
+
if (likely(PyInt_CheckExact({{pyval}}))) {
|
| 1530 |
+
{{fval}} = (double) PyInt_AS_LONG({{pyval}});
|
| 1531 |
+
{{zerodiv_check(fval)}}
|
| 1532 |
+
} else
|
| 1533 |
+
#endif
|
| 1534 |
+
|
| 1535 |
+
if (likely(PyLong_CheckExact({{pyval}}))) {
|
| 1536 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1537 |
+
if (__Pyx_PyLong_IsZero({{pyval}})) {
|
| 1538 |
+
{{fval}} = 0.0;
|
| 1539 |
+
{{zerodiv_check(fval)}}
|
| 1540 |
+
} else if (__Pyx_PyLong_IsCompact({{pyval}})) {
|
| 1541 |
+
{{fval}} = (double) __Pyx_PyLong_CompactValue({{pyval}});
|
| 1542 |
+
} else {
|
| 1543 |
+
const digit* digits = __Pyx_PyLong_Digits({{pyval}});
|
| 1544 |
+
const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount({{pyval}});
|
| 1545 |
+
switch (size) {
|
| 1546 |
+
{{for _size in (2, 3, 4)}}
|
| 1547 |
+
case -{{_size}}:
|
| 1548 |
+
case {{_size}}:
|
| 1549 |
+
if (8 * sizeof(unsigned long) > {{_size}} * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || ({{_size-1}} * PyLong_SHIFT < 53))) {
|
| 1550 |
+
{{fval}} = (double) {{pylong_join(_size, 'digits')}};
|
| 1551 |
+
// let CPython do its own float rounding from 2**53 on (max. consecutive integer in double float)
|
| 1552 |
+
if ((8 * sizeof(unsigned long) < 53) || ({{_size}} * PyLong_SHIFT < 53) || ({{fval}} < (double) ((PY_LONG_LONG)1 << 53))) {
|
| 1553 |
+
if (size == {{-_size}})
|
| 1554 |
+
{{fval}} = -{{fval}};
|
| 1555 |
+
break;
|
| 1556 |
+
}
|
| 1557 |
+
}
|
| 1558 |
+
// Fall through if size doesn't fit safely into a double anymore.
|
| 1559 |
+
// It may not be obvious that this is a safe fall-through given the "fval < 2**53"
|
| 1560 |
+
// check above. However, the number of digits that CPython uses for a given PyLong
|
| 1561 |
+
// value is minimal, and together with the "(size-1) * SHIFT < 53" check above,
|
| 1562 |
+
// this should make it safe.
|
| 1563 |
+
CYTHON_FALLTHROUGH;
|
| 1564 |
+
{{endfor}}
|
| 1565 |
+
default:
|
| 1566 |
+
#endif
|
| 1567 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1568 |
+
return {{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(
|
| 1569 |
+
PyFloat_Type.tp_richcompare({{'op1, op2' if order == 'CObj' else 'op2, op1'}}, Py_{{op.upper()}}));
|
| 1570 |
+
{{else}}
|
| 1571 |
+
{{fval}} = PyLong_AsDouble({{pyval}});
|
| 1572 |
+
if (unlikely({{fval}} == -1.0 && PyErr_Occurred())) return NULL;
|
| 1573 |
+
{{if zerodiv_check(fval)}}
|
| 1574 |
+
#if !CYTHON_USE_PYLONG_INTERNALS
|
| 1575 |
+
{{zerodiv_check(fval)}}
|
| 1576 |
+
#endif
|
| 1577 |
+
{{endif}}
|
| 1578 |
+
{{endif}}
|
| 1579 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1580 |
+
}
|
| 1581 |
+
}
|
| 1582 |
+
#endif
|
| 1583 |
+
} else {
|
| 1584 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1585 |
+
return {{'' if ret_type.is_pyobject else '__Pyx_PyObject_IsTrueAndDecref'}}(
|
| 1586 |
+
PyObject_RichCompare(op1, op2, Py_{{op.upper()}}));
|
| 1587 |
+
{{elif op == 'Divide'}}
|
| 1588 |
+
return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
|
| 1589 |
+
{{else}}
|
| 1590 |
+
return (inplace ? PyNumber_InPlace{{op}} : PyNumber_{{op}})(op1, op2);
|
| 1591 |
+
{{endif}}
|
| 1592 |
+
}
|
| 1593 |
+
|
| 1594 |
+
{{if op in ('Eq', 'Ne')}}
|
| 1595 |
+
if (a {{c_op}} b) {
|
| 1596 |
+
{{return_true}};
|
| 1597 |
+
} else {
|
| 1598 |
+
{{return_false}};
|
| 1599 |
+
}
|
| 1600 |
+
{{else}}
|
| 1601 |
+
// copied from floatobject.c in Py3.5:
|
| 1602 |
+
PyFPE_START_PROTECT("{{op.lower() if not op.endswith('Divide') else 'divide'}}", return NULL)
|
| 1603 |
+
{{if c_op == '%'}}
|
| 1604 |
+
result = fmod(a, b);
|
| 1605 |
+
if (result)
|
| 1606 |
+
result += ((result < 0) ^ (b < 0)) * b;
|
| 1607 |
+
else
|
| 1608 |
+
result = copysign(0.0, b);
|
| 1609 |
+
{{else}}
|
| 1610 |
+
result = a {{c_op}} b;
|
| 1611 |
+
{{endif}}
|
| 1612 |
+
PyFPE_END_PROTECT(result)
|
| 1613 |
+
return PyFloat_FromDouble(result);
|
| 1614 |
+
{{endif}}
|
| 1615 |
+
}
|
| 1616 |
+
#endif
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/Overflow.c
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
These functions provide integer arithmetic with integer checking. They do not
|
| 3 |
+
actually raise an exception when an overflow is detected, but rather set a bit
|
| 4 |
+
in the overflow parameter. (This parameter may be re-used across several
|
| 5 |
+
arithmetic operations, so should be or-ed rather than assigned to.)
|
| 6 |
+
|
| 7 |
+
The implementation is divided into two parts, the signed and unsigned basecases,
|
| 8 |
+
which is where the magic happens, and a generic template matching a specific
|
| 9 |
+
type to an implementation based on its (c-compile-time) size and signedness.
|
| 10 |
+
|
| 11 |
+
When possible, branching is avoided, and preference is given to speed over
|
| 12 |
+
accuracy (a low rate of falsely "detected" overflows are acceptable,
|
| 13 |
+
undetected overflows are not).
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
TODO: Hook up checking.
|
| 17 |
+
TODO: Conditionally support 128-bit with intmax_t?
|
| 18 |
+
*/
|
| 19 |
+
|
| 20 |
+
/////////////// Common.proto ///////////////
|
| 21 |
+
|
| 22 |
+
static int __Pyx_check_twos_complement(void) {
|
| 23 |
+
if ((-1) != (~0)) {
|
| 24 |
+
PyErr_SetString(PyExc_RuntimeError, "Two's complement required for overflow checks.");
|
| 25 |
+
return 1;
|
| 26 |
+
} else if ((sizeof(short) == sizeof(int))) {
|
| 27 |
+
PyErr_SetString(PyExc_RuntimeError, "sizeof(short) < sizeof(int) required for overflow checks.");
|
| 28 |
+
return 1;
|
| 29 |
+
} else {
|
| 30 |
+
return 0;
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
#define __PYX_SIGN_BIT(type) ((((unsigned type) 1) << (sizeof(type) * 8 - 1)))
|
| 35 |
+
#define __PYX_HALF_MAX(type) ((((type) 1) << (sizeof(type) * 8 - 2)))
|
| 36 |
+
#define __PYX_MIN(type) ((__PYX_IS_UNSIGNED(type) ? (type) 0 : 0 - __PYX_HALF_MAX(type) - __PYX_HALF_MAX(type)))
|
| 37 |
+
#define __PYX_MAX(type) ((~__PYX_MIN(type)))
|
| 38 |
+
|
| 39 |
+
#define __Pyx_add_no_overflow(a, b, overflow) ((a) + (b))
|
| 40 |
+
#define __Pyx_add_const_no_overflow(a, b, overflow) ((a) + (b))
|
| 41 |
+
#define __Pyx_sub_no_overflow(a, b, overflow) ((a) - (b))
|
| 42 |
+
#define __Pyx_sub_const_no_overflow(a, b, overflow) ((a) - (b))
|
| 43 |
+
#define __Pyx_mul_no_overflow(a, b, overflow) ((a) * (b))
|
| 44 |
+
#define __Pyx_mul_const_no_overflow(a, b, overflow) ((a) * (b))
|
| 45 |
+
#define __Pyx_div_no_overflow(a, b, overflow) ((a) / (b))
|
| 46 |
+
#define __Pyx_div_const_no_overflow(a, b, overflow) ((a) / (b))
|
| 47 |
+
|
| 48 |
+
#if defined(__has_builtin)
|
| 49 |
+
# if __has_builtin(__builtin_add_overflow) && !defined(__ibmxl__)
|
| 50 |
+
# define __PYX_HAVE_BUILTIN_OVERFLOW
|
| 51 |
+
# endif
|
| 52 |
+
#elif defined(__GNUC__) && (__GNUC__ >= 5) && (!defined(__INTEL_COMPILER) || (__INTEL_COMPILER >= 1800))
|
| 53 |
+
# define __PYX_HAVE_BUILTIN_OVERFLOW
|
| 54 |
+
#endif
|
| 55 |
+
|
| 56 |
+
#if defined(__GNUC__)
|
| 57 |
+
# define __Pyx_is_constant(x) (__builtin_constant_p(x))
|
| 58 |
+
#elif defined(__has_builtin)
|
| 59 |
+
# if __has_builtin(__builtin_constant_p)
|
| 60 |
+
# define __Pyx_is_constant(x) (__builtin_constant_p(x))
|
| 61 |
+
# endif
|
| 62 |
+
#else
|
| 63 |
+
# define __Pyx_is_constant(x) (0)
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
/////////////// Common.init ///////////////
|
| 67 |
+
|
| 68 |
+
if (likely(__Pyx_check_twos_complement() == 0)); else
|
| 69 |
+
// error propagation code is appended automatically
|
| 70 |
+
|
| 71 |
+
/////////////// BaseCaseUnsigned.proto ///////////////
|
| 72 |
+
|
| 73 |
+
{{if UINT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
|
| 74 |
+
|
| 75 |
+
static CYTHON_INLINE {{UINT}} __Pyx_add_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
|
| 76 |
+
static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
|
| 77 |
+
static CYTHON_INLINE {{UINT}} __Pyx_mul_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
|
| 78 |
+
static CYTHON_INLINE {{UINT}} __Pyx_div_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
|
| 79 |
+
|
| 80 |
+
// Use these when b is known at compile time.
|
| 81 |
+
#define __Pyx_add_const_{{NAME}}_checking_overflow __Pyx_add_{{NAME}}_checking_overflow
|
| 82 |
+
#define __Pyx_sub_const_{{NAME}}_checking_overflow __Pyx_sub_{{NAME}}_checking_overflow
|
| 83 |
+
#if defined(__PYX_HAVE_BUILTIN_OVERFLOW)
|
| 84 |
+
#define __Pyx_mul_const_{{NAME}}_checking_overflow __Pyx_mul_{{NAME}}_checking_overflow
|
| 85 |
+
#else
|
| 86 |
+
static CYTHON_INLINE {{UINT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} constant, int *overflow);
|
| 87 |
+
#endif
|
| 88 |
+
#define __Pyx_div_const_{{NAME}}_checking_overflow __Pyx_div_{{NAME}}_checking_overflow
|
| 89 |
+
|
| 90 |
+
{{if UINT == "long long"}}#endif{{endif}}
|
| 91 |
+
|
| 92 |
+
/////////////// BaseCaseUnsigned ///////////////
|
| 93 |
+
|
| 94 |
+
{{if UINT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
|
| 95 |
+
|
| 96 |
+
#if defined(__PYX_HAVE_BUILTIN_OVERFLOW)
|
| 97 |
+
|
| 98 |
+
static CYTHON_INLINE {{UINT}} __Pyx_add_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 99 |
+
{{UINT}} result;
|
| 100 |
+
*overflow |= __builtin_add_overflow(a, b, &result);
|
| 101 |
+
return result;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 105 |
+
{{UINT}} result;
|
| 106 |
+
*overflow |= __builtin_sub_overflow(a, b, &result);
|
| 107 |
+
return result;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
static CYTHON_INLINE {{UINT}} __Pyx_mul_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 111 |
+
{{UINT}} result;
|
| 112 |
+
*overflow |= __builtin_mul_overflow(a, b, &result);
|
| 113 |
+
return result;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
#else
|
| 117 |
+
|
| 118 |
+
static CYTHON_INLINE {{UINT}} __Pyx_add_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 119 |
+
{{UINT}} r = a + b;
|
| 120 |
+
*overflow |= r < a;
|
| 121 |
+
return r;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 125 |
+
{{UINT}} r = a - b;
|
| 126 |
+
*overflow |= r > a;
|
| 127 |
+
return r;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
static CYTHON_INLINE {{UINT}} __Pyx_mul_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 131 |
+
// if we have a constant, use the constant version
|
| 132 |
+
if (__Pyx_is_constant(b)) {
|
| 133 |
+
return __Pyx_mul_const_{{NAME}}_checking_overflow(a, b, overflow);
|
| 134 |
+
} else if (__Pyx_is_constant(a)) {
|
| 135 |
+
return __Pyx_mul_const_{{NAME}}_checking_overflow(b, a, overflow);
|
| 136 |
+
} else if ((sizeof({{UINT}}) < sizeof(unsigned long))) {
|
| 137 |
+
unsigned long big_r = ((unsigned long) a) * ((unsigned long) b);
|
| 138 |
+
{{UINT}} r = ({{UINT}}) big_r;
|
| 139 |
+
*overflow |= big_r != r;
|
| 140 |
+
return r;
|
| 141 |
+
#ifdef HAVE_LONG_LONG
|
| 142 |
+
} else if ((sizeof({{UINT}}) < sizeof(unsigned PY_LONG_LONG))) {
|
| 143 |
+
unsigned PY_LONG_LONG big_r = ((unsigned PY_LONG_LONG) a) * ((unsigned PY_LONG_LONG) b);
|
| 144 |
+
{{UINT}} r = ({{UINT}}) big_r;
|
| 145 |
+
*overflow |= big_r != r;
|
| 146 |
+
return r;
|
| 147 |
+
#endif
|
| 148 |
+
} else {
|
| 149 |
+
return __Pyx_mul_const_{{NAME}}_checking_overflow(a, b, overflow);
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
static CYTHON_INLINE {{UINT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 154 |
+
// note that deliberately the overflow check is written such that it divides by b; this
|
| 155 |
+
// function is used when b is a constant thus the compiler should be able to eliminate the
|
| 156 |
+
// (very slow on most CPUs!) division operation
|
| 157 |
+
{{UINT}} prod;
|
| 158 |
+
if (__Pyx_is_constant(a) && !__Pyx_is_constant(b)) {
|
| 159 |
+
// if a is a compile-time constant and b isn't, swap them
|
| 160 |
+
{{UINT}} temp = b;
|
| 161 |
+
b = a;
|
| 162 |
+
a = temp;
|
| 163 |
+
}
|
| 164 |
+
prod = a * b;
|
| 165 |
+
if (b != 0)
|
| 166 |
+
*overflow |= a > (__PYX_MAX({{UINT}}) / b);
|
| 167 |
+
return prod;
|
| 168 |
+
}
|
| 169 |
+
#endif // __PYX_HAVE_BUILTIN_OVERFLOW
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
static CYTHON_INLINE {{UINT}} __Pyx_div_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
|
| 173 |
+
if (b == 0) {
|
| 174 |
+
*overflow |= 1;
|
| 175 |
+
return 0;
|
| 176 |
+
}
|
| 177 |
+
return a / b;
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
{{if UINT == "long long"}}#endif{{endif}}
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
/////////////// BaseCaseSigned.proto ///////////////
|
| 184 |
+
|
| 185 |
+
{{if INT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
|
| 186 |
+
|
| 187 |
+
static CYTHON_INLINE {{INT}} __Pyx_add_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
|
| 188 |
+
static CYTHON_INLINE {{INT}} __Pyx_sub_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
|
| 189 |
+
static CYTHON_INLINE {{INT}} __Pyx_mul_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
|
| 190 |
+
static CYTHON_INLINE {{INT}} __Pyx_div_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
// Use when b is known at compile time.
|
| 194 |
+
#define __Pyx_add_const_{{NAME}}_checking_overflow __Pyx_add_{{NAME}}_checking_overflow
|
| 195 |
+
#define __Pyx_sub_const_{{NAME}}_checking_overflow __Pyx_sub_{{NAME}}_checking_overflow
|
| 196 |
+
#if defined(__PYX_HAVE_BUILTIN_OVERFLOW)
|
| 197 |
+
#define __Pyx_mul_const_{{NAME}}_checking_overflow __Pyx_mul_{{NAME}}_checking_overflow
|
| 198 |
+
#else
|
| 199 |
+
static CYTHON_INLINE {{INT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{INT}} a, {{INT}} constant, int *overflow);
|
| 200 |
+
#endif
|
| 201 |
+
#define __Pyx_div_const_{{NAME}}_checking_overflow __Pyx_div_{{NAME}}_checking_overflow
|
| 202 |
+
|
| 203 |
+
{{if INT == "long long"}}#endif{{endif}}
|
| 204 |
+
|
| 205 |
+
/////////////// BaseCaseSigned ///////////////
|
| 206 |
+
|
| 207 |
+
{{if INT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
|
| 208 |
+
|
| 209 |
+
#if defined(__PYX_HAVE_BUILTIN_OVERFLOW)
|
| 210 |
+
|
| 211 |
+
static CYTHON_INLINE {{INT}} __Pyx_add_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 212 |
+
{{INT}} result;
|
| 213 |
+
*overflow |= __builtin_add_overflow(a, b, &result);
|
| 214 |
+
return result;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
static CYTHON_INLINE {{INT}} __Pyx_sub_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 218 |
+
{{INT}} result;
|
| 219 |
+
*overflow |= __builtin_sub_overflow(a, b, &result);
|
| 220 |
+
return result;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
static CYTHON_INLINE {{INT}} __Pyx_mul_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 224 |
+
{{INT}} result;
|
| 225 |
+
*overflow |= __builtin_mul_overflow(a, b, &result);
|
| 226 |
+
return result;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
#else
|
| 230 |
+
|
| 231 |
+
static CYTHON_INLINE {{INT}} __Pyx_add_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 232 |
+
if ((sizeof({{INT}}) < sizeof(long))) {
|
| 233 |
+
long big_r = ((long) a) + ((long) b);
|
| 234 |
+
{{INT}} r = ({{INT}}) big_r;
|
| 235 |
+
*overflow |= big_r != r;
|
| 236 |
+
return r;
|
| 237 |
+
#ifdef HAVE_LONG_LONG
|
| 238 |
+
} else if ((sizeof({{INT}}) < sizeof(PY_LONG_LONG))) {
|
| 239 |
+
PY_LONG_LONG big_r = ((PY_LONG_LONG) a) + ((PY_LONG_LONG) b);
|
| 240 |
+
{{INT}} r = ({{INT}}) big_r;
|
| 241 |
+
*overflow |= big_r != r;
|
| 242 |
+
return r;
|
| 243 |
+
#endif
|
| 244 |
+
} else {
|
| 245 |
+
// Signed overflow undefined, but unsigned overflow is well defined. Casting is
|
| 246 |
+
// implementation-defined, but we assume two's complement (see __Pyx_check_twos_complement
|
| 247 |
+
// above), and arithmetic in two's-complement is the same as unsigned arithmetic.
|
| 248 |
+
unsigned {{INT}} r = (unsigned {{INT}}) a + (unsigned {{INT}}) b;
|
| 249 |
+
// Overflow happened if the operands have the same sign, but the result
|
| 250 |
+
// has opposite sign.
|
| 251 |
+
*overflow |= (((unsigned {{INT}})a ^ r) & ((unsigned {{INT}})b ^ r)) >> (8 * sizeof({{INT}}) - 1);
|
| 252 |
+
return ({{INT}}) r;
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
static CYTHON_INLINE {{INT}} __Pyx_sub_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 257 |
+
// Compilers don't handle widening as well in the subtraction case, so don't bother
|
| 258 |
+
unsigned {{INT}} r = (unsigned {{INT}}) a - (unsigned {{INT}}) b;
|
| 259 |
+
// Overflow happened if the operands differing signs, and the result
|
| 260 |
+
// has opposite sign to a.
|
| 261 |
+
*overflow |= (((unsigned {{INT}})a ^ (unsigned {{INT}})b) & ((unsigned {{INT}})a ^ r)) >> (8 * sizeof({{INT}}) - 1);
|
| 262 |
+
return ({{INT}}) r;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
static CYTHON_INLINE {{INT}} __Pyx_mul_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 266 |
+
// if we have a constant, use the constant version
|
| 267 |
+
if (__Pyx_is_constant(b)) {
|
| 268 |
+
return __Pyx_mul_const_{{NAME}}_checking_overflow(a, b, overflow);
|
| 269 |
+
} else if (__Pyx_is_constant(a)) {
|
| 270 |
+
return __Pyx_mul_const_{{NAME}}_checking_overflow(b, a, overflow);
|
| 271 |
+
} else if ((sizeof({{INT}}) < sizeof(long))) {
|
| 272 |
+
long big_r = ((long) a) * ((long) b);
|
| 273 |
+
{{INT}} r = ({{INT}}) big_r;
|
| 274 |
+
*overflow |= big_r != r;
|
| 275 |
+
return ({{INT}}) r;
|
| 276 |
+
#ifdef HAVE_LONG_LONG
|
| 277 |
+
} else if ((sizeof({{INT}}) < sizeof(PY_LONG_LONG))) {
|
| 278 |
+
PY_LONG_LONG big_r = ((PY_LONG_LONG) a) * ((PY_LONG_LONG) b);
|
| 279 |
+
{{INT}} r = ({{INT}}) big_r;
|
| 280 |
+
*overflow |= big_r != r;
|
| 281 |
+
return ({{INT}}) r;
|
| 282 |
+
#endif
|
| 283 |
+
} else {
|
| 284 |
+
return __Pyx_mul_const_{{NAME}}_checking_overflow(a, b, overflow);
|
| 285 |
+
}
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
static CYTHON_INLINE {{INT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 289 |
+
// note that deliberately all these comparisons are written such that they divide by b; this
|
| 290 |
+
// function is used when b is a constant thus the compiler should be able to eliminate the
|
| 291 |
+
// (very slow on most CPUs!) division operations
|
| 292 |
+
if (__Pyx_is_constant(a) && !__Pyx_is_constant(b)) {
|
| 293 |
+
// if a is a compile-time constant and b isn't, swap them
|
| 294 |
+
{{INT}} temp = b;
|
| 295 |
+
b = a;
|
| 296 |
+
a = temp;
|
| 297 |
+
}
|
| 298 |
+
if (b > 1) {
|
| 299 |
+
*overflow |= a > __PYX_MAX({{INT}}) / b;
|
| 300 |
+
*overflow |= a < __PYX_MIN({{INT}}) / b;
|
| 301 |
+
} else if (b == -1) {
|
| 302 |
+
*overflow |= a == __PYX_MIN({{INT}});
|
| 303 |
+
} else if (b < -1) {
|
| 304 |
+
*overflow |= a > __PYX_MIN({{INT}}) / b;
|
| 305 |
+
*overflow |= a < __PYX_MAX({{INT}}) / b;
|
| 306 |
+
}
|
| 307 |
+
return ({{INT}}) (((unsigned {{INT}})a) * ((unsigned {{INT}}) b));
|
| 308 |
+
}
|
| 309 |
+
#endif // defined(__PYX_HAVE_BUILTIN_OVERFLOW)
|
| 310 |
+
|
| 311 |
+
static CYTHON_INLINE {{INT}} __Pyx_div_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
|
| 312 |
+
if (b == 0) {
|
| 313 |
+
*overflow |= 1;
|
| 314 |
+
return 0;
|
| 315 |
+
}
|
| 316 |
+
*overflow |= a == __PYX_MIN({{INT}}) && b == -1;
|
| 317 |
+
return ({{INT}}) ((unsigned {{INT}}) a / (unsigned {{INT}}) b);
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
{{if INT == "long long"}}#endif{{endif}}
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
/////////////// SizeCheck.init ///////////////
|
| 324 |
+
|
| 325 |
+
if (likely(__Pyx_check_sane_{{NAME}}() == 0)); else
|
| 326 |
+
// error propagation code is appended automatically
|
| 327 |
+
|
| 328 |
+
/////////////// SizeCheck.proto ///////////////
|
| 329 |
+
|
| 330 |
+
static int __Pyx_check_sane_{{NAME}}(void) {
|
| 331 |
+
if (((sizeof({{TYPE}}) <= sizeof(int)) ||
|
| 332 |
+
#ifdef HAVE_LONG_LONG
|
| 333 |
+
(sizeof({{TYPE}}) == sizeof(PY_LONG_LONG)) ||
|
| 334 |
+
#endif
|
| 335 |
+
(sizeof({{TYPE}}) == sizeof(long)))) {
|
| 336 |
+
return 0;
|
| 337 |
+
} else {
|
| 338 |
+
PyErr_Format(PyExc_RuntimeError, \
|
| 339 |
+
"Bad size for int type %.{{max(60, len(TYPE))}}s: %d", "{{TYPE}}", (int) sizeof({{TYPE}}));
|
| 340 |
+
return 1;
|
| 341 |
+
}
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
/////////////// Binop.proto ///////////////
|
| 346 |
+
|
| 347 |
+
static CYTHON_INLINE {{TYPE}} __Pyx_{{BINOP}}_{{NAME}}_checking_overflow({{TYPE}} a, {{TYPE}} b, int *overflow);
|
| 348 |
+
|
| 349 |
+
/////////////// Binop ///////////////
|
| 350 |
+
|
| 351 |
+
static CYTHON_INLINE {{TYPE}} __Pyx_{{BINOP}}_{{NAME}}_checking_overflow({{TYPE}} a, {{TYPE}} b, int *overflow) {
|
| 352 |
+
if ((sizeof({{TYPE}}) < sizeof(int))) {
|
| 353 |
+
return __Pyx_{{BINOP}}_no_overflow(a, b, overflow);
|
| 354 |
+
} else if (__PYX_IS_UNSIGNED({{TYPE}})) {
|
| 355 |
+
if ((sizeof({{TYPE}}) == sizeof(unsigned int))) {
|
| 356 |
+
return ({{TYPE}}) __Pyx_{{BINOP}}_unsigned_int_checking_overflow(a, b, overflow);
|
| 357 |
+
} else if ((sizeof({{TYPE}}) == sizeof(unsigned long))) {
|
| 358 |
+
return ({{TYPE}}) __Pyx_{{BINOP}}_unsigned_long_checking_overflow(a, b, overflow);
|
| 359 |
+
#ifdef HAVE_LONG_LONG
|
| 360 |
+
} else if ((sizeof({{TYPE}}) == sizeof(unsigned PY_LONG_LONG))) {
|
| 361 |
+
return ({{TYPE}}) __Pyx_{{BINOP}}_unsigned_long_long_checking_overflow(a, b, overflow);
|
| 362 |
+
#endif
|
| 363 |
+
} else {
|
| 364 |
+
abort(); return 0; /* handled elsewhere */
|
| 365 |
+
}
|
| 366 |
+
} else {
|
| 367 |
+
if ((sizeof({{TYPE}}) == sizeof(int))) {
|
| 368 |
+
return ({{TYPE}}) __Pyx_{{BINOP}}_int_checking_overflow(a, b, overflow);
|
| 369 |
+
} else if ((sizeof({{TYPE}}) == sizeof(long))) {
|
| 370 |
+
return ({{TYPE}}) __Pyx_{{BINOP}}_long_checking_overflow(a, b, overflow);
|
| 371 |
+
#ifdef HAVE_LONG_LONG
|
| 372 |
+
} else if ((sizeof({{TYPE}}) == sizeof(PY_LONG_LONG))) {
|
| 373 |
+
return ({{TYPE}}) __Pyx_{{BINOP}}_long_long_checking_overflow(a, b, overflow);
|
| 374 |
+
#endif
|
| 375 |
+
} else {
|
| 376 |
+
abort(); return 0; /* handled elsewhere */
|
| 377 |
+
}
|
| 378 |
+
}
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
/////////////// LeftShift.proto ///////////////
|
| 382 |
+
|
| 383 |
+
static CYTHON_INLINE {{TYPE}} __Pyx_lshift_{{NAME}}_checking_overflow({{TYPE}} a, {{TYPE}} b, int *overflow) {
|
| 384 |
+
int overflow_check =
|
| 385 |
+
#if {{SIGNED}}
|
| 386 |
+
(a < 0) || (b < 0) ||
|
| 387 |
+
#endif
|
| 388 |
+
// the following must be a _logical_ OR as the RHS is undefined if the LHS is true
|
| 389 |
+
(b >= ({{TYPE}}) (8 * sizeof({{TYPE}}))) || (a > (__PYX_MAX({{TYPE}}) >> b));
|
| 390 |
+
if (overflow_check) {
|
| 391 |
+
*overflow |= 1;
|
| 392 |
+
return 0;
|
| 393 |
+
} else {
|
| 394 |
+
return a << b;
|
| 395 |
+
}
|
| 396 |
+
}
|
| 397 |
+
#define __Pyx_lshift_const_{{NAME}}_checking_overflow __Pyx_lshift_{{NAME}}_checking_overflow
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
/////////////// UnaryNegOverflows.proto ///////////////
|
| 401 |
+
|
| 402 |
+
// from intobject.c
|
| 403 |
+
#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x) \
|
| 404 |
+
(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/TypeConversion.c
ADDED
|
@@ -0,0 +1,1310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/////////////// TypeConversions.proto ///////////////
|
| 2 |
+
//@requires: StringTools.c::IncludeStringH
|
| 3 |
+
|
| 4 |
+
/* Type Conversion Predeclarations */
|
| 5 |
+
|
| 6 |
+
#define __Pyx_uchar_cast(c) ((unsigned char)c)
|
| 7 |
+
#define __Pyx_long_cast(x) ((long)x)
|
| 8 |
+
|
| 9 |
+
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
|
| 10 |
+
(sizeof(type) < sizeof(Py_ssize_t)) || \
|
| 11 |
+
(sizeof(type) > sizeof(Py_ssize_t) && \
|
| 12 |
+
likely(v < (type)PY_SSIZE_T_MAX || \
|
| 13 |
+
v == (type)PY_SSIZE_T_MAX) && \
|
| 14 |
+
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
|
| 15 |
+
v == (type)PY_SSIZE_T_MIN))) || \
|
| 16 |
+
(sizeof(type) == sizeof(Py_ssize_t) && \
|
| 17 |
+
(is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
|
| 18 |
+
v == (type)PY_SSIZE_T_MAX))) )
|
| 19 |
+
|
| 20 |
+
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
|
| 21 |
+
// Optimisation from Section 14.2 "Bounds Checking" in
|
| 22 |
+
// https://www.agner.org/optimize/optimizing_cpp.pdf
|
| 23 |
+
// See https://bugs.python.org/issue28397
|
| 24 |
+
// The cast to unsigned effectively tests for "0 <= i < limit".
|
| 25 |
+
return (size_t) i < (size_t) limit;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
// fast and unsafe abs(Py_ssize_t) that ignores the overflow for (-PY_SSIZE_T_MAX-1)
|
| 29 |
+
#if defined (__cplusplus) && __cplusplus >= 201103L
|
| 30 |
+
#include <cstdlib>
|
| 31 |
+
#define __Pyx_sst_abs(value) std::abs(value)
|
| 32 |
+
#elif SIZEOF_INT >= SIZEOF_SIZE_T
|
| 33 |
+
#define __Pyx_sst_abs(value) abs(value)
|
| 34 |
+
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
|
| 35 |
+
#define __Pyx_sst_abs(value) labs(value)
|
| 36 |
+
#elif defined (_MSC_VER)
|
| 37 |
+
// abs() is defined for long, but 64-bits type on MSVC is long long.
|
| 38 |
+
// Use MS-specific _abs64 instead.
|
| 39 |
+
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
|
| 40 |
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
| 41 |
+
#define __Pyx_sst_abs(value) llabs(value)
|
| 42 |
+
#elif defined (__GNUC__)
|
| 43 |
+
// gcc or clang on 64 bit windows.
|
| 44 |
+
#define __Pyx_sst_abs(value) __builtin_llabs(value)
|
| 45 |
+
#else
|
| 46 |
+
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
|
| 50 |
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
|
| 51 |
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
| 52 |
+
|
| 53 |
+
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
|
| 54 |
+
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
|
| 55 |
+
#define __Pyx_PyBytes_FromString PyBytes_FromString
|
| 56 |
+
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
| 57 |
+
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
| 58 |
+
|
| 59 |
+
#if PY_MAJOR_VERSION < 3
|
| 60 |
+
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
|
| 61 |
+
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
| 62 |
+
#else
|
| 63 |
+
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
|
| 64 |
+
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
|
| 65 |
+
#endif
|
| 66 |
+
|
| 67 |
+
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
|
| 68 |
+
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
|
| 69 |
+
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
|
| 70 |
+
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
|
| 71 |
+
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
|
| 72 |
+
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
|
| 73 |
+
#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
| 74 |
+
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
| 75 |
+
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
| 76 |
+
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
|
| 77 |
+
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
|
| 78 |
+
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
|
| 79 |
+
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
|
| 80 |
+
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
| 81 |
+
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
|
| 82 |
+
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
| 83 |
+
#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
|
| 84 |
+
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
| 85 |
+
|
| 86 |
+
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
|
| 87 |
+
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
|
| 88 |
+
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
|
| 89 |
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
|
| 90 |
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
|
| 91 |
+
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
|
| 92 |
+
|
| 93 |
+
#define __Pyx_PySequence_Tuple(obj) \
|
| 94 |
+
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
|
| 95 |
+
|
| 96 |
+
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
|
| 97 |
+
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
|
| 98 |
+
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
| 99 |
+
|
| 100 |
+
#if CYTHON_ASSUME_SAFE_MACROS
|
| 101 |
+
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
|
| 102 |
+
#else
|
| 103 |
+
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
|
| 104 |
+
#endif
|
| 105 |
+
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
|
| 106 |
+
|
| 107 |
+
#if PY_MAJOR_VERSION >= 3
|
| 108 |
+
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
|
| 109 |
+
#else
|
| 110 |
+
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
|
| 111 |
+
#endif
|
| 112 |
+
// __Pyx_PyNumber_Float is now in its own section since it has dependencies (needed to make
|
| 113 |
+
// string conversion work the same in all circumstances).
|
| 114 |
+
|
| 115 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 116 |
+
#if PY_VERSION_HEX >= 0x030C00A7
|
| 117 |
+
#ifndef _PyLong_SIGN_MASK
|
| 118 |
+
#define _PyLong_SIGN_MASK 3
|
| 119 |
+
#endif
|
| 120 |
+
#ifndef _PyLong_NON_SIZE_BITS
|
| 121 |
+
#define _PyLong_NON_SIZE_BITS 3
|
| 122 |
+
#endif
|
| 123 |
+
#define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
|
| 124 |
+
#define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
|
| 125 |
+
#define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
|
| 126 |
+
#define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
|
| 127 |
+
#define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
|
| 128 |
+
#define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
|
| 129 |
+
#define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
|
| 130 |
+
#define __Pyx_PyLong_SignedDigitCount(x) \
|
| 131 |
+
((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
|
| 132 |
+
|
| 133 |
+
#if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
|
| 134 |
+
#define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
|
| 135 |
+
#define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
|
| 136 |
+
#else
|
| 137 |
+
#define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
|
| 138 |
+
#define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
|
| 139 |
+
#endif
|
| 140 |
+
|
| 141 |
+
// CPython 3.12 requires C99, which defines 'size_t' (but not 'ssize_t')
|
| 142 |
+
typedef Py_ssize_t __Pyx_compact_pylong;
|
| 143 |
+
typedef size_t __Pyx_compact_upylong;
|
| 144 |
+
|
| 145 |
+
#else /* Py < 3.12 */
|
| 146 |
+
#define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
|
| 147 |
+
#define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
|
| 148 |
+
#define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
|
| 149 |
+
#define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
|
| 150 |
+
#define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
|
| 151 |
+
#define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
|
| 152 |
+
#define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
|
| 153 |
+
|
| 154 |
+
#define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
|
| 155 |
+
#define __Pyx_PyLong_CompactValue(x) \
|
| 156 |
+
((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
|
| 157 |
+
|
| 158 |
+
typedef sdigit __Pyx_compact_pylong;
|
| 159 |
+
typedef digit __Pyx_compact_upylong;
|
| 160 |
+
#endif
|
| 161 |
+
|
| 162 |
+
#if PY_VERSION_HEX >= 0x030C00A5
|
| 163 |
+
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
|
| 164 |
+
#else
|
| 165 |
+
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
|
| 166 |
+
#endif
|
| 167 |
+
#endif
|
| 168 |
+
|
| 169 |
+
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
| 170 |
+
#include <string.h>
|
| 171 |
+
|
| 172 |
+
static int __Pyx_sys_getdefaultencoding_not_ascii;
|
| 173 |
+
static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
| 174 |
+
PyObject* sys;
|
| 175 |
+
PyObject* default_encoding = NULL;
|
| 176 |
+
PyObject* ascii_chars_u = NULL;
|
| 177 |
+
PyObject* ascii_chars_b = NULL;
|
| 178 |
+
const char* default_encoding_c;
|
| 179 |
+
sys = PyImport_ImportModule("sys");
|
| 180 |
+
if (!sys) goto bad;
|
| 181 |
+
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
|
| 182 |
+
Py_DECREF(sys);
|
| 183 |
+
if (!default_encoding) goto bad;
|
| 184 |
+
default_encoding_c = PyBytes_AsString(default_encoding);
|
| 185 |
+
if (!default_encoding_c) goto bad;
|
| 186 |
+
if (strcmp(default_encoding_c, "ascii") == 0) {
|
| 187 |
+
__Pyx_sys_getdefaultencoding_not_ascii = 0;
|
| 188 |
+
} else {
|
| 189 |
+
char ascii_chars[128];
|
| 190 |
+
int c;
|
| 191 |
+
for (c = 0; c < 128; c++) {
|
| 192 |
+
ascii_chars[c] = (char) c;
|
| 193 |
+
}
|
| 194 |
+
__Pyx_sys_getdefaultencoding_not_ascii = 1;
|
| 195 |
+
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
|
| 196 |
+
if (!ascii_chars_u) goto bad;
|
| 197 |
+
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
|
| 198 |
+
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
|
| 199 |
+
PyErr_Format(
|
| 200 |
+
PyExc_ValueError,
|
| 201 |
+
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
|
| 202 |
+
default_encoding_c);
|
| 203 |
+
goto bad;
|
| 204 |
+
}
|
| 205 |
+
Py_DECREF(ascii_chars_u);
|
| 206 |
+
Py_DECREF(ascii_chars_b);
|
| 207 |
+
}
|
| 208 |
+
Py_DECREF(default_encoding);
|
| 209 |
+
return 0;
|
| 210 |
+
bad:
|
| 211 |
+
Py_XDECREF(default_encoding);
|
| 212 |
+
Py_XDECREF(ascii_chars_u);
|
| 213 |
+
Py_XDECREF(ascii_chars_b);
|
| 214 |
+
return -1;
|
| 215 |
+
}
|
| 216 |
+
#endif
|
| 217 |
+
|
| 218 |
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
|
| 219 |
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
|
| 220 |
+
#else
|
| 221 |
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
| 222 |
+
|
| 223 |
+
// __PYX_DEFAULT_STRING_ENCODING is either a user provided string constant
|
| 224 |
+
// or we need to look it up here
|
| 225 |
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
| 226 |
+
#include <string.h>
|
| 227 |
+
|
| 228 |
+
static char* __PYX_DEFAULT_STRING_ENCODING;
|
| 229 |
+
|
| 230 |
+
static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
| 231 |
+
PyObject* sys;
|
| 232 |
+
PyObject* default_encoding = NULL;
|
| 233 |
+
char* default_encoding_c;
|
| 234 |
+
|
| 235 |
+
sys = PyImport_ImportModule("sys");
|
| 236 |
+
if (!sys) goto bad;
|
| 237 |
+
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
| 238 |
+
Py_DECREF(sys);
|
| 239 |
+
if (!default_encoding) goto bad;
|
| 240 |
+
default_encoding_c = PyBytes_AsString(default_encoding);
|
| 241 |
+
if (!default_encoding_c) goto bad;
|
| 242 |
+
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
|
| 243 |
+
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
|
| 244 |
+
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
|
| 245 |
+
Py_DECREF(default_encoding);
|
| 246 |
+
return 0;
|
| 247 |
+
bad:
|
| 248 |
+
Py_XDECREF(default_encoding);
|
| 249 |
+
return -1;
|
| 250 |
+
}
|
| 251 |
+
#endif
|
| 252 |
+
#endif
|
| 253 |
+
|
| 254 |
+
/////////////// TypeConversions ///////////////
|
| 255 |
+
|
| 256 |
+
/* Type Conversion Functions */
|
| 257 |
+
|
| 258 |
+
#include <string.h>
|
| 259 |
+
|
| 260 |
+
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
|
| 261 |
+
size_t len = strlen(s);
|
| 262 |
+
if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
|
| 263 |
+
PyErr_SetString(PyExc_OverflowError, "byte string is too long");
|
| 264 |
+
return -1;
|
| 265 |
+
}
|
| 266 |
+
return (Py_ssize_t) len;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
|
| 270 |
+
Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
| 271 |
+
if (unlikely(len < 0)) return NULL;
|
| 272 |
+
return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
|
| 276 |
+
Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
| 277 |
+
if (unlikely(len < 0)) return NULL;
|
| 278 |
+
return PyByteArray_FromStringAndSize(c_str, len);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
// Py3.7 returns a "const char*" for unicode strings
|
| 282 |
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
|
| 283 |
+
Py_ssize_t ignore;
|
| 284 |
+
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
| 288 |
+
#if !CYTHON_PEP393_ENABLED
|
| 289 |
+
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
| 290 |
+
char* defenc_c;
|
| 291 |
+
// borrowed reference, cached internally in 'o' by CPython
|
| 292 |
+
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
|
| 293 |
+
if (!defenc) return NULL;
|
| 294 |
+
defenc_c = PyBytes_AS_STRING(defenc);
|
| 295 |
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
| 296 |
+
{
|
| 297 |
+
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
|
| 298 |
+
char* c;
|
| 299 |
+
for (c = defenc_c; c < end; c++) {
|
| 300 |
+
if ((unsigned char) (*c) >= 128) {
|
| 301 |
+
// raise the error
|
| 302 |
+
PyUnicode_AsASCIIString(o);
|
| 303 |
+
return NULL;
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
|
| 308 |
+
*length = PyBytes_GET_SIZE(defenc);
|
| 309 |
+
return defenc_c;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
#else /* CYTHON_PEP393_ENABLED: */
|
| 313 |
+
|
| 314 |
+
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
| 315 |
+
if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
|
| 316 |
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
| 317 |
+
if (likely(PyUnicode_IS_ASCII(o))) {
|
| 318 |
+
// cached for the lifetime of the object
|
| 319 |
+
*length = PyUnicode_GET_LENGTH(o);
|
| 320 |
+
return PyUnicode_AsUTF8(o);
|
| 321 |
+
} else {
|
| 322 |
+
// raise the error
|
| 323 |
+
PyUnicode_AsASCIIString(o);
|
| 324 |
+
return NULL;
|
| 325 |
+
}
|
| 326 |
+
#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
|
| 327 |
+
return PyUnicode_AsUTF8AndSize(o, length);
|
| 328 |
+
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
|
| 329 |
+
}
|
| 330 |
+
#endif /* CYTHON_PEP393_ENABLED */
|
| 331 |
+
#endif
|
| 332 |
+
|
| 333 |
+
// Py3.7 returns a "const char*" for unicode strings
|
| 334 |
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
| 335 |
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
| 336 |
+
if (
|
| 337 |
+
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
| 338 |
+
__Pyx_sys_getdefaultencoding_not_ascii &&
|
| 339 |
+
#endif
|
| 340 |
+
PyUnicode_Check(o)) {
|
| 341 |
+
return __Pyx_PyUnicode_AsStringAndSize(o, length);
|
| 342 |
+
} else
|
| 343 |
+
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
|
| 344 |
+
|
| 345 |
+
#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
|
| 346 |
+
if (PyByteArray_Check(o)) {
|
| 347 |
+
*length = PyByteArray_GET_SIZE(o);
|
| 348 |
+
return PyByteArray_AS_STRING(o);
|
| 349 |
+
} else
|
| 350 |
+
#endif
|
| 351 |
+
{
|
| 352 |
+
char* result;
|
| 353 |
+
int r = PyBytes_AsStringAndSize(o, &result, length);
|
| 354 |
+
if (unlikely(r < 0)) {
|
| 355 |
+
return NULL;
|
| 356 |
+
} else {
|
| 357 |
+
return result;
|
| 358 |
+
}
|
| 359 |
+
}
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
/* Note: __Pyx_PyObject_IsTrue is written to minimize branching. */
|
| 363 |
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
|
| 364 |
+
int is_true = x == Py_True;
|
| 365 |
+
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
|
| 366 |
+
else return PyObject_IsTrue(x);
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
|
| 370 |
+
int retval;
|
| 371 |
+
if (unlikely(!x)) return -1;
|
| 372 |
+
retval = __Pyx_PyObject_IsTrue(x);
|
| 373 |
+
Py_DECREF(x);
|
| 374 |
+
return retval;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
|
| 378 |
+
__Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
|
| 379 |
+
#if PY_MAJOR_VERSION >= 3
|
| 380 |
+
if (PyLong_Check(result)) {
|
| 381 |
+
// CPython issue #17576: warn if 'result' not of exact type int.
|
| 382 |
+
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
| 383 |
+
"__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
|
| 384 |
+
"The ability to return an instance of a strict subclass of int is deprecated, "
|
| 385 |
+
"and may be removed in a future version of Python.",
|
| 386 |
+
result_type_name)) {
|
| 387 |
+
__Pyx_DECREF_TypeName(result_type_name);
|
| 388 |
+
Py_DECREF(result);
|
| 389 |
+
return NULL;
|
| 390 |
+
}
|
| 391 |
+
__Pyx_DECREF_TypeName(result_type_name);
|
| 392 |
+
return result;
|
| 393 |
+
}
|
| 394 |
+
#endif
|
| 395 |
+
PyErr_Format(PyExc_TypeError,
|
| 396 |
+
"__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
|
| 397 |
+
type_name, type_name, result_type_name);
|
| 398 |
+
__Pyx_DECREF_TypeName(result_type_name);
|
| 399 |
+
Py_DECREF(result);
|
| 400 |
+
return NULL;
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
|
| 404 |
+
#if CYTHON_USE_TYPE_SLOTS
|
| 405 |
+
PyNumberMethods *m;
|
| 406 |
+
#endif
|
| 407 |
+
const char *name = NULL;
|
| 408 |
+
PyObject *res = NULL;
|
| 409 |
+
#if PY_MAJOR_VERSION < 3
|
| 410 |
+
if (likely(PyInt_Check(x) || PyLong_Check(x)))
|
| 411 |
+
#else
|
| 412 |
+
if (likely(PyLong_Check(x)))
|
| 413 |
+
#endif
|
| 414 |
+
return __Pyx_NewRef(x);
|
| 415 |
+
#if CYTHON_USE_TYPE_SLOTS
|
| 416 |
+
m = Py_TYPE(x)->tp_as_number;
|
| 417 |
+
#if PY_MAJOR_VERSION < 3
|
| 418 |
+
if (m && m->nb_int) {
|
| 419 |
+
name = "int";
|
| 420 |
+
res = m->nb_int(x);
|
| 421 |
+
}
|
| 422 |
+
else if (m && m->nb_long) {
|
| 423 |
+
name = "long";
|
| 424 |
+
res = m->nb_long(x);
|
| 425 |
+
}
|
| 426 |
+
#else
|
| 427 |
+
if (likely(m && m->nb_int)) {
|
| 428 |
+
name = "int";
|
| 429 |
+
res = m->nb_int(x);
|
| 430 |
+
}
|
| 431 |
+
#endif
|
| 432 |
+
#else
|
| 433 |
+
if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
|
| 434 |
+
res = PyNumber_Int(x);
|
| 435 |
+
}
|
| 436 |
+
#endif
|
| 437 |
+
if (likely(res)) {
|
| 438 |
+
#if PY_MAJOR_VERSION < 3
|
| 439 |
+
if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
|
| 440 |
+
#else
|
| 441 |
+
if (unlikely(!PyLong_CheckExact(res))) {
|
| 442 |
+
#endif
|
| 443 |
+
return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
|
| 444 |
+
}
|
| 445 |
+
}
|
| 446 |
+
else if (!PyErr_Occurred()) {
|
| 447 |
+
PyErr_SetString(PyExc_TypeError,
|
| 448 |
+
"an integer is required");
|
| 449 |
+
}
|
| 450 |
+
return res;
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
{{py: from Cython.Utility import pylong_join }}
|
| 454 |
+
|
| 455 |
+
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
|
| 456 |
+
Py_ssize_t ival;
|
| 457 |
+
PyObject *x;
|
| 458 |
+
#if PY_MAJOR_VERSION < 3
|
| 459 |
+
if (likely(PyInt_CheckExact(b))) {
|
| 460 |
+
if (sizeof(Py_ssize_t) >= sizeof(long))
|
| 461 |
+
return PyInt_AS_LONG(b);
|
| 462 |
+
else
|
| 463 |
+
return PyInt_AsSsize_t(b);
|
| 464 |
+
}
|
| 465 |
+
#endif
|
| 466 |
+
if (likely(PyLong_CheckExact(b))) {
|
| 467 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 468 |
+
// handle most common case first to avoid indirect branch and optimise branch prediction
|
| 469 |
+
if (likely(__Pyx_PyLong_IsCompact(b))) {
|
| 470 |
+
return __Pyx_PyLong_CompactValue(b);
|
| 471 |
+
} else {
|
| 472 |
+
const digit* digits = __Pyx_PyLong_Digits(b);
|
| 473 |
+
const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
|
| 474 |
+
switch (size) {
|
| 475 |
+
{{for _size in (2, 3, 4)}}
|
| 476 |
+
{{for _case in (_size, -_size)}}
|
| 477 |
+
case {{_case}}:
|
| 478 |
+
if (8 * sizeof(Py_ssize_t) > {{_size}} * PyLong_SHIFT) {
|
| 479 |
+
return {{'-' if _case < 0 else ''}}(Py_ssize_t) {{pylong_join(_size, 'digits', 'size_t')}};
|
| 480 |
+
}
|
| 481 |
+
break;
|
| 482 |
+
{{endfor}}
|
| 483 |
+
{{endfor}}
|
| 484 |
+
}
|
| 485 |
+
}
|
| 486 |
+
#endif
|
| 487 |
+
return PyLong_AsSsize_t(b);
|
| 488 |
+
}
|
| 489 |
+
x = PyNumber_Index(b);
|
| 490 |
+
if (!x) return -1;
|
| 491 |
+
ival = PyInt_AsSsize_t(x);
|
| 492 |
+
Py_DECREF(x);
|
| 493 |
+
return ival;
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
|
| 497 |
+
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
|
| 498 |
+
if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
|
| 499 |
+
return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
|
| 500 |
+
#if PY_MAJOR_VERSION < 3
|
| 501 |
+
} else if (likely(PyInt_CheckExact(o))) {
|
| 502 |
+
return PyInt_AS_LONG(o);
|
| 503 |
+
#endif
|
| 504 |
+
} else {
|
| 505 |
+
Py_ssize_t ival;
|
| 506 |
+
PyObject *x;
|
| 507 |
+
x = PyNumber_Index(o);
|
| 508 |
+
if (!x) return -1;
|
| 509 |
+
ival = PyInt_AsLong(x);
|
| 510 |
+
Py_DECREF(x);
|
| 511 |
+
return ival;
|
| 512 |
+
}
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
|
| 516 |
+
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
|
| 517 |
+
return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
|
| 522 |
+
return PyInt_FromSize_t(ival);
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
/////////////// pynumber_float.proto ///////////////
|
| 526 |
+
|
| 527 |
+
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); /* proto */
|
| 528 |
+
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))
|
| 529 |
+
|
| 530 |
+
/////////////// pynumber_float ///////////////
|
| 531 |
+
//@requires: Optimize.c::pybytes_as_double
|
| 532 |
+
//@requires: Optimize.c::pyunicode_as_double
|
| 533 |
+
|
| 534 |
+
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
|
| 535 |
+
// 'obj is PyFloat' is handled in the calling macro
|
| 536 |
+
double val;
|
| 537 |
+
if (PyLong_CheckExact(obj)) {
|
| 538 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 539 |
+
if (likely(__Pyx_PyLong_IsCompact(obj))) {
|
| 540 |
+
val = (double) __Pyx_PyLong_CompactValue(obj);
|
| 541 |
+
goto no_error;
|
| 542 |
+
}
|
| 543 |
+
#endif
|
| 544 |
+
val = PyLong_AsDouble(obj);
|
| 545 |
+
} else if (PyUnicode_CheckExact(obj)) {
|
| 546 |
+
val = __Pyx_PyUnicode_AsDouble(obj);
|
| 547 |
+
} else if (PyBytes_CheckExact(obj)) {
|
| 548 |
+
val = __Pyx_PyBytes_AsDouble(obj);
|
| 549 |
+
} else if (PyByteArray_CheckExact(obj)) {
|
| 550 |
+
val = __Pyx_PyByteArray_AsDouble(obj);
|
| 551 |
+
} else {
|
| 552 |
+
return PyNumber_Float(obj);
|
| 553 |
+
}
|
| 554 |
+
|
| 555 |
+
if (unlikely(val == -1 && PyErr_Occurred())) {
|
| 556 |
+
return NULL;
|
| 557 |
+
}
|
| 558 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 559 |
+
no_error:
|
| 560 |
+
#endif
|
| 561 |
+
return PyFloat_FromDouble(val);
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
/////////////// GCCDiagnostics.proto ///////////////
|
| 565 |
+
|
| 566 |
+
// GCC diagnostic pragmas were introduced in GCC 4.6
|
| 567 |
+
// Used to silence conversion warnings that are ok but cannot be avoided.
|
| 568 |
+
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
| 569 |
+
#define __Pyx_HAS_GCC_DIAGNOSTIC
|
| 570 |
+
#endif
|
| 571 |
+
|
| 572 |
+
|
| 573 |
+
/////////////// ToPyCTupleUtility.proto ///////////////
|
| 574 |
+
static PyObject* {{funcname}}({{struct_type_decl}});
|
| 575 |
+
|
| 576 |
+
/////////////// ToPyCTupleUtility ///////////////
|
| 577 |
+
static PyObject* {{funcname}}({{struct_type_decl}} value) {
|
| 578 |
+
PyObject* item = NULL;
|
| 579 |
+
PyObject* result = PyTuple_New({{size}});
|
| 580 |
+
if (!result) goto bad;
|
| 581 |
+
|
| 582 |
+
{{for ix, component in enumerate(components):}}
|
| 583 |
+
{{py:attr = "value.f%s" % ix}}
|
| 584 |
+
item = {{component.to_py_function}}({{attr}});
|
| 585 |
+
if (!item) goto bad;
|
| 586 |
+
PyTuple_SET_ITEM(result, {{ix}}, item);
|
| 587 |
+
{{endfor}}
|
| 588 |
+
|
| 589 |
+
return result;
|
| 590 |
+
bad:
|
| 591 |
+
Py_XDECREF(item);
|
| 592 |
+
Py_XDECREF(result);
|
| 593 |
+
return NULL;
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
|
| 597 |
+
/////////////// FromPyCTupleUtility.proto ///////////////
|
| 598 |
+
static CYTHON_INLINE {{struct_type_decl}} {{funcname}}(PyObject *);
|
| 599 |
+
|
| 600 |
+
/////////////// FromPyCTupleUtility ///////////////
|
| 601 |
+
|
| 602 |
+
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
| 603 |
+
static void __Pyx_tuple_{{funcname}}(PyObject * o, {{struct_type_decl}} *result) {
|
| 604 |
+
{{for ix, component in enumerate(components):}}
|
| 605 |
+
{{py:attr = "result->f%s" % ix}}
|
| 606 |
+
{{attr}} = {{component.from_py_function}}(PyTuple_GET_ITEM(o, {{ix}}));
|
| 607 |
+
if ({{component.error_condition(attr)}}) goto bad;
|
| 608 |
+
{{endfor}}
|
| 609 |
+
return;
|
| 610 |
+
bad:
|
| 611 |
+
return;
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
static void __Pyx_list_{{funcname}}(PyObject * o, {{struct_type_decl}} *result) {
|
| 615 |
+
{{for ix, component in enumerate(components):}}
|
| 616 |
+
{{py:attr = "result->f%s" % ix}}
|
| 617 |
+
{{attr}} = {{component.from_py_function}}(PyList_GET_ITEM(o, {{ix}}));
|
| 618 |
+
if ({{component.error_condition(attr)}}) goto bad;
|
| 619 |
+
{{endfor}}
|
| 620 |
+
return;
|
| 621 |
+
bad:
|
| 622 |
+
return;
|
| 623 |
+
}
|
| 624 |
+
#endif
|
| 625 |
+
|
| 626 |
+
static void __Pyx_seq_{{funcname}}(PyObject * o, {{struct_type_decl}} *result) {
|
| 627 |
+
if (unlikely(!PySequence_Check(o))) {
|
| 628 |
+
__Pyx_TypeName o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
|
| 629 |
+
PyErr_Format(PyExc_TypeError,
|
| 630 |
+
"Expected a sequence of size %zd, got " __Pyx_FMT_TYPENAME, (Py_ssize_t) {{size}}, o_type_name);
|
| 631 |
+
__Pyx_DECREF_TypeName(o_type_name);
|
| 632 |
+
goto bad;
|
| 633 |
+
} else if (unlikely(PySequence_Length(o) != {{size}})) {
|
| 634 |
+
PyErr_Format(PyExc_TypeError,
|
| 635 |
+
"Expected a sequence of size %zd, got size %zd", (Py_ssize_t) {{size}}, PySequence_Length(o));
|
| 636 |
+
goto bad;
|
| 637 |
+
}
|
| 638 |
+
|
| 639 |
+
{
|
| 640 |
+
PyObject *item;
|
| 641 |
+
{{for ix, component in enumerate(components):}}
|
| 642 |
+
{{py:attr = "result->f%s" % ix}}
|
| 643 |
+
item = PySequence_ITEM(o, {{ix}}); if (unlikely(!item)) goto bad;
|
| 644 |
+
{{attr}} = {{component.from_py_function}}(item);
|
| 645 |
+
Py_DECREF(item);
|
| 646 |
+
if ({{component.error_condition(attr)}}) goto bad;
|
| 647 |
+
{{endfor}}
|
| 648 |
+
}
|
| 649 |
+
return;
|
| 650 |
+
bad:
|
| 651 |
+
return;
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
+
static CYTHON_INLINE {{struct_type_decl}} {{funcname}}(PyObject * o) {
|
| 655 |
+
{{struct_type_decl}} result;
|
| 656 |
+
|
| 657 |
+
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
| 658 |
+
if (likely(PyTuple_Check(o) && PyTuple_GET_SIZE(o) == {{size}})) {
|
| 659 |
+
__Pyx_tuple_{{funcname}}(o, &result);
|
| 660 |
+
} else if (likely(PyList_Check(o) && PyList_GET_SIZE(o) == {{size}})) {
|
| 661 |
+
__Pyx_list_{{funcname}}(o, &result);
|
| 662 |
+
} else
|
| 663 |
+
#endif
|
| 664 |
+
{
|
| 665 |
+
__Pyx_seq_{{funcname}}(o, &result);
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
return result;
|
| 669 |
+
}
|
| 670 |
+
|
| 671 |
+
|
| 672 |
+
/////////////// UnicodeAsUCS4.proto ///////////////
|
| 673 |
+
|
| 674 |
+
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
|
| 675 |
+
|
| 676 |
+
/////////////// UnicodeAsUCS4 ///////////////
|
| 677 |
+
|
| 678 |
+
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
|
| 679 |
+
Py_ssize_t length;
|
| 680 |
+
#if CYTHON_PEP393_ENABLED
|
| 681 |
+
length = PyUnicode_GET_LENGTH(x);
|
| 682 |
+
if (likely(length == 1)) {
|
| 683 |
+
return PyUnicode_READ_CHAR(x, 0);
|
| 684 |
+
}
|
| 685 |
+
#else
|
| 686 |
+
length = PyUnicode_GET_SIZE(x);
|
| 687 |
+
if (likely(length == 1)) {
|
| 688 |
+
return PyUnicode_AS_UNICODE(x)[0];
|
| 689 |
+
}
|
| 690 |
+
#if Py_UNICODE_SIZE == 2
|
| 691 |
+
else if (PyUnicode_GET_SIZE(x) == 2) {
|
| 692 |
+
Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
|
| 693 |
+
if (high_val >= 0xD800 && high_val <= 0xDBFF) {
|
| 694 |
+
Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
|
| 695 |
+
if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
|
| 696 |
+
return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
|
| 697 |
+
}
|
| 698 |
+
}
|
| 699 |
+
}
|
| 700 |
+
#endif
|
| 701 |
+
#endif
|
| 702 |
+
PyErr_Format(PyExc_ValueError,
|
| 703 |
+
"only single character unicode strings can be converted to Py_UCS4, "
|
| 704 |
+
"got length %" CYTHON_FORMAT_SSIZE_T "d", length);
|
| 705 |
+
return (Py_UCS4)-1;
|
| 706 |
+
}
|
| 707 |
+
|
| 708 |
+
|
| 709 |
+
/////////////// ObjectAsUCS4.proto ///////////////
|
| 710 |
+
//@requires: UnicodeAsUCS4
|
| 711 |
+
|
| 712 |
+
#define __Pyx_PyObject_AsPy_UCS4(x) \
|
| 713 |
+
(likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x))
|
| 714 |
+
static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*);
|
| 715 |
+
|
| 716 |
+
/////////////// ObjectAsUCS4 ///////////////
|
| 717 |
+
|
| 718 |
+
static Py_UCS4 __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) {
|
| 719 |
+
if (ival < 0) {
|
| 720 |
+
if (!PyErr_Occurred())
|
| 721 |
+
PyErr_SetString(PyExc_OverflowError,
|
| 722 |
+
"cannot convert negative value to Py_UCS4");
|
| 723 |
+
} else {
|
| 724 |
+
PyErr_SetString(PyExc_OverflowError,
|
| 725 |
+
"value too large to convert to Py_UCS4");
|
| 726 |
+
}
|
| 727 |
+
return (Py_UCS4)-1;
|
| 728 |
+
}
|
| 729 |
+
|
| 730 |
+
static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) {
|
| 731 |
+
long ival;
|
| 732 |
+
ival = __Pyx_PyInt_As_long(x);
|
| 733 |
+
if (unlikely(!__Pyx_is_valid_index(ival, 1114111 + 1))) {
|
| 734 |
+
return __Pyx__PyObject_AsPy_UCS4_raise_error(ival);
|
| 735 |
+
}
|
| 736 |
+
return (Py_UCS4)ival;
|
| 737 |
+
}
|
| 738 |
+
|
| 739 |
+
|
| 740 |
+
/////////////// ObjectAsPyUnicode.proto ///////////////
|
| 741 |
+
|
| 742 |
+
static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject*);
|
| 743 |
+
|
| 744 |
+
/////////////// ObjectAsPyUnicode ///////////////
|
| 745 |
+
|
| 746 |
+
static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) {
|
| 747 |
+
long ival;
|
| 748 |
+
#if CYTHON_PEP393_ENABLED
|
| 749 |
+
#if Py_UNICODE_SIZE > 2
|
| 750 |
+
const long maxval = 1114111;
|
| 751 |
+
#else
|
| 752 |
+
const long maxval = 65535;
|
| 753 |
+
#endif
|
| 754 |
+
#else
|
| 755 |
+
static long maxval = 0;
|
| 756 |
+
#endif
|
| 757 |
+
if (PyUnicode_Check(x)) {
|
| 758 |
+
if (unlikely(__Pyx_PyUnicode_GET_LENGTH(x) != 1)) {
|
| 759 |
+
PyErr_Format(PyExc_ValueError,
|
| 760 |
+
"only single character unicode strings can be converted to Py_UNICODE, "
|
| 761 |
+
"got length %" CYTHON_FORMAT_SSIZE_T "d", __Pyx_PyUnicode_GET_LENGTH(x));
|
| 762 |
+
return (Py_UNICODE)-1;
|
| 763 |
+
}
|
| 764 |
+
#if CYTHON_PEP393_ENABLED
|
| 765 |
+
ival = PyUnicode_READ_CHAR(x, 0);
|
| 766 |
+
#else
|
| 767 |
+
return PyUnicode_AS_UNICODE(x)[0];
|
| 768 |
+
#endif
|
| 769 |
+
} else {
|
| 770 |
+
#if !CYTHON_PEP393_ENABLED
|
| 771 |
+
if (unlikely(!maxval))
|
| 772 |
+
maxval = (long)PyUnicode_GetMax();
|
| 773 |
+
#endif
|
| 774 |
+
ival = __Pyx_PyInt_As_long(x);
|
| 775 |
+
}
|
| 776 |
+
if (unlikely(!__Pyx_is_valid_index(ival, maxval + 1))) {
|
| 777 |
+
if (ival < 0) {
|
| 778 |
+
if (!PyErr_Occurred())
|
| 779 |
+
PyErr_SetString(PyExc_OverflowError,
|
| 780 |
+
"cannot convert negative value to Py_UNICODE");
|
| 781 |
+
return (Py_UNICODE)-1;
|
| 782 |
+
} else {
|
| 783 |
+
PyErr_SetString(PyExc_OverflowError,
|
| 784 |
+
"value too large to convert to Py_UNICODE");
|
| 785 |
+
}
|
| 786 |
+
return (Py_UNICODE)-1;
|
| 787 |
+
}
|
| 788 |
+
return (Py_UNICODE)ival;
|
| 789 |
+
}
|
| 790 |
+
|
| 791 |
+
|
| 792 |
+
/////////////// CIntToPy.proto ///////////////
|
| 793 |
+
|
| 794 |
+
static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value);
|
| 795 |
+
|
| 796 |
+
/////////////// CIntToPy ///////////////
|
| 797 |
+
//@requires: GCCDiagnostics
|
| 798 |
+
|
| 799 |
+
static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value) {
|
| 800 |
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
| 801 |
+
#pragma GCC diagnostic push
|
| 802 |
+
#pragma GCC diagnostic ignored "-Wconversion"
|
| 803 |
+
#endif
|
| 804 |
+
const {{TYPE}} neg_one = ({{TYPE}}) -1, const_zero = ({{TYPE}}) 0;
|
| 805 |
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
| 806 |
+
#pragma GCC diagnostic pop
|
| 807 |
+
#endif
|
| 808 |
+
const int is_unsigned = neg_one > const_zero;
|
| 809 |
+
if (is_unsigned) {
|
| 810 |
+
if (sizeof({{TYPE}}) < sizeof(long)) {
|
| 811 |
+
return PyInt_FromLong((long) value);
|
| 812 |
+
} else if (sizeof({{TYPE}}) <= sizeof(unsigned long)) {
|
| 813 |
+
return PyLong_FromUnsignedLong((unsigned long) value);
|
| 814 |
+
#ifdef HAVE_LONG_LONG
|
| 815 |
+
} else if (sizeof({{TYPE}}) <= sizeof(unsigned PY_LONG_LONG)) {
|
| 816 |
+
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
| 817 |
+
#endif
|
| 818 |
+
}
|
| 819 |
+
} else {
|
| 820 |
+
if (sizeof({{TYPE}}) <= sizeof(long)) {
|
| 821 |
+
return PyInt_FromLong((long) value);
|
| 822 |
+
#ifdef HAVE_LONG_LONG
|
| 823 |
+
} else if (sizeof({{TYPE}}) <= sizeof(PY_LONG_LONG)) {
|
| 824 |
+
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
| 825 |
+
#endif
|
| 826 |
+
}
|
| 827 |
+
}
|
| 828 |
+
{
|
| 829 |
+
unsigned char *bytes = (unsigned char *)&value;
|
| 830 |
+
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
|
| 831 |
+
if (is_unsigned) {
|
| 832 |
+
return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
|
| 833 |
+
} else {
|
| 834 |
+
return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
|
| 835 |
+
}
|
| 836 |
+
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
|
| 837 |
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
| 838 |
+
return _PyLong_FromByteArray(bytes, sizeof({{TYPE}}),
|
| 839 |
+
little, !is_unsigned);
|
| 840 |
+
#else
|
| 841 |
+
// call int.from_bytes()
|
| 842 |
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
| 843 |
+
PyObject *from_bytes, *result = NULL;
|
| 844 |
+
PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
|
| 845 |
+
from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
|
| 846 |
+
if (!from_bytes) return NULL;
|
| 847 |
+
py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof({{TYPE}}));
|
| 848 |
+
if (!py_bytes) goto limited_bad;
|
| 849 |
+
// I'm deliberately not using PYIDENT here because this code path is very unlikely
|
| 850 |
+
// to ever run so it seems a pessimization mostly.
|
| 851 |
+
order_str = PyUnicode_FromString(little ? "little" : "big");
|
| 852 |
+
if (!order_str) goto limited_bad;
|
| 853 |
+
arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
|
| 854 |
+
if (!arg_tuple) goto limited_bad;
|
| 855 |
+
if (!is_unsigned) {
|
| 856 |
+
// default is signed=False
|
| 857 |
+
kwds = PyDict_New();
|
| 858 |
+
if (!kwds) goto limited_bad;
|
| 859 |
+
if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
|
| 860 |
+
}
|
| 861 |
+
result = PyObject_Call(from_bytes, arg_tuple, kwds);
|
| 862 |
+
|
| 863 |
+
limited_bad:
|
| 864 |
+
Py_XDECREF(kwds);
|
| 865 |
+
Py_XDECREF(arg_tuple);
|
| 866 |
+
Py_XDECREF(order_str);
|
| 867 |
+
Py_XDECREF(py_bytes);
|
| 868 |
+
Py_XDECREF(from_bytes);
|
| 869 |
+
return result;
|
| 870 |
+
#endif
|
| 871 |
+
}
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
|
| 875 |
+
/////////////// CIntToDigits ///////////////
|
| 876 |
+
|
| 877 |
+
static const char DIGIT_PAIRS_10[2*10*10+1] = {
|
| 878 |
+
"00010203040506070809"
|
| 879 |
+
"10111213141516171819"
|
| 880 |
+
"20212223242526272829"
|
| 881 |
+
"30313233343536373839"
|
| 882 |
+
"40414243444546474849"
|
| 883 |
+
"50515253545556575859"
|
| 884 |
+
"60616263646566676869"
|
| 885 |
+
"70717273747576777879"
|
| 886 |
+
"80818283848586878889"
|
| 887 |
+
"90919293949596979899"
|
| 888 |
+
};
|
| 889 |
+
|
| 890 |
+
static const char DIGIT_PAIRS_8[2*8*8+1] = {
|
| 891 |
+
"0001020304050607"
|
| 892 |
+
"1011121314151617"
|
| 893 |
+
"2021222324252627"
|
| 894 |
+
"3031323334353637"
|
| 895 |
+
"4041424344454647"
|
| 896 |
+
"5051525354555657"
|
| 897 |
+
"6061626364656667"
|
| 898 |
+
"7071727374757677"
|
| 899 |
+
};
|
| 900 |
+
|
| 901 |
+
static const char DIGITS_HEX[2*16+1] = {
|
| 902 |
+
"0123456789abcdef"
|
| 903 |
+
"0123456789ABCDEF"
|
| 904 |
+
};
|
| 905 |
+
|
| 906 |
+
|
| 907 |
+
/////////////// CIntToPyUnicode.proto ///////////////
|
| 908 |
+
|
| 909 |
+
static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t width, char padding_char, char format_char);
|
| 910 |
+
|
| 911 |
+
/////////////// CIntToPyUnicode ///////////////
|
| 912 |
+
//@requires: StringTools.c::IncludeStringH
|
| 913 |
+
//@requires: StringTools.c::BuildPyUnicode
|
| 914 |
+
//@requires: CIntToDigits
|
| 915 |
+
//@requires: GCCDiagnostics
|
| 916 |
+
|
| 917 |
+
// NOTE: inlining because most arguments are constant, which collapses lots of code below
|
| 918 |
+
|
| 919 |
+
static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t width, char padding_char, char format_char) {
|
| 920 |
+
// simple and conservative C string allocation on the stack: each byte gives at most 3 digits, plus sign
|
| 921 |
+
char digits[sizeof({{TYPE}})*3+2];
|
| 922 |
+
// 'dpos' points to end of digits array + 1 initially to allow for pre-decrement looping
|
| 923 |
+
char *dpos, *end = digits + sizeof({{TYPE}})*3+2;
|
| 924 |
+
const char *hex_digits = DIGITS_HEX;
|
| 925 |
+
Py_ssize_t length, ulength;
|
| 926 |
+
int prepend_sign, last_one_off;
|
| 927 |
+
{{TYPE}} remaining;
|
| 928 |
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
| 929 |
+
#pragma GCC diagnostic push
|
| 930 |
+
#pragma GCC diagnostic ignored "-Wconversion"
|
| 931 |
+
#endif
|
| 932 |
+
const {{TYPE}} neg_one = ({{TYPE}}) -1, const_zero = ({{TYPE}}) 0;
|
| 933 |
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
| 934 |
+
#pragma GCC diagnostic pop
|
| 935 |
+
#endif
|
| 936 |
+
const int is_unsigned = neg_one > const_zero;
|
| 937 |
+
|
| 938 |
+
if (format_char == 'X') {
|
| 939 |
+
hex_digits += 16;
|
| 940 |
+
format_char = 'x';
|
| 941 |
+
}
|
| 942 |
+
|
| 943 |
+
// surprise: even trivial sprintf() calls don't get optimised in gcc (4.8)
|
| 944 |
+
remaining = value; /* not using abs(value) to avoid overflow problems */
|
| 945 |
+
last_one_off = 0;
|
| 946 |
+
dpos = end;
|
| 947 |
+
do {
|
| 948 |
+
int digit_pos;
|
| 949 |
+
switch (format_char) {
|
| 950 |
+
case 'o':
|
| 951 |
+
digit_pos = abs((int)(remaining % (8*8)));
|
| 952 |
+
remaining = ({{TYPE}}) (remaining / (8*8));
|
| 953 |
+
dpos -= 2;
|
| 954 |
+
memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); /* copy 2 digits at a time, unaligned */
|
| 955 |
+
last_one_off = (digit_pos < 8);
|
| 956 |
+
break;
|
| 957 |
+
case 'd':
|
| 958 |
+
digit_pos = abs((int)(remaining % (10*10)));
|
| 959 |
+
remaining = ({{TYPE}}) (remaining / (10*10));
|
| 960 |
+
dpos -= 2;
|
| 961 |
+
memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); /* copy 2 digits at a time, unaligned */
|
| 962 |
+
last_one_off = (digit_pos < 10);
|
| 963 |
+
break;
|
| 964 |
+
case 'x':
|
| 965 |
+
*(--dpos) = hex_digits[abs((int)(remaining % 16))];
|
| 966 |
+
remaining = ({{TYPE}}) (remaining / 16);
|
| 967 |
+
break;
|
| 968 |
+
default:
|
| 969 |
+
assert(0);
|
| 970 |
+
break;
|
| 971 |
+
}
|
| 972 |
+
} while (unlikely(remaining != 0));
|
| 973 |
+
|
| 974 |
+
// Correct dpos by 1 if we read an excess digit.
|
| 975 |
+
assert(!last_one_off || *dpos == '0');
|
| 976 |
+
dpos += last_one_off;
|
| 977 |
+
|
| 978 |
+
length = end - dpos;
|
| 979 |
+
ulength = length;
|
| 980 |
+
prepend_sign = 0;
|
| 981 |
+
if (!is_unsigned && value <= neg_one) {
|
| 982 |
+
if (padding_char == ' ' || width <= length + 1) {
|
| 983 |
+
*(--dpos) = '-';
|
| 984 |
+
++length;
|
| 985 |
+
} else {
|
| 986 |
+
prepend_sign = 1;
|
| 987 |
+
}
|
| 988 |
+
++ulength;
|
| 989 |
+
}
|
| 990 |
+
if (width > ulength) {
|
| 991 |
+
ulength = width;
|
| 992 |
+
}
|
| 993 |
+
// single character unicode strings are cached in CPython => use PyUnicode_FromOrdinal() for them
|
| 994 |
+
if (ulength == 1) {
|
| 995 |
+
return PyUnicode_FromOrdinal(*dpos);
|
| 996 |
+
}
|
| 997 |
+
return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
|
| 998 |
+
}
|
| 999 |
+
|
| 1000 |
+
|
| 1001 |
+
/////////////// CBIntToPyUnicode.proto ///////////////
|
| 1002 |
+
|
| 1003 |
+
#define {{TO_PY_FUNCTION}}(value) \
|
| 1004 |
+
((value) ? __Pyx_NewRef({{TRUE_CONST}}) : __Pyx_NewRef({{FALSE_CONST}}))
|
| 1005 |
+
|
| 1006 |
+
|
| 1007 |
+
/////////////// PyIntFromDouble.proto ///////////////
|
| 1008 |
+
|
| 1009 |
+
#if PY_MAJOR_VERSION < 3
|
| 1010 |
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value);
|
| 1011 |
+
#else
|
| 1012 |
+
#define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
|
| 1013 |
+
#endif
|
| 1014 |
+
|
| 1015 |
+
/////////////// PyIntFromDouble ///////////////
|
| 1016 |
+
|
| 1017 |
+
#if PY_MAJOR_VERSION < 3
|
| 1018 |
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) {
|
| 1019 |
+
if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) {
|
| 1020 |
+
return PyInt_FromLong((long)value);
|
| 1021 |
+
}
|
| 1022 |
+
return PyLong_FromDouble(value);
|
| 1023 |
+
}
|
| 1024 |
+
#endif
|
| 1025 |
+
|
| 1026 |
+
|
| 1027 |
+
/////////////// CIntFromPyVerify ///////////////
|
| 1028 |
+
|
| 1029 |
+
// see CIntFromPy
|
| 1030 |
+
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \
|
| 1031 |
+
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
|
| 1032 |
+
|
| 1033 |
+
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value) \
|
| 1034 |
+
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
|
| 1035 |
+
|
| 1036 |
+
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc) \
|
| 1037 |
+
{ \
|
| 1038 |
+
func_type value = func_value; \
|
| 1039 |
+
if (sizeof(target_type) < sizeof(func_type)) { \
|
| 1040 |
+
if (unlikely(value != (func_type) (target_type) value)) { \
|
| 1041 |
+
func_type zero = 0; \
|
| 1042 |
+
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred())) \
|
| 1043 |
+
return (target_type) -1; \
|
| 1044 |
+
if (is_unsigned && unlikely(value < zero)) \
|
| 1045 |
+
goto raise_neg_overflow; \
|
| 1046 |
+
else \
|
| 1047 |
+
goto raise_overflow; \
|
| 1048 |
+
} \
|
| 1049 |
+
} \
|
| 1050 |
+
return (target_type) value; \
|
| 1051 |
+
}
|
| 1052 |
+
|
| 1053 |
+
|
| 1054 |
+
/////////////// CIntFromPy.proto ///////////////
|
| 1055 |
+
|
| 1056 |
+
static CYTHON_INLINE {{TYPE}} {{FROM_PY_FUNCTION}}(PyObject *);
|
| 1057 |
+
|
| 1058 |
+
/////////////// CIntFromPy ///////////////
|
| 1059 |
+
//@requires: CIntFromPyVerify
|
| 1060 |
+
//@requires: GCCDiagnostics
|
| 1061 |
+
|
| 1062 |
+
{{py: from Cython.Utility import pylong_join }}
|
| 1063 |
+
|
| 1064 |
+
static CYTHON_INLINE {{TYPE}} {{FROM_PY_FUNCTION}}(PyObject *x) {
|
| 1065 |
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
| 1066 |
+
#pragma GCC diagnostic push
|
| 1067 |
+
#pragma GCC diagnostic ignored "-Wconversion"
|
| 1068 |
+
#endif
|
| 1069 |
+
const {{TYPE}} neg_one = ({{TYPE}}) -1, const_zero = ({{TYPE}}) 0;
|
| 1070 |
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
| 1071 |
+
#pragma GCC diagnostic pop
|
| 1072 |
+
#endif
|
| 1073 |
+
const int is_unsigned = neg_one > const_zero;
|
| 1074 |
+
#if PY_MAJOR_VERSION < 3
|
| 1075 |
+
if (likely(PyInt_Check(x))) {
|
| 1076 |
+
if ((sizeof({{TYPE}}) < sizeof(long))) {
|
| 1077 |
+
__PYX_VERIFY_RETURN_INT({{TYPE}}, long, PyInt_AS_LONG(x))
|
| 1078 |
+
} else {
|
| 1079 |
+
long val = PyInt_AS_LONG(x);
|
| 1080 |
+
if (is_unsigned && unlikely(val < 0)) {
|
| 1081 |
+
goto raise_neg_overflow;
|
| 1082 |
+
}
|
| 1083 |
+
return ({{TYPE}}) val;
|
| 1084 |
+
}
|
| 1085 |
+
}
|
| 1086 |
+
#endif
|
| 1087 |
+
|
| 1088 |
+
if (unlikely(!PyLong_Check(x))) {
|
| 1089 |
+
{{TYPE}} val;
|
| 1090 |
+
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
| 1091 |
+
if (!tmp) return ({{TYPE}}) -1;
|
| 1092 |
+
val = {{FROM_PY_FUNCTION}}(tmp);
|
| 1093 |
+
Py_DECREF(tmp);
|
| 1094 |
+
return val;
|
| 1095 |
+
}
|
| 1096 |
+
|
| 1097 |
+
if (is_unsigned) {
|
| 1098 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1099 |
+
if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
| 1100 |
+
goto raise_neg_overflow;
|
| 1101 |
+
//} else if (__Pyx_PyLong_IsZero(x)) {
|
| 1102 |
+
// return ({{TYPE}}) 0;
|
| 1103 |
+
} else if (__Pyx_PyLong_IsCompact(x)) {
|
| 1104 |
+
__PYX_VERIFY_RETURN_INT({{TYPE}}, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
| 1105 |
+
} else {
|
| 1106 |
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
| 1107 |
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
| 1108 |
+
switch (__Pyx_PyLong_DigitCount(x)) {
|
| 1109 |
+
{{for _size in (2, 3, 4)}}
|
| 1110 |
+
case {{_size}}:
|
| 1111 |
+
if ((8 * sizeof({{TYPE}}) > {{_size-1}} * PyLong_SHIFT)) {
|
| 1112 |
+
if ((8 * sizeof(unsigned long) > {{_size}} * PyLong_SHIFT)) {
|
| 1113 |
+
__PYX_VERIFY_RETURN_INT({{TYPE}}, unsigned long, {{pylong_join(_size, 'digits')}})
|
| 1114 |
+
} else if ((8 * sizeof({{TYPE}}) >= {{_size}} * PyLong_SHIFT)) {
|
| 1115 |
+
return ({{TYPE}}) {{pylong_join(_size, 'digits', TYPE)}};
|
| 1116 |
+
}
|
| 1117 |
+
}
|
| 1118 |
+
break;
|
| 1119 |
+
{{endfor}}
|
| 1120 |
+
}
|
| 1121 |
+
}
|
| 1122 |
+
#endif
|
| 1123 |
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
| 1124 |
+
if (unlikely(Py_SIZE(x) < 0)) {
|
| 1125 |
+
goto raise_neg_overflow;
|
| 1126 |
+
}
|
| 1127 |
+
#else
|
| 1128 |
+
{
|
| 1129 |
+
// misuse Py_False as a quick way to compare to a '0' int object in PyPy
|
| 1130 |
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
| 1131 |
+
if (unlikely(result < 0))
|
| 1132 |
+
return ({{TYPE}}) -1;
|
| 1133 |
+
if (unlikely(result == 1))
|
| 1134 |
+
goto raise_neg_overflow;
|
| 1135 |
+
}
|
| 1136 |
+
#endif
|
| 1137 |
+
if ((sizeof({{TYPE}}) <= sizeof(unsigned long))) {
|
| 1138 |
+
__PYX_VERIFY_RETURN_INT_EXC({{TYPE}}, unsigned long, PyLong_AsUnsignedLong(x))
|
| 1139 |
+
#ifdef HAVE_LONG_LONG
|
| 1140 |
+
} else if ((sizeof({{TYPE}}) <= sizeof(unsigned PY_LONG_LONG))) {
|
| 1141 |
+
__PYX_VERIFY_RETURN_INT_EXC({{TYPE}}, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
| 1142 |
+
#endif
|
| 1143 |
+
}
|
| 1144 |
+
|
| 1145 |
+
} else {
|
| 1146 |
+
// signed
|
| 1147 |
+
#if CYTHON_USE_PYLONG_INTERNALS
|
| 1148 |
+
if (__Pyx_PyLong_IsCompact(x)) {
|
| 1149 |
+
__PYX_VERIFY_RETURN_INT({{TYPE}}, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
| 1150 |
+
} else {
|
| 1151 |
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
| 1152 |
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
| 1153 |
+
switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
| 1154 |
+
{{for _size in (2, 3, 4)}}
|
| 1155 |
+
{{for _case in (-_size, _size)}}
|
| 1156 |
+
case {{_case}}:
|
| 1157 |
+
if ((8 * sizeof({{TYPE}}){{' - 1' if _case < 0 else ''}} > {{_size-1}} * PyLong_SHIFT)) {
|
| 1158 |
+
if ((8 * sizeof(unsigned long) > {{_size}} * PyLong_SHIFT)) {
|
| 1159 |
+
__PYX_VERIFY_RETURN_INT({{TYPE}}, {{'long' if _case < 0 else 'unsigned long'}}, {{'-(long) ' if _case < 0 else ''}}{{pylong_join(_size, 'digits')}})
|
| 1160 |
+
} else if ((8 * sizeof({{TYPE}}) - 1 > {{_size}} * PyLong_SHIFT)) {
|
| 1161 |
+
return ({{TYPE}}) ({{'((%s)-1)*' % TYPE if _case < 0 else ''}}{{pylong_join(_size, 'digits', TYPE)}});
|
| 1162 |
+
}
|
| 1163 |
+
}
|
| 1164 |
+
break;
|
| 1165 |
+
{{endfor}}
|
| 1166 |
+
{{endfor}}
|
| 1167 |
+
}
|
| 1168 |
+
}
|
| 1169 |
+
#endif
|
| 1170 |
+
if ((sizeof({{TYPE}}) <= sizeof(long))) {
|
| 1171 |
+
__PYX_VERIFY_RETURN_INT_EXC({{TYPE}}, long, PyLong_AsLong(x))
|
| 1172 |
+
#ifdef HAVE_LONG_LONG
|
| 1173 |
+
} else if ((sizeof({{TYPE}}) <= sizeof(PY_LONG_LONG))) {
|
| 1174 |
+
__PYX_VERIFY_RETURN_INT_EXC({{TYPE}}, PY_LONG_LONG, PyLong_AsLongLong(x))
|
| 1175 |
+
#endif
|
| 1176 |
+
}
|
| 1177 |
+
}
|
| 1178 |
+
|
| 1179 |
+
// large integer type and no access to PyLong internals => allow for a more expensive conversion
|
| 1180 |
+
{
|
| 1181 |
+
{{TYPE}} val;
|
| 1182 |
+
int ret = -1;
|
| 1183 |
+
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
| 1184 |
+
Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
| 1185 |
+
x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
| 1186 |
+
if (unlikely(bytes_copied == -1)) {
|
| 1187 |
+
// failed
|
| 1188 |
+
} else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
| 1189 |
+
goto raise_overflow;
|
| 1190 |
+
} else {
|
| 1191 |
+
ret = 0;
|
| 1192 |
+
}
|
| 1193 |
+
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
| 1194 |
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
| 1195 |
+
unsigned char *bytes = (unsigned char *)&val;
|
| 1196 |
+
ret = _PyLong_AsByteArray((PyLongObject *)x,
|
| 1197 |
+
bytes, sizeof(val),
|
| 1198 |
+
is_little, !is_unsigned);
|
| 1199 |
+
#else
|
| 1200 |
+
{{if IS_ENUM}}
|
| 1201 |
+
// The fallback implementation uses math operations like shifting, which do not work well with enums.
|
| 1202 |
+
PyErr_SetString(PyExc_RuntimeError,
|
| 1203 |
+
"_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
|
| 1204 |
+
val = ({{TYPE}}) -1;
|
| 1205 |
+
{{else}}
|
| 1206 |
+
// Inefficient copy of bit chunks through the C-API. Probably still better than a "cannot do this" exception.
|
| 1207 |
+
// This is substantially faster in CPython (>30%) than calling "int.to_bytes()" through the C-API.
|
| 1208 |
+
PyObject *v;
|
| 1209 |
+
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
| 1210 |
+
int bits, remaining_bits, is_negative = 0;
|
| 1211 |
+
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
| 1212 |
+
|
| 1213 |
+
// Use exact PyLong to prevent user defined &&/<</etc. implementations (and make Py_SIZE() work below).
|
| 1214 |
+
if (likely(PyLong_CheckExact(x))) {
|
| 1215 |
+
v = __Pyx_NewRef(x);
|
| 1216 |
+
} else {
|
| 1217 |
+
v = PyNumber_Long(x);
|
| 1218 |
+
if (unlikely(!v)) return ({{TYPE}}) -1;
|
| 1219 |
+
assert(PyLong_CheckExact(v));
|
| 1220 |
+
}
|
| 1221 |
+
|
| 1222 |
+
// Misuse Py_False as a quick way to compare to a '0' int object.
|
| 1223 |
+
{
|
| 1224 |
+
int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
| 1225 |
+
if (unlikely(result < 0)) {
|
| 1226 |
+
Py_DECREF(v);
|
| 1227 |
+
return ({{TYPE}}) -1;
|
| 1228 |
+
}
|
| 1229 |
+
is_negative = result == 1;
|
| 1230 |
+
}
|
| 1231 |
+
|
| 1232 |
+
if (is_unsigned && unlikely(is_negative)) {
|
| 1233 |
+
Py_DECREF(v);
|
| 1234 |
+
goto raise_neg_overflow;
|
| 1235 |
+
} else if (is_negative) {
|
| 1236 |
+
// bit-invert to make sure we can safely convert it
|
| 1237 |
+
stepval = PyNumber_Invert(v);
|
| 1238 |
+
Py_DECREF(v);
|
| 1239 |
+
if (unlikely(!stepval))
|
| 1240 |
+
return ({{TYPE}}) -1;
|
| 1241 |
+
} else {
|
| 1242 |
+
stepval = v;
|
| 1243 |
+
}
|
| 1244 |
+
v = NULL;
|
| 1245 |
+
|
| 1246 |
+
// Unpack full chunks of bits.
|
| 1247 |
+
val = ({{TYPE}}) 0;
|
| 1248 |
+
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
| 1249 |
+
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
| 1250 |
+
for (bits = 0; bits < (int) sizeof({{TYPE}}) * 8 - chunk_size; bits += chunk_size) {
|
| 1251 |
+
PyObject *tmp, *digit;
|
| 1252 |
+
long idigit;
|
| 1253 |
+
|
| 1254 |
+
digit = PyNumber_And(stepval, mask);
|
| 1255 |
+
if (unlikely(!digit)) goto done;
|
| 1256 |
+
|
| 1257 |
+
idigit = PyLong_AsLong(digit);
|
| 1258 |
+
Py_DECREF(digit);
|
| 1259 |
+
if (unlikely(idigit < 0)) goto done;
|
| 1260 |
+
val |= (({{TYPE}}) idigit) << bits;
|
| 1261 |
+
|
| 1262 |
+
tmp = PyNumber_Rshift(stepval, shift);
|
| 1263 |
+
if (unlikely(!tmp)) goto done;
|
| 1264 |
+
Py_DECREF(stepval); stepval = tmp;
|
| 1265 |
+
}
|
| 1266 |
+
|
| 1267 |
+
Py_DECREF(shift); shift = NULL;
|
| 1268 |
+
Py_DECREF(mask); mask = NULL;
|
| 1269 |
+
|
| 1270 |
+
// Add the last bits and detect overflow.
|
| 1271 |
+
{
|
| 1272 |
+
long idigit = PyLong_AsLong(stepval);
|
| 1273 |
+
if (unlikely(idigit < 0)) goto done;
|
| 1274 |
+
remaining_bits = ((int) sizeof({{TYPE}}) * 8) - bits - (is_unsigned ? 0 : 1);
|
| 1275 |
+
if (unlikely(idigit >= (1L << remaining_bits)))
|
| 1276 |
+
goto raise_overflow;
|
| 1277 |
+
val |= (({{TYPE}}) idigit) << bits;
|
| 1278 |
+
}
|
| 1279 |
+
|
| 1280 |
+
// Handle sign and overflow into sign bit.
|
| 1281 |
+
if (!is_unsigned) {
|
| 1282 |
+
// gcc warns about unsigned (val < 0) => test sign bit instead
|
| 1283 |
+
if (unlikely(val & ((({{TYPE}}) 1) << (sizeof({{TYPE}}) * 8 - 1))))
|
| 1284 |
+
goto raise_overflow;
|
| 1285 |
+
// undo the PyNumber_Invert() above
|
| 1286 |
+
if (is_negative)
|
| 1287 |
+
val = ~val;
|
| 1288 |
+
}
|
| 1289 |
+
ret = 0;
|
| 1290 |
+
done:
|
| 1291 |
+
Py_XDECREF(shift);
|
| 1292 |
+
Py_XDECREF(mask);
|
| 1293 |
+
Py_XDECREF(stepval);
|
| 1294 |
+
{{endif}}
|
| 1295 |
+
#endif
|
| 1296 |
+
if (unlikely(ret))
|
| 1297 |
+
return ({{TYPE}}) -1;
|
| 1298 |
+
return val;
|
| 1299 |
+
}
|
| 1300 |
+
|
| 1301 |
+
raise_overflow:
|
| 1302 |
+
PyErr_SetString(PyExc_OverflowError,
|
| 1303 |
+
"value too large to convert to {{TYPE}}");
|
| 1304 |
+
return ({{TYPE}}) -1;
|
| 1305 |
+
|
| 1306 |
+
raise_neg_overflow:
|
| 1307 |
+
PyErr_SetString(PyExc_OverflowError,
|
| 1308 |
+
"can't convert negative value to {{TYPE}}");
|
| 1309 |
+
return ({{TYPE}}) -1;
|
| 1310 |
+
}
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/Cython/Utility/arrayarray.h
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/////////////// ArrayAPI.proto ///////////////
|
| 2 |
+
|
| 3 |
+
// arrayarray.h
|
| 4 |
+
//
|
| 5 |
+
// Artificial C-API for Python's <array.array> type,
|
| 6 |
+
// used by array.pxd
|
| 7 |
+
//
|
| 8 |
+
// last changes: 2009-05-15 rk
|
| 9 |
+
// 2012-05-02 andreasvc
|
| 10 |
+
// (see revision control)
|
| 11 |
+
//
|
| 12 |
+
|
| 13 |
+
#ifndef _ARRAYARRAY_H
|
| 14 |
+
#define _ARRAYARRAY_H
|
| 15 |
+
|
| 16 |
+
// These two forward declarations are explicitly handled in the type
|
| 17 |
+
// declaration code, as including them here is too late for cython-defined
|
| 18 |
+
// types to use them.
|
| 19 |
+
// struct arrayobject;
|
| 20 |
+
// typedef struct arrayobject arrayobject;
|
| 21 |
+
|
| 22 |
+
// All possible arraydescr values are defined in the vector "descriptors"
|
| 23 |
+
// below. That's defined later because the appropriate get and set
|
| 24 |
+
// functions aren't visible yet.
|
| 25 |
+
typedef struct arraydescr {
|
| 26 |
+
int typecode;
|
| 27 |
+
int itemsize;
|
| 28 |
+
PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
|
| 29 |
+
int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
|
| 30 |
+
#if PY_MAJOR_VERSION >= 3
|
| 31 |
+
char *formats;
|
| 32 |
+
#endif
|
| 33 |
+
} arraydescr;
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
struct arrayobject {
|
| 37 |
+
PyObject_HEAD
|
| 38 |
+
Py_ssize_t ob_size;
|
| 39 |
+
union {
|
| 40 |
+
char *ob_item;
|
| 41 |
+
float *as_floats;
|
| 42 |
+
double *as_doubles;
|
| 43 |
+
int *as_ints;
|
| 44 |
+
unsigned int *as_uints;
|
| 45 |
+
unsigned char *as_uchars;
|
| 46 |
+
signed char *as_schars;
|
| 47 |
+
char *as_chars;
|
| 48 |
+
unsigned long *as_ulongs;
|
| 49 |
+
long *as_longs;
|
| 50 |
+
#if PY_MAJOR_VERSION >= 3
|
| 51 |
+
unsigned long long *as_ulonglongs;
|
| 52 |
+
long long *as_longlongs;
|
| 53 |
+
#endif
|
| 54 |
+
short *as_shorts;
|
| 55 |
+
unsigned short *as_ushorts;
|
| 56 |
+
Py_UNICODE *as_pyunicodes;
|
| 57 |
+
void *as_voidptr;
|
| 58 |
+
} data;
|
| 59 |
+
Py_ssize_t allocated;
|
| 60 |
+
struct arraydescr *ob_descr;
|
| 61 |
+
PyObject *weakreflist; /* List of weak references */
|
| 62 |
+
#if PY_MAJOR_VERSION >= 3
|
| 63 |
+
int ob_exports; /* Number of exported buffers */
|
| 64 |
+
#endif
|
| 65 |
+
};
|
| 66 |
+
|
| 67 |
+
#ifndef NO_NEWARRAY_INLINE
|
| 68 |
+
// fast creation of a new array
|
| 69 |
+
static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
|
| 70 |
+
struct arraydescr *descr) {
|
| 71 |
+
arrayobject *op;
|
| 72 |
+
size_t nbytes;
|
| 73 |
+
|
| 74 |
+
if (size < 0) {
|
| 75 |
+
PyErr_BadInternalCall();
|
| 76 |
+
return NULL;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
nbytes = size * descr->itemsize;
|
| 80 |
+
// Check for overflow
|
| 81 |
+
if (nbytes / descr->itemsize != (size_t)size) {
|
| 82 |
+
return PyErr_NoMemory();
|
| 83 |
+
}
|
| 84 |
+
op = (arrayobject *) type->tp_alloc(type, 0);
|
| 85 |
+
if (op == NULL) {
|
| 86 |
+
return NULL;
|
| 87 |
+
}
|
| 88 |
+
op->ob_descr = descr;
|
| 89 |
+
op->allocated = size;
|
| 90 |
+
op->weakreflist = NULL;
|
| 91 |
+
__Pyx_SET_SIZE(op, size);
|
| 92 |
+
if (size <= 0) {
|
| 93 |
+
op->data.ob_item = NULL;
|
| 94 |
+
}
|
| 95 |
+
else {
|
| 96 |
+
op->data.ob_item = PyMem_NEW(char, nbytes);
|
| 97 |
+
if (op->data.ob_item == NULL) {
|
| 98 |
+
Py_DECREF(op);
|
| 99 |
+
return PyErr_NoMemory();
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
return (PyObject *) op;
|
| 103 |
+
}
|
| 104 |
+
#else
|
| 105 |
+
PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
|
| 106 |
+
struct arraydescr *descr);
|
| 107 |
+
#endif /* ifndef NO_NEWARRAY_INLINE */
|
| 108 |
+
|
| 109 |
+
// fast resize (reallocation to the point)
|
| 110 |
+
// not designed for filing small increments (but for fast opaque array apps)
|
| 111 |
+
static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
|
| 112 |
+
void *items = (void*) self->data.ob_item;
|
| 113 |
+
PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
|
| 114 |
+
if (items == NULL) {
|
| 115 |
+
PyErr_NoMemory();
|
| 116 |
+
return -1;
|
| 117 |
+
}
|
| 118 |
+
self->data.ob_item = (char*) items;
|
| 119 |
+
__Pyx_SET_SIZE(self, n);
|
| 120 |
+
self->allocated = n;
|
| 121 |
+
return 0;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
// suitable for small increments; over allocation 50% ;
|
| 125 |
+
static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
|
| 126 |
+
void *items = (void*) self->data.ob_item;
|
| 127 |
+
Py_ssize_t newsize;
|
| 128 |
+
if (n < self->allocated && n*4 > self->allocated) {
|
| 129 |
+
__Pyx_SET_SIZE(self, n);
|
| 130 |
+
return 0;
|
| 131 |
+
}
|
| 132 |
+
newsize = n + (n / 2) + 1;
|
| 133 |
+
if (newsize <= n) { /* overflow */
|
| 134 |
+
PyErr_NoMemory();
|
| 135 |
+
return -1;
|
| 136 |
+
}
|
| 137 |
+
PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
|
| 138 |
+
if (items == NULL) {
|
| 139 |
+
PyErr_NoMemory();
|
| 140 |
+
return -1;
|
| 141 |
+
}
|
| 142 |
+
self->data.ob_item = (char*) items;
|
| 143 |
+
__Pyx_SET_SIZE(self, n);
|
| 144 |
+
self->allocated = newsize;
|
| 145 |
+
return 0;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
#endif
|
| 149 |
+
/* _ARRAYARRAY_H */
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/RECORD
ADDED
|
@@ -0,0 +1,1137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
networkx-3.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
networkx-3.2.1.dist-info/LICENSE.txt,sha256=ULWifLQ_eiDO3nqnuasgM1UuBBLJof3lHTiIXBQX6V8,1763
|
| 3 |
+
networkx-3.2.1.dist-info/METADATA,sha256=tEByL1NhNlpdXiGfQDexQA_h5H6sFB1UMtQUJwDr3xQ,5232
|
| 4 |
+
networkx-3.2.1.dist-info/RECORD,,
|
| 5 |
+
networkx-3.2.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
| 6 |
+
networkx-3.2.1.dist-info/entry_points.txt,sha256=b0FW-zm-m9itB-Zkm7w_8c9yX9WGGTg-r_N_A32PAGs,87
|
| 7 |
+
networkx-3.2.1.dist-info/top_level.txt,sha256=s3Mk-7KOlu-kD39w8Xg_KXoP5Z_MVvgB-upkyuOE4Hk,9
|
| 8 |
+
networkx/__init__.py,sha256=WwK4KM7w30c5F2xUgs4N0ylwaixla1rJ-4qThcPnjho,1091
|
| 9 |
+
networkx/__pycache__/__init__.cpython-311.pyc,,
|
| 10 |
+
networkx/__pycache__/conftest.cpython-311.pyc,,
|
| 11 |
+
networkx/__pycache__/convert.cpython-311.pyc,,
|
| 12 |
+
networkx/__pycache__/convert_matrix.cpython-311.pyc,,
|
| 13 |
+
networkx/__pycache__/exception.cpython-311.pyc,,
|
| 14 |
+
networkx/__pycache__/lazy_imports.cpython-311.pyc,,
|
| 15 |
+
networkx/__pycache__/relabel.cpython-311.pyc,,
|
| 16 |
+
networkx/algorithms/__init__.py,sha256=Rz_AEhB6u0naGx7ejzbvXrMXixWM47ydmjnGOuofzqo,6512
|
| 17 |
+
networkx/algorithms/__pycache__/__init__.cpython-311.pyc,,
|
| 18 |
+
networkx/algorithms/__pycache__/asteroidal.cpython-311.pyc,,
|
| 19 |
+
networkx/algorithms/__pycache__/boundary.cpython-311.pyc,,
|
| 20 |
+
networkx/algorithms/__pycache__/bridges.cpython-311.pyc,,
|
| 21 |
+
networkx/algorithms/__pycache__/chains.cpython-311.pyc,,
|
| 22 |
+
networkx/algorithms/__pycache__/chordal.cpython-311.pyc,,
|
| 23 |
+
networkx/algorithms/__pycache__/clique.cpython-311.pyc,,
|
| 24 |
+
networkx/algorithms/__pycache__/cluster.cpython-311.pyc,,
|
| 25 |
+
networkx/algorithms/__pycache__/communicability_alg.cpython-311.pyc,,
|
| 26 |
+
networkx/algorithms/__pycache__/core.cpython-311.pyc,,
|
| 27 |
+
networkx/algorithms/__pycache__/covering.cpython-311.pyc,,
|
| 28 |
+
networkx/algorithms/__pycache__/cuts.cpython-311.pyc,,
|
| 29 |
+
networkx/algorithms/__pycache__/cycles.cpython-311.pyc,,
|
| 30 |
+
networkx/algorithms/__pycache__/d_separation.cpython-311.pyc,,
|
| 31 |
+
networkx/algorithms/__pycache__/dag.cpython-311.pyc,,
|
| 32 |
+
networkx/algorithms/__pycache__/distance_measures.cpython-311.pyc,,
|
| 33 |
+
networkx/algorithms/__pycache__/distance_regular.cpython-311.pyc,,
|
| 34 |
+
networkx/algorithms/__pycache__/dominance.cpython-311.pyc,,
|
| 35 |
+
networkx/algorithms/__pycache__/dominating.cpython-311.pyc,,
|
| 36 |
+
networkx/algorithms/__pycache__/efficiency_measures.cpython-311.pyc,,
|
| 37 |
+
networkx/algorithms/__pycache__/euler.cpython-311.pyc,,
|
| 38 |
+
networkx/algorithms/__pycache__/graph_hashing.cpython-311.pyc,,
|
| 39 |
+
networkx/algorithms/__pycache__/graphical.cpython-311.pyc,,
|
| 40 |
+
networkx/algorithms/__pycache__/hierarchy.cpython-311.pyc,,
|
| 41 |
+
networkx/algorithms/__pycache__/hybrid.cpython-311.pyc,,
|
| 42 |
+
networkx/algorithms/__pycache__/isolate.cpython-311.pyc,,
|
| 43 |
+
networkx/algorithms/__pycache__/link_prediction.cpython-311.pyc,,
|
| 44 |
+
networkx/algorithms/__pycache__/lowest_common_ancestors.cpython-311.pyc,,
|
| 45 |
+
networkx/algorithms/__pycache__/matching.cpython-311.pyc,,
|
| 46 |
+
networkx/algorithms/__pycache__/mis.cpython-311.pyc,,
|
| 47 |
+
networkx/algorithms/__pycache__/moral.cpython-311.pyc,,
|
| 48 |
+
networkx/algorithms/__pycache__/node_classification.cpython-311.pyc,,
|
| 49 |
+
networkx/algorithms/__pycache__/non_randomness.cpython-311.pyc,,
|
| 50 |
+
networkx/algorithms/__pycache__/planar_drawing.cpython-311.pyc,,
|
| 51 |
+
networkx/algorithms/__pycache__/planarity.cpython-311.pyc,,
|
| 52 |
+
networkx/algorithms/__pycache__/polynomials.cpython-311.pyc,,
|
| 53 |
+
networkx/algorithms/__pycache__/reciprocity.cpython-311.pyc,,
|
| 54 |
+
networkx/algorithms/__pycache__/regular.cpython-311.pyc,,
|
| 55 |
+
networkx/algorithms/__pycache__/richclub.cpython-311.pyc,,
|
| 56 |
+
networkx/algorithms/__pycache__/similarity.cpython-311.pyc,,
|
| 57 |
+
networkx/algorithms/__pycache__/simple_paths.cpython-311.pyc,,
|
| 58 |
+
networkx/algorithms/__pycache__/smallworld.cpython-311.pyc,,
|
| 59 |
+
networkx/algorithms/__pycache__/smetric.cpython-311.pyc,,
|
| 60 |
+
networkx/algorithms/__pycache__/sparsifiers.cpython-311.pyc,,
|
| 61 |
+
networkx/algorithms/__pycache__/structuralholes.cpython-311.pyc,,
|
| 62 |
+
networkx/algorithms/__pycache__/summarization.cpython-311.pyc,,
|
| 63 |
+
networkx/algorithms/__pycache__/swap.cpython-311.pyc,,
|
| 64 |
+
networkx/algorithms/__pycache__/threshold.cpython-311.pyc,,
|
| 65 |
+
networkx/algorithms/__pycache__/time_dependent.cpython-311.pyc,,
|
| 66 |
+
networkx/algorithms/__pycache__/tournament.cpython-311.pyc,,
|
| 67 |
+
networkx/algorithms/__pycache__/triads.cpython-311.pyc,,
|
| 68 |
+
networkx/algorithms/__pycache__/vitality.cpython-311.pyc,,
|
| 69 |
+
networkx/algorithms/__pycache__/voronoi.cpython-311.pyc,,
|
| 70 |
+
networkx/algorithms/__pycache__/walks.cpython-311.pyc,,
|
| 71 |
+
networkx/algorithms/__pycache__/wiener.cpython-311.pyc,,
|
| 72 |
+
networkx/algorithms/approximation/__init__.py,sha256=zf9NM64g-aZwEGqI5C0DpU5FML2GrkaaQsO6SW85atE,1177
|
| 73 |
+
networkx/algorithms/approximation/__pycache__/__init__.cpython-311.pyc,,
|
| 74 |
+
networkx/algorithms/approximation/__pycache__/clique.cpython-311.pyc,,
|
| 75 |
+
networkx/algorithms/approximation/__pycache__/clustering_coefficient.cpython-311.pyc,,
|
| 76 |
+
networkx/algorithms/approximation/__pycache__/connectivity.cpython-311.pyc,,
|
| 77 |
+
networkx/algorithms/approximation/__pycache__/distance_measures.cpython-311.pyc,,
|
| 78 |
+
networkx/algorithms/approximation/__pycache__/dominating_set.cpython-311.pyc,,
|
| 79 |
+
networkx/algorithms/approximation/__pycache__/kcomponents.cpython-311.pyc,,
|
| 80 |
+
networkx/algorithms/approximation/__pycache__/matching.cpython-311.pyc,,
|
| 81 |
+
networkx/algorithms/approximation/__pycache__/maxcut.cpython-311.pyc,,
|
| 82 |
+
networkx/algorithms/approximation/__pycache__/ramsey.cpython-311.pyc,,
|
| 83 |
+
networkx/algorithms/approximation/__pycache__/steinertree.cpython-311.pyc,,
|
| 84 |
+
networkx/algorithms/approximation/__pycache__/traveling_salesman.cpython-311.pyc,,
|
| 85 |
+
networkx/algorithms/approximation/__pycache__/treewidth.cpython-311.pyc,,
|
| 86 |
+
networkx/algorithms/approximation/__pycache__/vertex_cover.cpython-311.pyc,,
|
| 87 |
+
networkx/algorithms/approximation/clique.py,sha256=y4AeIvmGpMmM0kKRaFQKEORyUVmwakM_Vqz0Mdgnd94,7674
|
| 88 |
+
networkx/algorithms/approximation/clustering_coefficient.py,sha256=jbWKI0fd79_vH4lHkzPXU1cyD8mb9MDej3v9OKQnv5s,2084
|
| 89 |
+
networkx/algorithms/approximation/connectivity.py,sha256=PbGbwOk3dE4phai74vxz7pj1lK3q_gbYrNtMltu2MDw,13107
|
| 90 |
+
networkx/algorithms/approximation/distance_measures.py,sha256=9MUKk23jP7klSgN718h7ttVM_xKPE4dMkxop7BvjkcU,5593
|
| 91 |
+
networkx/algorithms/approximation/dominating_set.py,sha256=oGr5hRltwqd3JltGX-LIC7Sq7LGjltfdUGmBXWdAR7s,4214
|
| 92 |
+
networkx/algorithms/approximation/kcomponents.py,sha256=AN9co8R7Lmgx5N_CbSrSmkQhfFbfbsJtwrUxSDBd284,13282
|
| 93 |
+
networkx/algorithms/approximation/matching.py,sha256=1xfEMDlvcV8J78kgUhbC9FkaTnwC6mjYtNesGTYgmVg,1170
|
| 94 |
+
networkx/algorithms/approximation/maxcut.py,sha256=rWHElMJvy5g4Yy_Tk11tlFFwQ16AV07K6rW1bIwWHTU,3664
|
| 95 |
+
networkx/algorithms/approximation/ramsey.py,sha256=xOZDmJqCm-ya7utQhQOmVM_5LO-O_1e5UDw-YIWr9rY,1353
|
| 96 |
+
networkx/algorithms/approximation/steinertree.py,sha256=tE-4_f1fPpR_hvCudJlzNzkYq_5kyT4OxxJBbfErWJ8,7487
|
| 97 |
+
networkx/algorithms/approximation/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 98 |
+
networkx/algorithms/approximation/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 99 |
+
networkx/algorithms/approximation/tests/__pycache__/test_approx_clust_coeff.cpython-311.pyc,,
|
| 100 |
+
networkx/algorithms/approximation/tests/__pycache__/test_clique.cpython-311.pyc,,
|
| 101 |
+
networkx/algorithms/approximation/tests/__pycache__/test_connectivity.cpython-311.pyc,,
|
| 102 |
+
networkx/algorithms/approximation/tests/__pycache__/test_distance_measures.cpython-311.pyc,,
|
| 103 |
+
networkx/algorithms/approximation/tests/__pycache__/test_dominating_set.cpython-311.pyc,,
|
| 104 |
+
networkx/algorithms/approximation/tests/__pycache__/test_kcomponents.cpython-311.pyc,,
|
| 105 |
+
networkx/algorithms/approximation/tests/__pycache__/test_matching.cpython-311.pyc,,
|
| 106 |
+
networkx/algorithms/approximation/tests/__pycache__/test_maxcut.cpython-311.pyc,,
|
| 107 |
+
networkx/algorithms/approximation/tests/__pycache__/test_ramsey.cpython-311.pyc,,
|
| 108 |
+
networkx/algorithms/approximation/tests/__pycache__/test_steinertree.cpython-311.pyc,,
|
| 109 |
+
networkx/algorithms/approximation/tests/__pycache__/test_traveling_salesman.cpython-311.pyc,,
|
| 110 |
+
networkx/algorithms/approximation/tests/__pycache__/test_treewidth.cpython-311.pyc,,
|
| 111 |
+
networkx/algorithms/approximation/tests/__pycache__/test_vertex_cover.cpython-311.pyc,,
|
| 112 |
+
networkx/algorithms/approximation/tests/test_approx_clust_coeff.py,sha256=PGOVEKf2BcJu1vvjZrgTlBBpwM8V6t7yCANjyS9nWF0,1171
|
| 113 |
+
networkx/algorithms/approximation/tests/test_clique.py,sha256=JZ_ja03aVU7vnZ42Joy1ze0vjdcm_CnDhD96Z4W_Dcc,3022
|
| 114 |
+
networkx/algorithms/approximation/tests/test_connectivity.py,sha256=gDG6tsgP3ux7Dgu0x7r0nso7_yknIxicV42Gq0It5pc,5952
|
| 115 |
+
networkx/algorithms/approximation/tests/test_distance_measures.py,sha256=GSyupA_jqSc_pLPSMnZFNcBgZc8-KFWgt6Q7uFegTqg,2024
|
| 116 |
+
networkx/algorithms/approximation/tests/test_dominating_set.py,sha256=l4pBDY7pK7Fxw-S4tOlNcxf-j2j5GpHPJ9f4TrMs1sI,2686
|
| 117 |
+
networkx/algorithms/approximation/tests/test_kcomponents.py,sha256=tTljP1FHzXrUwi-oBz5AQcibRw1NgR4N5UE0a2OrOUA,9346
|
| 118 |
+
networkx/algorithms/approximation/tests/test_matching.py,sha256=nitZncaM0605kaIu1NO6_5TFV2--nohUCO46XTD_lnM,186
|
| 119 |
+
networkx/algorithms/approximation/tests/test_maxcut.py,sha256=HDFNx896WYi7do42P6C5tGTZsBpiqx7sUWm_2riE3nk,2426
|
| 120 |
+
networkx/algorithms/approximation/tests/test_ramsey.py,sha256=h36Ol39csHbIoTDBxbxMgn4371iVUGZ3a2N6l7d56lI,1143
|
| 121 |
+
networkx/algorithms/approximation/tests/test_steinertree.py,sha256=H6IKKl1kFeH96bJaI8CgSkXBJz34ceCft8DA7HNG-Mk,6901
|
| 122 |
+
networkx/algorithms/approximation/tests/test_traveling_salesman.py,sha256=El7VoCuHfmb_DQxlQgo5k9L6lL6U4DBu70BgJ0REJyg,30697
|
| 123 |
+
networkx/algorithms/approximation/tests/test_treewidth.py,sha256=MWFFcmjO0QxM8FS8iXSCtfGnk6eqG2kFyv1u2qnSeUo,9096
|
| 124 |
+
networkx/algorithms/approximation/tests/test_vertex_cover.py,sha256=FobHNhG9CAMeB_AOEprUs-7XQdPoc1YvfmXhozDZ8pM,1942
|
| 125 |
+
networkx/algorithms/approximation/traveling_salesman.py,sha256=FbysLItH41SzBjKIoByYqcvuqIboO8HwNYCO2DJjQ4g,54465
|
| 126 |
+
networkx/algorithms/approximation/treewidth.py,sha256=MRGfLtAanCzDk1G6I6jTbC6MKn6lYreIe9XQdfRXGHE,8148
|
| 127 |
+
networkx/algorithms/approximation/vertex_cover.py,sha256=s7s5v4TGqIlvgTAg2FVxRRUSA2BEp7szZg7FS_UpWAA,2798
|
| 128 |
+
networkx/algorithms/assortativity/__init__.py,sha256=ov3HRRbeYB_6Qezvxp1OTl77GBpw-EWkWGUzgfT8G9c,294
|
| 129 |
+
networkx/algorithms/assortativity/__pycache__/__init__.cpython-311.pyc,,
|
| 130 |
+
networkx/algorithms/assortativity/__pycache__/connectivity.cpython-311.pyc,,
|
| 131 |
+
networkx/algorithms/assortativity/__pycache__/correlation.cpython-311.pyc,,
|
| 132 |
+
networkx/algorithms/assortativity/__pycache__/mixing.cpython-311.pyc,,
|
| 133 |
+
networkx/algorithms/assortativity/__pycache__/neighbor_degree.cpython-311.pyc,,
|
| 134 |
+
networkx/algorithms/assortativity/__pycache__/pairs.cpython-311.pyc,,
|
| 135 |
+
networkx/algorithms/assortativity/connectivity.py,sha256=O1b3Iky0hlpdM6_QBmBNFfF4XeUsKDMj8fCid_bBRQE,4216
|
| 136 |
+
networkx/algorithms/assortativity/correlation.py,sha256=6XUlbqlBgLyb8GDKsSvIrSgsL47Ti1jbLQoIdRVAj_k,8654
|
| 137 |
+
networkx/algorithms/assortativity/mixing.py,sha256=adB-iqzA_lhjhnoOOZG9qK4ghRTZCjONYN9FePYqcj8,7551
|
| 138 |
+
networkx/algorithms/assortativity/neighbor_degree.py,sha256=H1XQ9BenXxxHK_e6ZWtdIb3xYwYCrbtqEQ69Gasm7cA,5278
|
| 139 |
+
networkx/algorithms/assortativity/pairs.py,sha256=qHALwEx_Q8N1B2ZszX8vs2BK2_0kc4lmbth4kMU6Nog,3393
|
| 140 |
+
networkx/algorithms/assortativity/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 141 |
+
networkx/algorithms/assortativity/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 142 |
+
networkx/algorithms/assortativity/tests/__pycache__/base_test.cpython-311.pyc,,
|
| 143 |
+
networkx/algorithms/assortativity/tests/__pycache__/test_connectivity.cpython-311.pyc,,
|
| 144 |
+
networkx/algorithms/assortativity/tests/__pycache__/test_correlation.cpython-311.pyc,,
|
| 145 |
+
networkx/algorithms/assortativity/tests/__pycache__/test_mixing.cpython-311.pyc,,
|
| 146 |
+
networkx/algorithms/assortativity/tests/__pycache__/test_neighbor_degree.cpython-311.pyc,,
|
| 147 |
+
networkx/algorithms/assortativity/tests/__pycache__/test_pairs.cpython-311.pyc,,
|
| 148 |
+
networkx/algorithms/assortativity/tests/base_test.py,sha256=MNeQMLA3oBUCM8TSyNbBQ_uW0nDc1GEZYdNdUwePAm4,2651
|
| 149 |
+
networkx/algorithms/assortativity/tests/test_connectivity.py,sha256=Js841GQLYTLWvc6xZhnyqj-JtyrnS0ska1TFYntxyXA,4978
|
| 150 |
+
networkx/algorithms/assortativity/tests/test_correlation.py,sha256=1_D9GjLDnlT8Uy28lUn2fS1AHp2XBwiMpIl2OhRNDXk,5069
|
| 151 |
+
networkx/algorithms/assortativity/tests/test_mixing.py,sha256=u-LIccNn-TeIAM766UtzUJQlY7NAbxF4EsUoKINzmlo,6820
|
| 152 |
+
networkx/algorithms/assortativity/tests/test_neighbor_degree.py,sha256=ODP2M8jCaFr_l3ODwpwaz20-KqU2IFaEfJRBK53mpE8,3968
|
| 153 |
+
networkx/algorithms/assortativity/tests/test_pairs.py,sha256=t05qP_-gfkbiR6aTLtE1owYl9otBSsuJcRkuZsa63UQ,3008
|
| 154 |
+
networkx/algorithms/asteroidal.py,sha256=ARFht3oQvn95xCaaBEhy42djMIx4BuqsNf8VVlwBCEI,5852
|
| 155 |
+
networkx/algorithms/bipartite/__init__.py,sha256=NQtAEpZ0IkjGVwfUbOzD7eoPLwulb_iZfh7-aDnyPWo,3826
|
| 156 |
+
networkx/algorithms/bipartite/__pycache__/__init__.cpython-311.pyc,,
|
| 157 |
+
networkx/algorithms/bipartite/__pycache__/basic.cpython-311.pyc,,
|
| 158 |
+
networkx/algorithms/bipartite/__pycache__/centrality.cpython-311.pyc,,
|
| 159 |
+
networkx/algorithms/bipartite/__pycache__/cluster.cpython-311.pyc,,
|
| 160 |
+
networkx/algorithms/bipartite/__pycache__/covering.cpython-311.pyc,,
|
| 161 |
+
networkx/algorithms/bipartite/__pycache__/edgelist.cpython-311.pyc,,
|
| 162 |
+
networkx/algorithms/bipartite/__pycache__/extendability.cpython-311.pyc,,
|
| 163 |
+
networkx/algorithms/bipartite/__pycache__/generators.cpython-311.pyc,,
|
| 164 |
+
networkx/algorithms/bipartite/__pycache__/matching.cpython-311.pyc,,
|
| 165 |
+
networkx/algorithms/bipartite/__pycache__/matrix.cpython-311.pyc,,
|
| 166 |
+
networkx/algorithms/bipartite/__pycache__/projection.cpython-311.pyc,,
|
| 167 |
+
networkx/algorithms/bipartite/__pycache__/redundancy.cpython-311.pyc,,
|
| 168 |
+
networkx/algorithms/bipartite/__pycache__/spectral.cpython-311.pyc,,
|
| 169 |
+
networkx/algorithms/bipartite/basic.py,sha256=iqgNX-FUDwK2owu1APFTu6ldlw6QE2PaOuNiWEgHafQ,8350
|
| 170 |
+
networkx/algorithms/bipartite/centrality.py,sha256=vkjnOLv5CQtfTOFpa2YhFZWRnMBFUCetGn1w7akAvq8,9144
|
| 171 |
+
networkx/algorithms/bipartite/cluster.py,sha256=S9h8lu-usXFcXEJf6qUxZinf0LneqvKnEiUi9YKp7bo,6925
|
| 172 |
+
networkx/algorithms/bipartite/covering.py,sha256=8pQEStjAGygcu83Cz88RfNAifUV7x8pC84LE2wWapsY,2160
|
| 173 |
+
networkx/algorithms/bipartite/edgelist.py,sha256=aa5sHvwCLe0Lk7BK58tR5vMNjpnlfSaNSs6UY6G5vbc,11317
|
| 174 |
+
networkx/algorithms/bipartite/extendability.py,sha256=CvF0zI__9899cMkq40vu_FfEcU-OeyCB4C2bHtMxxgE,3973
|
| 175 |
+
networkx/algorithms/bipartite/generators.py,sha256=Hj-kPfih-bd74gHrZFpyeWtrMQbKS1uQyYiBqv5RxKQ,20231
|
| 176 |
+
networkx/algorithms/bipartite/matching.py,sha256=kXgpv14FuL6k4KrKN68Z85dkKNgfBmxahTMn4N8aVoI,21620
|
| 177 |
+
networkx/algorithms/bipartite/matrix.py,sha256=w9P7y4oS7vUFdv2dRQHAosuFDrH34YgMgUffQCSFRDE,6127
|
| 178 |
+
networkx/algorithms/bipartite/projection.py,sha256=L9mkbufsE885rGhJ9t-7p-TqowBtUmrL8Zm95LeBygQ,17165
|
| 179 |
+
networkx/algorithms/bipartite/redundancy.py,sha256=T2kDtj1xpSudwelE_ZnWFHnIXneZAMaXvv1m7pVF3Io,3397
|
| 180 |
+
networkx/algorithms/bipartite/spectral.py,sha256=xxkLlaSByMJUP4Kz-XfuRhzTse_DqqsOtGzfiKIgdXc,1880
|
| 181 |
+
networkx/algorithms/bipartite/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 182 |
+
networkx/algorithms/bipartite/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 183 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_basic.cpython-311.pyc,,
|
| 184 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_centrality.cpython-311.pyc,,
|
| 185 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_cluster.cpython-311.pyc,,
|
| 186 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_covering.cpython-311.pyc,,
|
| 187 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_edgelist.cpython-311.pyc,,
|
| 188 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_extendability.cpython-311.pyc,,
|
| 189 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_generators.cpython-311.pyc,,
|
| 190 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_matching.cpython-311.pyc,,
|
| 191 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_matrix.cpython-311.pyc,,
|
| 192 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_project.cpython-311.pyc,,
|
| 193 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_redundancy.cpython-311.pyc,,
|
| 194 |
+
networkx/algorithms/bipartite/tests/__pycache__/test_spectral_bipartivity.cpython-311.pyc,,
|
| 195 |
+
networkx/algorithms/bipartite/tests/test_basic.py,sha256=gzbtsQqPi85BznX5REdGBBJVyr9aH4nO06c3eEI4634,4291
|
| 196 |
+
networkx/algorithms/bipartite/tests/test_centrality.py,sha256=PABPbrIyoAziEEQKXsZLl2jT36N8DZpNRzEO-jeu89Y,6362
|
| 197 |
+
networkx/algorithms/bipartite/tests/test_cluster.py,sha256=O0VsPVt8vcY_E1FjjLJX2xaUbhVViI5MP6_gLTbEpos,2801
|
| 198 |
+
networkx/algorithms/bipartite/tests/test_covering.py,sha256=EGVxYQsyLXE5yY5N5u6D4wZq2NcZe9OwlYpEuY6DF3o,1221
|
| 199 |
+
networkx/algorithms/bipartite/tests/test_edgelist.py,sha256=UE7vm3iZshnlzIrcupso48en0kncxGUPU7XTQskgowg,7996
|
| 200 |
+
networkx/algorithms/bipartite/tests/test_extendability.py,sha256=MsiRLfldka3Cz_h21BwPxnEOuKChntuI6mVCnIFnSs0,6780
|
| 201 |
+
networkx/algorithms/bipartite/tests/test_generators.py,sha256=GLMThTKIfZ96NwTxIL0P0o0OAESZFfnySRkRjtKhao8,12794
|
| 202 |
+
networkx/algorithms/bipartite/tests/test_matching.py,sha256=wFw095skCjW5YvQAnIie8mLacECVt0yUoeJFSj8ONAk,11972
|
| 203 |
+
networkx/algorithms/bipartite/tests/test_matrix.py,sha256=EoqQKTMcPPPPUZYTzc-AAtl5F77qT0X3FI3E1tYppxM,2900
|
| 204 |
+
networkx/algorithms/bipartite/tests/test_project.py,sha256=FBjkys3JYYzEG4aq_CsQrtm41edZibWI_uDAQ0b4wqM,15134
|
| 205 |
+
networkx/algorithms/bipartite/tests/test_redundancy.py,sha256=ddjUzOQ0gkiWBLtVwVFYTJydaIdW3qAc4BCVscxj7-Q,919
|
| 206 |
+
networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py,sha256=1jGDgrIx3-TWOCNMSC4zxmZa7LHyMU69DXh3h12Bjag,2358
|
| 207 |
+
networkx/algorithms/boundary.py,sha256=GNuNDL280F7RXMzgkhUqFx-Zcg1LtP_Q0bNCYbMWIYU,5330
|
| 208 |
+
networkx/algorithms/bridges.py,sha256=MuH_zEBqeSuyou8wszhnEzjJrUZSN-PpNtaScqUmR6E,6075
|
| 209 |
+
networkx/algorithms/centrality/__init__.py,sha256=Er3YoYoj76UfY4P6I0L-0fCQkO7mMU0b3NLsTT2RGWI,558
|
| 210 |
+
networkx/algorithms/centrality/__pycache__/__init__.cpython-311.pyc,,
|
| 211 |
+
networkx/algorithms/centrality/__pycache__/betweenness.cpython-311.pyc,,
|
| 212 |
+
networkx/algorithms/centrality/__pycache__/betweenness_subset.cpython-311.pyc,,
|
| 213 |
+
networkx/algorithms/centrality/__pycache__/closeness.cpython-311.pyc,,
|
| 214 |
+
networkx/algorithms/centrality/__pycache__/current_flow_betweenness.cpython-311.pyc,,
|
| 215 |
+
networkx/algorithms/centrality/__pycache__/current_flow_betweenness_subset.cpython-311.pyc,,
|
| 216 |
+
networkx/algorithms/centrality/__pycache__/current_flow_closeness.cpython-311.pyc,,
|
| 217 |
+
networkx/algorithms/centrality/__pycache__/degree_alg.cpython-311.pyc,,
|
| 218 |
+
networkx/algorithms/centrality/__pycache__/dispersion.cpython-311.pyc,,
|
| 219 |
+
networkx/algorithms/centrality/__pycache__/eigenvector.cpython-311.pyc,,
|
| 220 |
+
networkx/algorithms/centrality/__pycache__/flow_matrix.cpython-311.pyc,,
|
| 221 |
+
networkx/algorithms/centrality/__pycache__/group.cpython-311.pyc,,
|
| 222 |
+
networkx/algorithms/centrality/__pycache__/harmonic.cpython-311.pyc,,
|
| 223 |
+
networkx/algorithms/centrality/__pycache__/katz.cpython-311.pyc,,
|
| 224 |
+
networkx/algorithms/centrality/__pycache__/laplacian.cpython-311.pyc,,
|
| 225 |
+
networkx/algorithms/centrality/__pycache__/load.cpython-311.pyc,,
|
| 226 |
+
networkx/algorithms/centrality/__pycache__/percolation.cpython-311.pyc,,
|
| 227 |
+
networkx/algorithms/centrality/__pycache__/reaching.cpython-311.pyc,,
|
| 228 |
+
networkx/algorithms/centrality/__pycache__/second_order.cpython-311.pyc,,
|
| 229 |
+
networkx/algorithms/centrality/__pycache__/subgraph_alg.cpython-311.pyc,,
|
| 230 |
+
networkx/algorithms/centrality/__pycache__/trophic.cpython-311.pyc,,
|
| 231 |
+
networkx/algorithms/centrality/__pycache__/voterank_alg.cpython-311.pyc,,
|
| 232 |
+
networkx/algorithms/centrality/betweenness.py,sha256=Uy9LCiUxzx1Jvgi7SgV-4AEG1BfvDy2ypWg6Xzfd0_8,14374
|
| 233 |
+
networkx/algorithms/centrality/betweenness_subset.py,sha256=SW7uh0SyGhD_99gwAIGOHrJ9rlO3jXw7xHi-tOHmspE,9327
|
| 234 |
+
networkx/algorithms/centrality/closeness.py,sha256=97qc3gCkitgyLh66sYcdpSRnl7cdUrDgRBP49jDlNNw,10252
|
| 235 |
+
networkx/algorithms/centrality/current_flow_betweenness.py,sha256=eDoDGCVR1PIL5hIY07xRJ6Ze74S4v1HUGJGZ9DbfQW8,11871
|
| 236 |
+
networkx/algorithms/centrality/current_flow_betweenness_subset.py,sha256=QAxgfH20BkeoGgjKPVHVRDrJ6kkGQ1MNmZIVV5baWaM,8046
|
| 237 |
+
networkx/algorithms/centrality/current_flow_closeness.py,sha256=jId4MzTctT0NIJOrzTPsd_gomLSMAg_1SXuXGDZja18,3351
|
| 238 |
+
networkx/algorithms/centrality/degree_alg.py,sha256=xwK263egt-sy-BBxVqL9CE7uF22UhJQls8NlVu3QfZU,3881
|
| 239 |
+
networkx/algorithms/centrality/dispersion.py,sha256=Eld3WK97coVbsHjAJ3ewYI1vsJ0c4Nm3Yrznbec5G8c,3627
|
| 240 |
+
networkx/algorithms/centrality/eigenvector.py,sha256=o0qmWOiMf18Hofdw0ACaAO3TASeJC89R1meCr3ILJi0,12738
|
| 241 |
+
networkx/algorithms/centrality/flow_matrix.py,sha256=G7o6qTnkOlhUZ-DowDu5Xb0vQAiulXcP_veiuYpaPdU,3829
|
| 242 |
+
networkx/algorithms/centrality/group.py,sha256=XBfaGSIgVc-an4Ecqvokd1smETuQ_lUTAtOduKA8YDg,27866
|
| 243 |
+
networkx/algorithms/centrality/harmonic.py,sha256=0eFa5Kv-7Ff_TFuygH753cnQjDqeImkPgrKohtXhGFE,2626
|
| 244 |
+
networkx/algorithms/centrality/katz.py,sha256=K3KVHs3RMGjywLa5tvwEk4xqoBedgytEXINcSjHzy4s,10941
|
| 245 |
+
networkx/algorithms/centrality/laplacian.py,sha256=BHdSIiFBjqZGijThqYQHS3J2-KHnd8DdzQDwAXJwyt0,5403
|
| 246 |
+
networkx/algorithms/centrality/load.py,sha256=6lFI7KqDsVit1QF1UXqrx5G_frELnG8UKOmqtETC5bs,6850
|
| 247 |
+
networkx/algorithms/centrality/percolation.py,sha256=PcWtbDaXvTLeqr1PCbnIHjoD8XcfQTp1meff7FHU1As,4415
|
| 248 |
+
networkx/algorithms/centrality/reaching.py,sha256=nMKAOEbpHajkGKIYxGYEhO70fI2KXeReVsJgaRplN0E,7017
|
| 249 |
+
networkx/algorithms/centrality/second_order.py,sha256=hFk_RFwYpIRlh_iGPO-ZSNzp6Anb73jod_fLYTMvfYk,4966
|
| 250 |
+
networkx/algorithms/centrality/subgraph_alg.py,sha256=BIxHyH7E3I1Ri2dDnnFPy9IOc65ouwk8Y_jc5JMEGRM,9472
|
| 251 |
+
networkx/algorithms/centrality/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 252 |
+
networkx/algorithms/centrality/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 253 |
+
networkx/algorithms/centrality/tests/__pycache__/test_betweenness_centrality.cpython-311.pyc,,
|
| 254 |
+
networkx/algorithms/centrality/tests/__pycache__/test_betweenness_centrality_subset.cpython-311.pyc,,
|
| 255 |
+
networkx/algorithms/centrality/tests/__pycache__/test_closeness_centrality.cpython-311.pyc,,
|
| 256 |
+
networkx/algorithms/centrality/tests/__pycache__/test_current_flow_betweenness_centrality.cpython-311.pyc,,
|
| 257 |
+
networkx/algorithms/centrality/tests/__pycache__/test_current_flow_betweenness_centrality_subset.cpython-311.pyc,,
|
| 258 |
+
networkx/algorithms/centrality/tests/__pycache__/test_current_flow_closeness.cpython-311.pyc,,
|
| 259 |
+
networkx/algorithms/centrality/tests/__pycache__/test_degree_centrality.cpython-311.pyc,,
|
| 260 |
+
networkx/algorithms/centrality/tests/__pycache__/test_dispersion.cpython-311.pyc,,
|
| 261 |
+
networkx/algorithms/centrality/tests/__pycache__/test_eigenvector_centrality.cpython-311.pyc,,
|
| 262 |
+
networkx/algorithms/centrality/tests/__pycache__/test_group.cpython-311.pyc,,
|
| 263 |
+
networkx/algorithms/centrality/tests/__pycache__/test_harmonic_centrality.cpython-311.pyc,,
|
| 264 |
+
networkx/algorithms/centrality/tests/__pycache__/test_katz_centrality.cpython-311.pyc,,
|
| 265 |
+
networkx/algorithms/centrality/tests/__pycache__/test_laplacian_centrality.cpython-311.pyc,,
|
| 266 |
+
networkx/algorithms/centrality/tests/__pycache__/test_load_centrality.cpython-311.pyc,,
|
| 267 |
+
networkx/algorithms/centrality/tests/__pycache__/test_percolation_centrality.cpython-311.pyc,,
|
| 268 |
+
networkx/algorithms/centrality/tests/__pycache__/test_reaching.cpython-311.pyc,,
|
| 269 |
+
networkx/algorithms/centrality/tests/__pycache__/test_second_order_centrality.cpython-311.pyc,,
|
| 270 |
+
networkx/algorithms/centrality/tests/__pycache__/test_subgraph.cpython-311.pyc,,
|
| 271 |
+
networkx/algorithms/centrality/tests/__pycache__/test_trophic.cpython-311.pyc,,
|
| 272 |
+
networkx/algorithms/centrality/tests/__pycache__/test_voterank.cpython-311.pyc,,
|
| 273 |
+
networkx/algorithms/centrality/tests/test_betweenness_centrality.py,sha256=pKoPAP1hnQSgrOxYeW5-LdUiFDANiwTn_NdOdgccbo8,26795
|
| 274 |
+
networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py,sha256=HrHMcgOL69Z6y679SbqZIjkQOnqrYSz24gt17AJ9q-o,12554
|
| 275 |
+
networkx/algorithms/centrality/tests/test_closeness_centrality.py,sha256=XWZivyLjxYlF41U4ktUmvULC2PMvxKs2U6BHDXRZVdE,10209
|
| 276 |
+
networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py,sha256=VOxx1A7iSGtdEbzJYea_sW_Hv0S71-oo1CVX7Rqd5RY,7870
|
| 277 |
+
networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py,sha256=JfRGgPuiF-vJu5fc2_pcJYREEboxcK_dmy-np39c4Aw,5839
|
| 278 |
+
networkx/algorithms/centrality/tests/test_current_flow_closeness.py,sha256=vflQeoNKngrGUiRb3XNlm2X9wR4vKgMSW_sCyMUCQi8,1379
|
| 279 |
+
networkx/algorithms/centrality/tests/test_degree_centrality.py,sha256=TxD7UBtezF4RCdbCAuTsSB5lcFOQZrGnLOuCMa0XWY0,4105
|
| 280 |
+
networkx/algorithms/centrality/tests/test_dispersion.py,sha256=ROgl_5bGhcNXonNW3ylsvUcA0NCwynsQu_scic371Gw,1959
|
| 281 |
+
networkx/algorithms/centrality/tests/test_eigenvector_centrality.py,sha256=MsHKkQX7oip4v0kF28K1RjtKqxSNVykiSjg8wT20YyE,4897
|
| 282 |
+
networkx/algorithms/centrality/tests/test_group.py,sha256=YmWifoTgw2gSS5BnA9G2T_Voauk_WG6v90JrZEt-Kjk,8686
|
| 283 |
+
networkx/algorithms/centrality/tests/test_harmonic_centrality.py,sha256=wYP0msmB5hh5OMIxPl9t0G4QSpG3Brxw98Kh9BrRoag,3658
|
| 284 |
+
networkx/algorithms/centrality/tests/test_katz_centrality.py,sha256=JL0bZZsJe2MQFL6urXgY82wCAwucUvhjaShYZPxpL6U,11240
|
| 285 |
+
networkx/algorithms/centrality/tests/test_laplacian_centrality.py,sha256=vY-NULtr_U_GxUMwfAZB-iccxIRTiqqUN4Q8HRNpzSo,5916
|
| 286 |
+
networkx/algorithms/centrality/tests/test_load_centrality.py,sha256=Vv3zSW89iELN-8KNbUclmkhOe1LzKdF7U_w34nYovIo,11343
|
| 287 |
+
networkx/algorithms/centrality/tests/test_percolation_centrality.py,sha256=ycQ1fvEZZcWAfqL11urT7yHiEP77usJDSG25OQiDM2s,2591
|
| 288 |
+
networkx/algorithms/centrality/tests/test_reaching.py,sha256=sqQUPspoiWxs9tD77UwngBkMVFYjRzhayVxPqX9_XbY,4143
|
| 289 |
+
networkx/algorithms/centrality/tests/test_second_order_centrality.py,sha256=ce0wQ4T33lu23wskzGUnBS7X4BSODlvAX1S5KxlLzOA,1999
|
| 290 |
+
networkx/algorithms/centrality/tests/test_subgraph.py,sha256=vhE9Uh-_Hlk49k-ny6ORHCgqk7LWH8OHIYOEYM96uz0,3729
|
| 291 |
+
networkx/algorithms/centrality/tests/test_trophic.py,sha256=AzV6rwcTa4b4tcenoKh95o6VF-z7w75l81ZOdhhi6yE,8705
|
| 292 |
+
networkx/algorithms/centrality/tests/test_voterank.py,sha256=7Z9aQYKqEw_txBbWTz1FZWJzUmhjlMfDFSRIKHBdkOk,1692
|
| 293 |
+
networkx/algorithms/centrality/trophic.py,sha256=ay_R2GtxxfP5muSoxSETt6wdqYka14J1f1Z9zafY790,4654
|
| 294 |
+
networkx/algorithms/centrality/voterank_alg.py,sha256=UG71jAEm4b0vqj6ZQ-so8yqQtdxDoK8XI5CWTdjAyhg,3227
|
| 295 |
+
networkx/algorithms/chains.py,sha256=wUNxO0v_nH9m5efeV0IXzog_5EbBl0PkVzgDJoCAJts,6964
|
| 296 |
+
networkx/algorithms/chordal.py,sha256=H5fdhTaX5UzKWVj4mQQd7cjj_oj84R91rUGRiuug_Gk,13285
|
| 297 |
+
networkx/algorithms/clique.py,sha256=gM-ksRAEX1eDr_Irk85uuUGVKRpFIYijeOo385mVsxs,25802
|
| 298 |
+
networkx/algorithms/cluster.py,sha256=qkwVMieIgXyK2u01cYD9xrZtgpDAODmH3aggvUxxPVc,20281
|
| 299 |
+
networkx/algorithms/coloring/__init__.py,sha256=P1cmqrAjcaCdObkNZ1e6Hp__ZpxBAhQx0iIipOVW8jg,182
|
| 300 |
+
networkx/algorithms/coloring/__pycache__/__init__.cpython-311.pyc,,
|
| 301 |
+
networkx/algorithms/coloring/__pycache__/equitable_coloring.cpython-311.pyc,,
|
| 302 |
+
networkx/algorithms/coloring/__pycache__/greedy_coloring.cpython-311.pyc,,
|
| 303 |
+
networkx/algorithms/coloring/equitable_coloring.py,sha256=JnL_TM3sTewENSKkbHIOOfNoaqXYkoEjzmfgf3xD9C8,16279
|
| 304 |
+
networkx/algorithms/coloring/greedy_coloring.py,sha256=Tuo215orZ6k7znMd9wkyv3irZNAl1dyEryi72mC_im4,20170
|
| 305 |
+
networkx/algorithms/coloring/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 306 |
+
networkx/algorithms/coloring/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 307 |
+
networkx/algorithms/coloring/tests/__pycache__/test_coloring.cpython-311.pyc,,
|
| 308 |
+
networkx/algorithms/coloring/tests/test_coloring.py,sha256=A2cAG--i7pTVolIK96mxNuCTtLvhbLVRqJ4MAfWUBEQ,23712
|
| 309 |
+
networkx/algorithms/communicability_alg.py,sha256=8omQmig1RyfVYfB_bfX40AX3Vg4PD4D-cmjelQzzKFc,4536
|
| 310 |
+
networkx/algorithms/community/__init__.py,sha256=gKUySRds_lxaCw0kEpPJ1vluQwN4cV3ayt4U_8fok_M,1125
|
| 311 |
+
networkx/algorithms/community/__pycache__/__init__.cpython-311.pyc,,
|
| 312 |
+
networkx/algorithms/community/__pycache__/asyn_fluid.cpython-311.pyc,,
|
| 313 |
+
networkx/algorithms/community/__pycache__/centrality.cpython-311.pyc,,
|
| 314 |
+
networkx/algorithms/community/__pycache__/community_utils.cpython-311.pyc,,
|
| 315 |
+
networkx/algorithms/community/__pycache__/kclique.cpython-311.pyc,,
|
| 316 |
+
networkx/algorithms/community/__pycache__/kernighan_lin.cpython-311.pyc,,
|
| 317 |
+
networkx/algorithms/community/__pycache__/label_propagation.cpython-311.pyc,,
|
| 318 |
+
networkx/algorithms/community/__pycache__/louvain.cpython-311.pyc,,
|
| 319 |
+
networkx/algorithms/community/__pycache__/lukes.cpython-311.pyc,,
|
| 320 |
+
networkx/algorithms/community/__pycache__/modularity_max.cpython-311.pyc,,
|
| 321 |
+
networkx/algorithms/community/__pycache__/quality.cpython-311.pyc,,
|
| 322 |
+
networkx/algorithms/community/asyn_fluid.py,sha256=Qn8tNzdrXA1DVVHuZi-YjvBsUSbj3J6WwekrSVXBs74,5912
|
| 323 |
+
networkx/algorithms/community/centrality.py,sha256=AEuGeTP_vWSyWr4vC3r-63cTfQ7mV2vDTqv_vZUkoxQ,6631
|
| 324 |
+
networkx/algorithms/community/community_utils.py,sha256=u4q9DSo_QyROG7Qci2-Cvphu4n_VM8AeYXYKkXQXxws,903
|
| 325 |
+
networkx/algorithms/community/kclique.py,sha256=tG0GOot8kY-wnaGA0XdNo0VKKoa1hJprMqXszcA00Pc,2456
|
| 326 |
+
networkx/algorithms/community/kernighan_lin.py,sha256=-pQEXeOBE6JnHqMo-5M6igzGcBNbeOWK8AQ51joeN-E,4345
|
| 327 |
+
networkx/algorithms/community/label_propagation.py,sha256=pcGwq8qhZQPK7LSrmsL54lf0ljC4PzBQaE2s_vvsWmU,11846
|
| 328 |
+
networkx/algorithms/community/louvain.py,sha256=smccDNEHuRC3aqBJJ7ijKTQQ8vy1c-zcSuPaeqoQqDw,14764
|
| 329 |
+
networkx/algorithms/community/lukes.py,sha256=OxwTxVKYNEd4evk4htBNDw_IeNujUIvPuydAfT-ewZk,8086
|
| 330 |
+
networkx/algorithms/community/modularity_max.py,sha256=mcQxD2iQduY8H2-Ep3Agg7BSb-UTUqzOEcHm-424sC8,18020
|
| 331 |
+
networkx/algorithms/community/quality.py,sha256=G7ogU-CYh-78EWGUyPKKR55K0iFrZclHawzy9gvBW-4,11919
|
| 332 |
+
networkx/algorithms/community/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 333 |
+
networkx/algorithms/community/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 334 |
+
networkx/algorithms/community/tests/__pycache__/test_asyn_fluid.cpython-311.pyc,,
|
| 335 |
+
networkx/algorithms/community/tests/__pycache__/test_centrality.cpython-311.pyc,,
|
| 336 |
+
networkx/algorithms/community/tests/__pycache__/test_kclique.cpython-311.pyc,,
|
| 337 |
+
networkx/algorithms/community/tests/__pycache__/test_kernighan_lin.cpython-311.pyc,,
|
| 338 |
+
networkx/algorithms/community/tests/__pycache__/test_label_propagation.cpython-311.pyc,,
|
| 339 |
+
networkx/algorithms/community/tests/__pycache__/test_louvain.cpython-311.pyc,,
|
| 340 |
+
networkx/algorithms/community/tests/__pycache__/test_lukes.cpython-311.pyc,,
|
| 341 |
+
networkx/algorithms/community/tests/__pycache__/test_modularity_max.cpython-311.pyc,,
|
| 342 |
+
networkx/algorithms/community/tests/__pycache__/test_quality.cpython-311.pyc,,
|
| 343 |
+
networkx/algorithms/community/tests/__pycache__/test_utils.cpython-311.pyc,,
|
| 344 |
+
networkx/algorithms/community/tests/test_asyn_fluid.py,sha256=5DDArgCUSRVXrlG21R5Yu6Gg96xsivqvEib17VGOZLM,3057
|
| 345 |
+
networkx/algorithms/community/tests/test_centrality.py,sha256=ADU1mFn7yl9kTtQjOkfPtjpmkBR_i_6hwbVkWh5qZmw,2931
|
| 346 |
+
networkx/algorithms/community/tests/test_kclique.py,sha256=iA0SBqwbDfaD2u7KM6ccs6LfgAQY_xxrnW05UIT_tFA,2413
|
| 347 |
+
networkx/algorithms/community/tests/test_kernighan_lin.py,sha256=s8bK53Y1a87zvlZ1AJE-QJ2vItnbscSOlHQSrMpetGI,2709
|
| 348 |
+
networkx/algorithms/community/tests/test_label_propagation.py,sha256=uOyx9-rLQCNidVwJ5EcjAlAOubjkK6HooZff5CCYki4,7870
|
| 349 |
+
networkx/algorithms/community/tests/test_louvain.py,sha256=m8TQDH3fX2ygvWVn-mtP3EEmi1F7JF-J_WYuSAxvGXs,7257
|
| 350 |
+
networkx/algorithms/community/tests/test_lukes.py,sha256=f_JU-EzY6PwXEkPN8kk5_3NVg6phlX0nrj1f57M49lk,3961
|
| 351 |
+
networkx/algorithms/community/tests/test_modularity_max.py,sha256=mqtalSff4cmpAPyOExOolfICOE7YuOtHA3BqT84eZlg,10365
|
| 352 |
+
networkx/algorithms/community/tests/test_quality.py,sha256=_kbOlYD1mpPduNQU1wJx58we6Z8CbmQ8wsDwOqTE4hg,5274
|
| 353 |
+
networkx/algorithms/community/tests/test_utils.py,sha256=r_YEdGUaGZo8B16FxzocmkgpRrWgqyN7ehvx_qFiYu4,706
|
| 354 |
+
networkx/algorithms/components/__init__.py,sha256=Dt74KZWp_cJ_j0lL5hd_S50_hia5DKcC2SjuRnubr6M,173
|
| 355 |
+
networkx/algorithms/components/__pycache__/__init__.cpython-311.pyc,,
|
| 356 |
+
networkx/algorithms/components/__pycache__/attracting.cpython-311.pyc,,
|
| 357 |
+
networkx/algorithms/components/__pycache__/biconnected.cpython-311.pyc,,
|
| 358 |
+
networkx/algorithms/components/__pycache__/connected.cpython-311.pyc,,
|
| 359 |
+
networkx/algorithms/components/__pycache__/semiconnected.cpython-311.pyc,,
|
| 360 |
+
networkx/algorithms/components/__pycache__/strongly_connected.cpython-311.pyc,,
|
| 361 |
+
networkx/algorithms/components/__pycache__/weakly_connected.cpython-311.pyc,,
|
| 362 |
+
networkx/algorithms/components/attracting.py,sha256=DYv4WYi7o65w2gszDcNVPlxPYDESDA_r0Z4gDzfpEDA,2699
|
| 363 |
+
networkx/algorithms/components/biconnected.py,sha256=6GRTNyPgwvboDpUdjA9GODDa9vtxTNELEirHkcDHuXs,12765
|
| 364 |
+
networkx/algorithms/components/connected.py,sha256=CiwwhpZo_ppuSCm63cMkm64IJybY_OAOxewWCaGUU7s,4312
|
| 365 |
+
networkx/algorithms/components/semiconnected.py,sha256=M_bCya75ayQONDqv4HCfV8fAXPITAQbP7pdOl7mt8BQ,2025
|
| 366 |
+
networkx/algorithms/components/strongly_connected.py,sha256=EoxDU6BDAp11v57vQvsiQGmZ_1C9iszd4ZDutN4KWAc,11712
|
| 367 |
+
networkx/algorithms/components/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 368 |
+
networkx/algorithms/components/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 369 |
+
networkx/algorithms/components/tests/__pycache__/test_attracting.cpython-311.pyc,,
|
| 370 |
+
networkx/algorithms/components/tests/__pycache__/test_biconnected.cpython-311.pyc,,
|
| 371 |
+
networkx/algorithms/components/tests/__pycache__/test_connected.cpython-311.pyc,,
|
| 372 |
+
networkx/algorithms/components/tests/__pycache__/test_semiconnected.cpython-311.pyc,,
|
| 373 |
+
networkx/algorithms/components/tests/__pycache__/test_strongly_connected.cpython-311.pyc,,
|
| 374 |
+
networkx/algorithms/components/tests/__pycache__/test_weakly_connected.cpython-311.pyc,,
|
| 375 |
+
networkx/algorithms/components/tests/test_attracting.py,sha256=b3N3ZR9E5gLSQWGgaqhcRfRs4KBW6GnnkVYeAjdxC_o,2243
|
| 376 |
+
networkx/algorithms/components/tests/test_biconnected.py,sha256=N-J-dgBgI77ytYUUrXjduLxtDydH7jS-af98fyPBkYc,6036
|
| 377 |
+
networkx/algorithms/components/tests/test_connected.py,sha256=BTbxVcorGH8wKVXOO7D3bn0WR8lXK-Kijm-XDmQhiMY,3983
|
| 378 |
+
networkx/algorithms/components/tests/test_semiconnected.py,sha256=q860lIxZF5M2JmDwwdzy-SGSXnrillOefMx23GcJpw0,1792
|
| 379 |
+
networkx/algorithms/components/tests/test_strongly_connected.py,sha256=66c4bPIdcl1hKEZAY5Wjpglk_mrcVCoDxaKBOaZz754,6639
|
| 380 |
+
networkx/algorithms/components/tests/test_weakly_connected.py,sha256=yi23wxW2Vw6JOMqaWMEuqNRxnleriuAQrZ5JGWE48Jk,2887
|
| 381 |
+
networkx/algorithms/components/weakly_connected.py,sha256=mDxdyU7oGqWTYWY0Rh_VRbR5hcMFhy6yXFb_W20LkxU,4366
|
| 382 |
+
networkx/algorithms/connectivity/__init__.py,sha256=VuUXTkagxX-tHjgmeYJ3K4Eq_luK6kSpv1nZwiwGFd8,281
|
| 383 |
+
networkx/algorithms/connectivity/__pycache__/__init__.cpython-311.pyc,,
|
| 384 |
+
networkx/algorithms/connectivity/__pycache__/connectivity.cpython-311.pyc,,
|
| 385 |
+
networkx/algorithms/connectivity/__pycache__/cuts.cpython-311.pyc,,
|
| 386 |
+
networkx/algorithms/connectivity/__pycache__/disjoint_paths.cpython-311.pyc,,
|
| 387 |
+
networkx/algorithms/connectivity/__pycache__/edge_augmentation.cpython-311.pyc,,
|
| 388 |
+
networkx/algorithms/connectivity/__pycache__/edge_kcomponents.cpython-311.pyc,,
|
| 389 |
+
networkx/algorithms/connectivity/__pycache__/kcomponents.cpython-311.pyc,,
|
| 390 |
+
networkx/algorithms/connectivity/__pycache__/kcutsets.cpython-311.pyc,,
|
| 391 |
+
networkx/algorithms/connectivity/__pycache__/stoerwagner.cpython-311.pyc,,
|
| 392 |
+
networkx/algorithms/connectivity/__pycache__/utils.cpython-311.pyc,,
|
| 393 |
+
networkx/algorithms/connectivity/connectivity.py,sha256=X5tB-FevO5B-514-zb3LoaSOHlcBX0ockB5fBdh2E58,29912
|
| 394 |
+
networkx/algorithms/connectivity/cuts.py,sha256=vCr5z2lvAa4cYIAhmnL-cYr7jVRL5a0TbbrV3Qb_xtQ,23183
|
| 395 |
+
networkx/algorithms/connectivity/disjoint_paths.py,sha256=rQ1qZepPW4j0RnzMefaFtFbd4hsnjZ6tpiUSQwEpDxE,14852
|
| 396 |
+
networkx/algorithms/connectivity/edge_augmentation.py,sha256=IJmZg75CiEmpIE0tQyFzbd6ZKFKGH--hBs7yuYMLzAA,43988
|
| 397 |
+
networkx/algorithms/connectivity/edge_kcomponents.py,sha256=8jQ-ba3qxdCRK8dFDTAAcqG55-vOfJ_smRXeQAIw6FU,20709
|
| 398 |
+
networkx/algorithms/connectivity/kcomponents.py,sha256=Ax0v4yudKFbkuzmek2TUEh3UPFIPoy6gJ7N4ZtUiO-A,8166
|
| 399 |
+
networkx/algorithms/connectivity/kcutsets.py,sha256=rtSXzS7uIaNewh7RT_-lukXvr48_Cdl56VKalb8bQ50,9423
|
| 400 |
+
networkx/algorithms/connectivity/stoerwagner.py,sha256=RW_Zx4wsdikYH8UB34zLDVLBBfpPQ4UBSOh_oYwhkMI,5375
|
| 401 |
+
networkx/algorithms/connectivity/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 402 |
+
networkx/algorithms/connectivity/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 403 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_connectivity.cpython-311.pyc,,
|
| 404 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_cuts.cpython-311.pyc,,
|
| 405 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_disjoint_paths.cpython-311.pyc,,
|
| 406 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_edge_augmentation.cpython-311.pyc,,
|
| 407 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_edge_kcomponents.cpython-311.pyc,,
|
| 408 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_kcomponents.cpython-311.pyc,,
|
| 409 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_kcutsets.cpython-311.pyc,,
|
| 410 |
+
networkx/algorithms/connectivity/tests/__pycache__/test_stoer_wagner.cpython-311.pyc,,
|
| 411 |
+
networkx/algorithms/connectivity/tests/test_connectivity.py,sha256=eSmsi8uQk6MI591JgtSu2elIusb08bmSZS0h9gxb76I,15027
|
| 412 |
+
networkx/algorithms/connectivity/tests/test_cuts.py,sha256=4F8seWb-sPDDjjVMkh14gst5UQa5f-zDkCsZIdJjVzo,10353
|
| 413 |
+
networkx/algorithms/connectivity/tests/test_disjoint_paths.py,sha256=NLHReLoXSKoA6KPBNRbjF84ktg5PEaaktIj2AII3SDY,8392
|
| 414 |
+
networkx/algorithms/connectivity/tests/test_edge_augmentation.py,sha256=d3ymFHyY2G4cpy1Y6wu4ze339qfF2LRp2HmGAIVjnMM,15731
|
| 415 |
+
networkx/algorithms/connectivity/tests/test_edge_kcomponents.py,sha256=CZ26Dy91WOUqhw1X73mqLGX-WHWzBBIeBCgrp6KK4Zo,16453
|
| 416 |
+
networkx/algorithms/connectivity/tests/test_kcomponents.py,sha256=ohoSX8GACeszRZdzTiNuWXSFitfU9DzP0hqllS2gvMU,8554
|
| 417 |
+
networkx/algorithms/connectivity/tests/test_kcutsets.py,sha256=TU6vl9cVtl7GstL2OrPGwVX2PY1R_AGQ6lJ9QQX5UBQ,8458
|
| 418 |
+
networkx/algorithms/connectivity/tests/test_stoer_wagner.py,sha256=A291C30_t2CI1erPCqN1W0DoAj3zqNA8fThPIj4Rku0,3011
|
| 419 |
+
networkx/algorithms/connectivity/utils.py,sha256=8h29TgBEeaZbF_4OFNgtY2XLqURD_va_wezmz709Qfs,3168
|
| 420 |
+
networkx/algorithms/core.py,sha256=mNKH8fwCgbCbaQAcIdZq8Dx9p_bsHiyQn4fAXOdR5K4,15990
|
| 421 |
+
networkx/algorithms/covering.py,sha256=4SiBc9eJi4vQ0N5juRfw6atcyjH1xB_iSWwT6WOZhYk,5290
|
| 422 |
+
networkx/algorithms/cuts.py,sha256=VSEhUHwqRFhfS70L-PzsUGEzN09uhC69B-5hwSixj7A,9960
|
| 423 |
+
networkx/algorithms/cycles.py,sha256=eHduXG1NbfMOIT-RNDWHMyDeRiWC-3IAOokh0kyIDhs,43080
|
| 424 |
+
networkx/algorithms/d_separation.py,sha256=2l6sRqNEldQQltIlVo7lK6ew115PYLT0OJcCjeQBnJY,15440
|
| 425 |
+
networkx/algorithms/dag.py,sha256=1LkfG8kYN-dAjXk21Tmo7eCr9FaYpp4kMX37JCktlY4,39144
|
| 426 |
+
networkx/algorithms/distance_measures.py,sha256=pMMLUutcc93wdbTfKkltEic7dcj5st95eEPpuxtHiNc,29136
|
| 427 |
+
networkx/algorithms/distance_regular.py,sha256=KksQ9jiqigD5DzD63DXmxoeV8RAj1TF7hjyi9FLjbws,6914
|
| 428 |
+
networkx/algorithms/dominance.py,sha256=wO5FnplVOSkPBdFSBcPQMgt-0bykxaEtXmdqRjGg3d8,3422
|
| 429 |
+
networkx/algorithms/dominating.py,sha256=lA9lP6SXtjZsUPyKM58Uflgp58aSqfveTeoe9aQuy7Y,2675
|
| 430 |
+
networkx/algorithms/efficiency_measures.py,sha256=OGkRnD5lrXUqr4TAPW9f_y2g89k9V_-L1EkvWy9Yibo,4786
|
| 431 |
+
networkx/algorithms/euler.py,sha256=hf2HPmE6GkRm6DhG0-DD4wIJmvnAXy__ddXx2BGqsBU,14160
|
| 432 |
+
networkx/algorithms/flow/__init__.py,sha256=rVtMUy6dViPLewjDRntmn15QF0bQwiDdQbZZx9j7Drc,341
|
| 433 |
+
networkx/algorithms/flow/__pycache__/__init__.cpython-311.pyc,,
|
| 434 |
+
networkx/algorithms/flow/__pycache__/boykovkolmogorov.cpython-311.pyc,,
|
| 435 |
+
networkx/algorithms/flow/__pycache__/capacityscaling.cpython-311.pyc,,
|
| 436 |
+
networkx/algorithms/flow/__pycache__/dinitz_alg.cpython-311.pyc,,
|
| 437 |
+
networkx/algorithms/flow/__pycache__/edmondskarp.cpython-311.pyc,,
|
| 438 |
+
networkx/algorithms/flow/__pycache__/gomory_hu.cpython-311.pyc,,
|
| 439 |
+
networkx/algorithms/flow/__pycache__/maxflow.cpython-311.pyc,,
|
| 440 |
+
networkx/algorithms/flow/__pycache__/mincost.cpython-311.pyc,,
|
| 441 |
+
networkx/algorithms/flow/__pycache__/networksimplex.cpython-311.pyc,,
|
| 442 |
+
networkx/algorithms/flow/__pycache__/preflowpush.cpython-311.pyc,,
|
| 443 |
+
networkx/algorithms/flow/__pycache__/shortestaugmentingpath.cpython-311.pyc,,
|
| 444 |
+
networkx/algorithms/flow/__pycache__/utils.cpython-311.pyc,,
|
| 445 |
+
networkx/algorithms/flow/boykovkolmogorov.py,sha256=gJFnK5qZMg8xMWs2-aGx5-LLM25C48x2IPy-_50V6_c,13435
|
| 446 |
+
networkx/algorithms/flow/capacityscaling.py,sha256=G4wdqfhQ4Gf7Fx3Eoh5_DUnpzD_qOT-8yWfaZ1dbbWA,14459
|
| 447 |
+
networkx/algorithms/flow/dinitz_alg.py,sha256=mtSov40Oay_kz2v381MkOp5OSpDhKiH2OSINkrImsE0,7310
|
| 448 |
+
networkx/algorithms/flow/edmondskarp.py,sha256=iafmZIMPO8euDc7uJQ1dg84s4a9OzK4tKMthF2jQoeo,8292
|
| 449 |
+
networkx/algorithms/flow/gomory_hu.py,sha256=5fEaPaTi9_ox7CarltPwqSEGnF3OyxJJfWf04g-Aa50,6320
|
| 450 |
+
networkx/algorithms/flow/maxflow.py,sha256=xyVgIMRtxRSUHZb-4txwc78ZEIFixzCQffG5NxioR98,22809
|
| 451 |
+
networkx/algorithms/flow/mincost.py,sha256=JA6lLUmQ-UyxrdWdzbS3x8oK3t4MaPPBf_44Pgor9yA,12248
|
| 452 |
+
networkx/algorithms/flow/networksimplex.py,sha256=eimOUJ4n2-jRBN8LgPoeuFrU38O2JRCB1O0uEkG7wkg,25175
|
| 453 |
+
networkx/algorithms/flow/preflowpush.py,sha256=wIl2b0MpnhunZb4HpShxMVy1NgPggsAGF7chP0crKKw,15823
|
| 454 |
+
networkx/algorithms/flow/shortestaugmentingpath.py,sha256=7vfa73BxJ6cHfzTy6ibXoD8DuOjK2lgp-EshUeimvZA,10474
|
| 455 |
+
networkx/algorithms/flow/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 456 |
+
networkx/algorithms/flow/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 457 |
+
networkx/algorithms/flow/tests/__pycache__/test_gomory_hu.cpython-311.pyc,,
|
| 458 |
+
networkx/algorithms/flow/tests/__pycache__/test_maxflow.cpython-311.pyc,,
|
| 459 |
+
networkx/algorithms/flow/tests/__pycache__/test_maxflow_large_graph.cpython-311.pyc,,
|
| 460 |
+
networkx/algorithms/flow/tests/__pycache__/test_mincost.cpython-311.pyc,,
|
| 461 |
+
networkx/algorithms/flow/tests/__pycache__/test_networksimplex.cpython-311.pyc,,
|
| 462 |
+
networkx/algorithms/flow/tests/gl1.gpickle.bz2,sha256=z4-BzrXqruFiGqYLiS2D5ZamFz9vZRc1m2ef89qhsPg,44623
|
| 463 |
+
networkx/algorithms/flow/tests/gw1.gpickle.bz2,sha256=b3nw6Q-kxR7HkWXxWWPh7YlHdXbga8qmeuYiwmBBGTE,42248
|
| 464 |
+
networkx/algorithms/flow/tests/netgen-2.gpickle.bz2,sha256=OxfmbN7ajtuNHexyYmx38fZd1GdeP3bcL8T9hKoDjjA,18972
|
| 465 |
+
networkx/algorithms/flow/tests/test_gomory_hu.py,sha256=aWtbI3AHofIK6LDJnmj9UH1QOfulXsi5NyB7bNyV2Vw,4471
|
| 466 |
+
networkx/algorithms/flow/tests/test_maxflow.py,sha256=YRgkrdRj6NMHOXio2Zgr7-ErEzCbq7Z0w90azNffCC4,18727
|
| 467 |
+
networkx/algorithms/flow/tests/test_maxflow_large_graph.py,sha256=fMweTQ3MzsZWYI-ul2dGR8OfGQeo8df2fLeCleHqxZw,4623
|
| 468 |
+
networkx/algorithms/flow/tests/test_mincost.py,sha256=n4fFLDwDLy7Tau-_ey1CoxZwKhFjk28GLGJjCyxhClk,17816
|
| 469 |
+
networkx/algorithms/flow/tests/test_networksimplex.py,sha256=bsVxlvHAD0K7aDevCcVaa9uRNNsWAevw6yUKlj2T8No,12103
|
| 470 |
+
networkx/algorithms/flow/tests/wlm3.gpickle.bz2,sha256=zKy6Hg-_swvsNh8OSOyIyZnTR0_Npd35O9RErOF8-g4,88132
|
| 471 |
+
networkx/algorithms/flow/utils.py,sha256=TyckjUeH5qcBUSARpkuZDXaVirYGuo9xvJK8cno0T38,6001
|
| 472 |
+
networkx/algorithms/graph_hashing.py,sha256=cOAW2XlFvuYokbmhEeKiX4KQgIHL6PjraBqsZizcj_A,11887
|
| 473 |
+
networkx/algorithms/graphical.py,sha256=BYh1nXb2Kg1AYLJBz926QIKcHkAtXqInpsb7QSzykAQ,15807
|
| 474 |
+
networkx/algorithms/hierarchy.py,sha256=jDj8Ld7InknG7OVLVSnT82cqzNvBQ4FT5Qso107kQVQ,1541
|
| 475 |
+
networkx/algorithms/hybrid.py,sha256=fFfA7Ki4zKxm9r8VEvreUqyCvGeCygsBbJZPsvXUQ7A,6180
|
| 476 |
+
networkx/algorithms/isolate.py,sha256=toiuRPi4qb06D_hREZWbAcDJ4c8yx8aKftWez22Efj0,2325
|
| 477 |
+
networkx/algorithms/isomorphism/__init__.py,sha256=gPRQ-_X6xN2lJZPQNw86IVj4NemGmbQYTejf5yJ32N4,406
|
| 478 |
+
networkx/algorithms/isomorphism/__pycache__/__init__.cpython-311.pyc,,
|
| 479 |
+
networkx/algorithms/isomorphism/__pycache__/ismags.cpython-311.pyc,,
|
| 480 |
+
networkx/algorithms/isomorphism/__pycache__/isomorph.cpython-311.pyc,,
|
| 481 |
+
networkx/algorithms/isomorphism/__pycache__/isomorphvf2.cpython-311.pyc,,
|
| 482 |
+
networkx/algorithms/isomorphism/__pycache__/matchhelpers.cpython-311.pyc,,
|
| 483 |
+
networkx/algorithms/isomorphism/__pycache__/temporalisomorphvf2.cpython-311.pyc,,
|
| 484 |
+
networkx/algorithms/isomorphism/__pycache__/tree_isomorphism.cpython-311.pyc,,
|
| 485 |
+
networkx/algorithms/isomorphism/__pycache__/vf2pp.cpython-311.pyc,,
|
| 486 |
+
networkx/algorithms/isomorphism/__pycache__/vf2userfunc.cpython-311.pyc,,
|
| 487 |
+
networkx/algorithms/isomorphism/ismags.py,sha256=5KRimh6jxs7BIDqAo48d01i8_1WkkckV0xVWkQ64czs,43529
|
| 488 |
+
networkx/algorithms/isomorphism/isomorph.py,sha256=PQONDdw4Mc6neaPhW7yVQxoxOrbOqYorgBse4OjYtBA,7097
|
| 489 |
+
networkx/algorithms/isomorphism/isomorphvf2.py,sha256=1LWpe54aulfYukTS87DoS4l1reCpOqZEr-74MOQLrRc,40528
|
| 490 |
+
networkx/algorithms/isomorphism/matchhelpers.py,sha256=b7A7SwbqXj8CKAw-vrISgBNhDcEXobPjljkOhyWn4aM,10891
|
| 491 |
+
networkx/algorithms/isomorphism/temporalisomorphvf2.py,sha256=-1NW81l8kM9orQ2ni9tcNizQzEhOUE9BaBJXjUWqhiI,10948
|
| 492 |
+
networkx/algorithms/isomorphism/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 493 |
+
networkx/algorithms/isomorphism/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 494 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_ismags.cpython-311.pyc,,
|
| 495 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_isomorphism.cpython-311.pyc,,
|
| 496 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_isomorphvf2.cpython-311.pyc,,
|
| 497 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_match_helpers.cpython-311.pyc,,
|
| 498 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_temporalisomorphvf2.cpython-311.pyc,,
|
| 499 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_tree_isomorphism.cpython-311.pyc,,
|
| 500 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_vf2pp.cpython-311.pyc,,
|
| 501 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_vf2pp_helpers.cpython-311.pyc,,
|
| 502 |
+
networkx/algorithms/isomorphism/tests/__pycache__/test_vf2userfunc.cpython-311.pyc,,
|
| 503 |
+
networkx/algorithms/isomorphism/tests/iso_r01_s80.A99,sha256=hKzMtYLUR8Oqp9pmJR6RwG7qo31aNPZcnXy4KHDGhqU,1442
|
| 504 |
+
networkx/algorithms/isomorphism/tests/iso_r01_s80.B99,sha256=AHx_W2xG4JEcz1xKoN5TwCHVE6-UO2PiMByynkd4TPE,1442
|
| 505 |
+
networkx/algorithms/isomorphism/tests/si2_b06_m200.A99,sha256=NVnPFA52amNl3qM55G1V9eL9ZlP9NwugBlPf-zekTFU,310
|
| 506 |
+
networkx/algorithms/isomorphism/tests/si2_b06_m200.B99,sha256=-clIDp05LFNRHA2BghhGTeyuXDqBBqA9XpEzpB7Ku7M,1602
|
| 507 |
+
networkx/algorithms/isomorphism/tests/test_ismags.py,sha256=2sOkbB7Aejnq4zDx9BhJyfavf5DLiKJaUPusb3fhGRk,10585
|
| 508 |
+
networkx/algorithms/isomorphism/tests/test_isomorphism.py,sha256=1GZmmqNWk605Qq9h55V_5SfEKPM50Ceq6DSICdh6ufs,1663
|
| 509 |
+
networkx/algorithms/isomorphism/tests/test_isomorphvf2.py,sha256=s4yO4cHJk5qIpRemnSzD1MJEeSJPNpZcOU6LeWVhGXI,11751
|
| 510 |
+
networkx/algorithms/isomorphism/tests/test_match_helpers.py,sha256=uuTcvjgf2LPqSQzzECPIh0dezw8-a1IN0u42u8TxwAw,2483
|
| 511 |
+
networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py,sha256=DZy2zAt74jiTAM-jGK5H9aGRn1ZsMgQl9K5UNsu178Y,7346
|
| 512 |
+
networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py,sha256=yj3C8ZBhi57I6kxetfneGpTse9hrYBvJQfGb0qks_G0,7066
|
| 513 |
+
networkx/algorithms/isomorphism/tests/test_vf2pp.py,sha256=65RkN1mPWLoxirE7SlIvfaKMJk80b_ZwWG6HTJtlkPg,49924
|
| 514 |
+
networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py,sha256=s4zz4IYYm2q8nHmkG0eRI2yJjcTx6zjRL7HTVIl1a-s,90080
|
| 515 |
+
networkx/algorithms/isomorphism/tests/test_vf2userfunc.py,sha256=yby-vt4sYxc1uzlnD-iETREbojgNkpQGbLkrPER_Sss,6629
|
| 516 |
+
networkx/algorithms/isomorphism/tree_isomorphism.py,sha256=HKPUDU1oCYCfEgyNYN0e31K9PqE3hsqHZMX8Iuq7i1Q,9397
|
| 517 |
+
networkx/algorithms/isomorphism/vf2pp.py,sha256=oKBYHbwS0j3UihEI7LgaUZ7sMhv3nLLFrnCk3jETxnw,36383
|
| 518 |
+
networkx/algorithms/isomorphism/vf2userfunc.py,sha256=VVTNWEzHnRaZrjtinBnkStRNsvC9FVvivXWs-pqG6LM,7475
|
| 519 |
+
networkx/algorithms/link_analysis/__init__.py,sha256=UkcgTDdzsIu-jsJ4jBwP8sF2CsRPC1YcZZT-q5Wlj3I,118
|
| 520 |
+
networkx/algorithms/link_analysis/__pycache__/__init__.cpython-311.pyc,,
|
| 521 |
+
networkx/algorithms/link_analysis/__pycache__/hits_alg.cpython-311.pyc,,
|
| 522 |
+
networkx/algorithms/link_analysis/__pycache__/pagerank_alg.cpython-311.pyc,,
|
| 523 |
+
networkx/algorithms/link_analysis/hits_alg.py,sha256=5ntPDFZNGYbrw0Bq4WNvmoIWBxSa6PtIoBVHhHmv-8M,10244
|
| 524 |
+
networkx/algorithms/link_analysis/pagerank_alg.py,sha256=0l7xABhW3Vkhx07y87NynTdYqcTql0UAVfCghURhZFk,17183
|
| 525 |
+
networkx/algorithms/link_analysis/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 526 |
+
networkx/algorithms/link_analysis/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 527 |
+
networkx/algorithms/link_analysis/tests/__pycache__/test_hits.cpython-311.pyc,,
|
| 528 |
+
networkx/algorithms/link_analysis/tests/__pycache__/test_pagerank.cpython-311.pyc,,
|
| 529 |
+
networkx/algorithms/link_analysis/tests/test_hits.py,sha256=BXMNyKv4OfRKXH9W8u8qCV3zaghDlEItRhYLN0TB-CM,2525
|
| 530 |
+
networkx/algorithms/link_analysis/tests/test_pagerank.py,sha256=g0HyPn5HBXZeu-TQSWqqTzOfnzaejRfBuIIpKYSGecE,7530
|
| 531 |
+
networkx/algorithms/link_prediction.py,sha256=z4abyN_TIEZiq6TN9YP7TYvrdiDhzgg-Irn9UW1IkYQ,19968
|
| 532 |
+
networkx/algorithms/lowest_common_ancestors.py,sha256=popl_tFPaN5r4P1UQ47-qzEQ9EM0EQCeA7F_9th71Ek,9186
|
| 533 |
+
networkx/algorithms/matching.py,sha256=ePjtahy-HIMke90HjmcgO1mJOUcG7WYJFfFKuAqQ8Jk,44530
|
| 534 |
+
networkx/algorithms/minors/__init__.py,sha256=ceeKdsZ6U1H40ED-KmtVGkbADxeWMTVG07Ja8P7N_Pg,587
|
| 535 |
+
networkx/algorithms/minors/__pycache__/__init__.cpython-311.pyc,,
|
| 536 |
+
networkx/algorithms/minors/__pycache__/contraction.cpython-311.pyc,,
|
| 537 |
+
networkx/algorithms/minors/contraction.py,sha256=dS3lUcojiGydTV2IOrpyD3UxChG5ZYqHy74c-Euulns,22735
|
| 538 |
+
networkx/algorithms/minors/tests/__pycache__/test_contraction.cpython-311.pyc,,
|
| 539 |
+
networkx/algorithms/minors/tests/test_contraction.py,sha256=rob7wHlt3xoXYxpcXQOwm7zP0TLyRqWV1JxsZlE8kfo,14212
|
| 540 |
+
networkx/algorithms/mis.py,sha256=9ZdCuXXAlKOVHgWJMtillI1vLOXQGlRpSoz-rbnMU3I,2339
|
| 541 |
+
networkx/algorithms/moral.py,sha256=k9uZGz0S6YK3U5hoiRLzR--PRQNktNdaI9-lrzsrgBg,1511
|
| 542 |
+
networkx/algorithms/node_classification.py,sha256=ACq6C3i2p-f5E4UGHK8XQ6ng6ZVf6DxHdx4xR0x1zrA,6461
|
| 543 |
+
networkx/algorithms/non_randomness.py,sha256=wEXsl0fat8w0SAROXT_mB0B4fidVD8N5Ue5rLDMcu7Q,2893
|
| 544 |
+
networkx/algorithms/operators/__init__.py,sha256=dJ3xOXvHxSzzM3-YcfvjGTJ_ndxULF1TybkIRzUS87Y,201
|
| 545 |
+
networkx/algorithms/operators/__pycache__/__init__.cpython-311.pyc,,
|
| 546 |
+
networkx/algorithms/operators/__pycache__/all.cpython-311.pyc,,
|
| 547 |
+
networkx/algorithms/operators/__pycache__/binary.cpython-311.pyc,,
|
| 548 |
+
networkx/algorithms/operators/__pycache__/product.cpython-311.pyc,,
|
| 549 |
+
networkx/algorithms/operators/__pycache__/unary.cpython-311.pyc,,
|
| 550 |
+
networkx/algorithms/operators/all.py,sha256=_1em4J-Y6GQK0_UlkTIKZ7DNdTSzdXkZ748gAq9dxkg,9544
|
| 551 |
+
networkx/algorithms/operators/binary.py,sha256=Un3NpZQxmGB3EhQY-_-qb-Kzr6lJy9RRVJZR0FOSrVI,12689
|
| 552 |
+
networkx/algorithms/operators/product.py,sha256=3hm3Q1K3BaH6RYUTP369jGgFSVsyAF3crDS74PKlVDM,16115
|
| 553 |
+
networkx/algorithms/operators/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 554 |
+
networkx/algorithms/operators/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 555 |
+
networkx/algorithms/operators/tests/__pycache__/test_all.cpython-311.pyc,,
|
| 556 |
+
networkx/algorithms/operators/tests/__pycache__/test_binary.cpython-311.pyc,,
|
| 557 |
+
networkx/algorithms/operators/tests/__pycache__/test_product.cpython-311.pyc,,
|
| 558 |
+
networkx/algorithms/operators/tests/__pycache__/test_unary.cpython-311.pyc,,
|
| 559 |
+
networkx/algorithms/operators/tests/test_all.py,sha256=Pqjv9QiA0875Yl9D5o6c5Ml0t4KHpH2a5jbpAoZQXFc,8250
|
| 560 |
+
networkx/algorithms/operators/tests/test_binary.py,sha256=N_HEuvjUPneQK44rYo8AMhR7OdfQk76U9EqIXCt65X4,12795
|
| 561 |
+
networkx/algorithms/operators/tests/test_product.py,sha256=hbnfR6gKXhl2BiEHKrgi4hMYIie95noooNmVBws1iLo,13402
|
| 562 |
+
networkx/algorithms/operators/tests/test_unary.py,sha256=UZdzbt5GI9hnflEizUWXihGqBWmSFJDkzjwVv6wziQE,1415
|
| 563 |
+
networkx/algorithms/operators/unary.py,sha256=9cLxWpgt7aleGAgL608nW99s1gaw5kVGa-LybPt--qY,1745
|
| 564 |
+
networkx/algorithms/planar_drawing.py,sha256=q9QJYn3PhDHzfNO1t5xAStN1XDzTPybFxtorb60KF5k,16289
|
| 565 |
+
networkx/algorithms/planarity.py,sha256=j1SbhjE620Jda4PHALJh6PIwu_GHJKwACHnB6_q02aA,39476
|
| 566 |
+
networkx/algorithms/polynomials.py,sha256=WNcCyqedQTPhhiwp9TJRqZXuo4KGTPjb85GF86XvDcU,11270
|
| 567 |
+
networkx/algorithms/reciprocity.py,sha256=vKwcggMOSOz29-_j0R3do52qosaYFbfJJBXOkW-5jH8,2846
|
| 568 |
+
networkx/algorithms/regular.py,sha256=0zEftUGLYqxeUEAV2cerg6bda98fQuqrDyKkNdkvvpo,6680
|
| 569 |
+
networkx/algorithms/richclub.py,sha256=EP7v7VT6GhNAqFQ15I-WeDdksFISBArkS-guAPpdJoo,4166
|
| 570 |
+
networkx/algorithms/shortest_paths/__init__.py,sha256=Rmxtsje-mPdQyeYhE8TP2NId-iZEOu4eAsWhVRm2Xqk,285
|
| 571 |
+
networkx/algorithms/shortest_paths/__pycache__/__init__.cpython-311.pyc,,
|
| 572 |
+
networkx/algorithms/shortest_paths/__pycache__/astar.cpython-311.pyc,,
|
| 573 |
+
networkx/algorithms/shortest_paths/__pycache__/dense.cpython-311.pyc,,
|
| 574 |
+
networkx/algorithms/shortest_paths/__pycache__/generic.cpython-311.pyc,,
|
| 575 |
+
networkx/algorithms/shortest_paths/__pycache__/unweighted.cpython-311.pyc,,
|
| 576 |
+
networkx/algorithms/shortest_paths/__pycache__/weighted.cpython-311.pyc,,
|
| 577 |
+
networkx/algorithms/shortest_paths/astar.py,sha256=mb9Z0nmHJhTCuF_tAvS3oiNrpplCNQReunAwrLJcYME,7674
|
| 578 |
+
networkx/algorithms/shortest_paths/dense.py,sha256=xBzv4NHJ-J2ehGnDEgjHJ6a3LidSKYBy2p36qBTdgfI,8151
|
| 579 |
+
networkx/algorithms/shortest_paths/generic.py,sha256=uN1-eUXz6n9R0WWwCgpiynJTfyYyp5RYgCUeroeizWo,25321
|
| 580 |
+
networkx/algorithms/shortest_paths/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 581 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 582 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/test_astar.cpython-311.pyc,,
|
| 583 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/test_dense.cpython-311.pyc,,
|
| 584 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/test_dense_numpy.cpython-311.pyc,,
|
| 585 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/test_generic.cpython-311.pyc,,
|
| 586 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/test_unweighted.cpython-311.pyc,,
|
| 587 |
+
networkx/algorithms/shortest_paths/tests/__pycache__/test_weighted.cpython-311.pyc,,
|
| 588 |
+
networkx/algorithms/shortest_paths/tests/test_astar.py,sha256=X9tLO2OVDrHjSy1-nNaNFIRngnOo-ITT5HAj6PAXafk,7176
|
| 589 |
+
networkx/algorithms/shortest_paths/tests/test_dense.py,sha256=ievl4gu3Exl_31hp4OKcsAGPb3g3_xFUM4t3NnvrG_A,6747
|
| 590 |
+
networkx/algorithms/shortest_paths/tests/test_dense_numpy.py,sha256=BNwXCe2wgNPE8o35-shPsFj8l19c_QG6Ye8tkIGphf8,2300
|
| 591 |
+
networkx/algorithms/shortest_paths/tests/test_generic.py,sha256=aR3pUbMS-s3vBZJg7kauoY6rmZbjlx-DweCC1wyZQI4,18156
|
| 592 |
+
networkx/algorithms/shortest_paths/tests/test_unweighted.py,sha256=fjpDkp38DmW8R2qpLRwRjcbYZp4an0f0yIq40XsFKJ8,5899
|
| 593 |
+
networkx/algorithms/shortest_paths/tests/test_weighted.py,sha256=dmzFBYN3QEDZoun7RAtSe_spsGSbvkDiJSgUf9e-1K8,35038
|
| 594 |
+
networkx/algorithms/shortest_paths/unweighted.py,sha256=EuiZiHEQEOrFZpmUMm52ThANjyfWeWhKYFIrnvu9G_s,15494
|
| 595 |
+
networkx/algorithms/shortest_paths/weighted.py,sha256=esTy6BYmWqBcCGN15Ld3jJCfjTNZtw4pyphEK4g2NqQ,82339
|
| 596 |
+
networkx/algorithms/similarity.py,sha256=Y5GRl1NW-IFVqwogOdHJs-SAHmpv1SgfN7MIF7y8odQ,59062
|
| 597 |
+
networkx/algorithms/simple_paths.py,sha256=cliV45VPZSKngEAEI6jQX5o8JD9G7Yhe_kFnCCvZP1k,30535
|
| 598 |
+
networkx/algorithms/smallworld.py,sha256=sD1yv28XfqfwSi0Y88GOKXPzVwMJlWpNf8S14ZLOw_k,13494
|
| 599 |
+
networkx/algorithms/smetric.py,sha256=jHdRFK7HyeFkhQWkKApa1MpAyi512pY4Ksulkh8joo8,1933
|
| 600 |
+
networkx/algorithms/sparsifiers.py,sha256=InQAPhcRTI5O_l9ckBc2LAheONfBVx1Wn6yYY0NVOiA,10073
|
| 601 |
+
networkx/algorithms/structuralholes.py,sha256=58c8f6hBwxhp5-GL1JPWnR5dRLZU3gNziddeFVIeXSE,9319
|
| 602 |
+
networkx/algorithms/summarization.py,sha256=ymt635-uEH_uocXwF0_tU8EbGlW_1wf3ZM-v0CG7dH4,23251
|
| 603 |
+
networkx/algorithms/swap.py,sha256=uYRzbxhEONmGQlWWDsDw_SJQgIWJfXzvSKYQAd50HfE,14579
|
| 604 |
+
networkx/algorithms/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 605 |
+
networkx/algorithms/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 606 |
+
networkx/algorithms/tests/__pycache__/test_asteroidal.cpython-311.pyc,,
|
| 607 |
+
networkx/algorithms/tests/__pycache__/test_boundary.cpython-311.pyc,,
|
| 608 |
+
networkx/algorithms/tests/__pycache__/test_bridges.cpython-311.pyc,,
|
| 609 |
+
networkx/algorithms/tests/__pycache__/test_chains.cpython-311.pyc,,
|
| 610 |
+
networkx/algorithms/tests/__pycache__/test_chordal.cpython-311.pyc,,
|
| 611 |
+
networkx/algorithms/tests/__pycache__/test_clique.cpython-311.pyc,,
|
| 612 |
+
networkx/algorithms/tests/__pycache__/test_cluster.cpython-311.pyc,,
|
| 613 |
+
networkx/algorithms/tests/__pycache__/test_communicability.cpython-311.pyc,,
|
| 614 |
+
networkx/algorithms/tests/__pycache__/test_core.cpython-311.pyc,,
|
| 615 |
+
networkx/algorithms/tests/__pycache__/test_covering.cpython-311.pyc,,
|
| 616 |
+
networkx/algorithms/tests/__pycache__/test_cuts.cpython-311.pyc,,
|
| 617 |
+
networkx/algorithms/tests/__pycache__/test_cycles.cpython-311.pyc,,
|
| 618 |
+
networkx/algorithms/tests/__pycache__/test_d_separation.cpython-311.pyc,,
|
| 619 |
+
networkx/algorithms/tests/__pycache__/test_dag.cpython-311.pyc,,
|
| 620 |
+
networkx/algorithms/tests/__pycache__/test_distance_measures.cpython-311.pyc,,
|
| 621 |
+
networkx/algorithms/tests/__pycache__/test_distance_regular.cpython-311.pyc,,
|
| 622 |
+
networkx/algorithms/tests/__pycache__/test_dominance.cpython-311.pyc,,
|
| 623 |
+
networkx/algorithms/tests/__pycache__/test_dominating.cpython-311.pyc,,
|
| 624 |
+
networkx/algorithms/tests/__pycache__/test_efficiency.cpython-311.pyc,,
|
| 625 |
+
networkx/algorithms/tests/__pycache__/test_euler.cpython-311.pyc,,
|
| 626 |
+
networkx/algorithms/tests/__pycache__/test_graph_hashing.cpython-311.pyc,,
|
| 627 |
+
networkx/algorithms/tests/__pycache__/test_graphical.cpython-311.pyc,,
|
| 628 |
+
networkx/algorithms/tests/__pycache__/test_hierarchy.cpython-311.pyc,,
|
| 629 |
+
networkx/algorithms/tests/__pycache__/test_hybrid.cpython-311.pyc,,
|
| 630 |
+
networkx/algorithms/tests/__pycache__/test_isolate.cpython-311.pyc,,
|
| 631 |
+
networkx/algorithms/tests/__pycache__/test_link_prediction.cpython-311.pyc,,
|
| 632 |
+
networkx/algorithms/tests/__pycache__/test_lowest_common_ancestors.cpython-311.pyc,,
|
| 633 |
+
networkx/algorithms/tests/__pycache__/test_matching.cpython-311.pyc,,
|
| 634 |
+
networkx/algorithms/tests/__pycache__/test_max_weight_clique.cpython-311.pyc,,
|
| 635 |
+
networkx/algorithms/tests/__pycache__/test_mis.cpython-311.pyc,,
|
| 636 |
+
networkx/algorithms/tests/__pycache__/test_moral.cpython-311.pyc,,
|
| 637 |
+
networkx/algorithms/tests/__pycache__/test_node_classification.cpython-311.pyc,,
|
| 638 |
+
networkx/algorithms/tests/__pycache__/test_non_randomness.cpython-311.pyc,,
|
| 639 |
+
networkx/algorithms/tests/__pycache__/test_planar_drawing.cpython-311.pyc,,
|
| 640 |
+
networkx/algorithms/tests/__pycache__/test_planarity.cpython-311.pyc,,
|
| 641 |
+
networkx/algorithms/tests/__pycache__/test_polynomials.cpython-311.pyc,,
|
| 642 |
+
networkx/algorithms/tests/__pycache__/test_reciprocity.cpython-311.pyc,,
|
| 643 |
+
networkx/algorithms/tests/__pycache__/test_regular.cpython-311.pyc,,
|
| 644 |
+
networkx/algorithms/tests/__pycache__/test_richclub.cpython-311.pyc,,
|
| 645 |
+
networkx/algorithms/tests/__pycache__/test_similarity.cpython-311.pyc,,
|
| 646 |
+
networkx/algorithms/tests/__pycache__/test_simple_paths.cpython-311.pyc,,
|
| 647 |
+
networkx/algorithms/tests/__pycache__/test_smallworld.cpython-311.pyc,,
|
| 648 |
+
networkx/algorithms/tests/__pycache__/test_smetric.cpython-311.pyc,,
|
| 649 |
+
networkx/algorithms/tests/__pycache__/test_sparsifiers.cpython-311.pyc,,
|
| 650 |
+
networkx/algorithms/tests/__pycache__/test_structuralholes.cpython-311.pyc,,
|
| 651 |
+
networkx/algorithms/tests/__pycache__/test_summarization.cpython-311.pyc,,
|
| 652 |
+
networkx/algorithms/tests/__pycache__/test_swap.cpython-311.pyc,,
|
| 653 |
+
networkx/algorithms/tests/__pycache__/test_threshold.cpython-311.pyc,,
|
| 654 |
+
networkx/algorithms/tests/__pycache__/test_time_dependent.cpython-311.pyc,,
|
| 655 |
+
networkx/algorithms/tests/__pycache__/test_tournament.cpython-311.pyc,,
|
| 656 |
+
networkx/algorithms/tests/__pycache__/test_triads.cpython-311.pyc,,
|
| 657 |
+
networkx/algorithms/tests/__pycache__/test_vitality.cpython-311.pyc,,
|
| 658 |
+
networkx/algorithms/tests/__pycache__/test_voronoi.cpython-311.pyc,,
|
| 659 |
+
networkx/algorithms/tests/__pycache__/test_walks.cpython-311.pyc,,
|
| 660 |
+
networkx/algorithms/tests/__pycache__/test_wiener.cpython-311.pyc,,
|
| 661 |
+
networkx/algorithms/tests/test_asteroidal.py,sha256=DnWI5_jnaaZMxtG44XD0K690HZs8ez7HU_9dSR-p6eA,502
|
| 662 |
+
networkx/algorithms/tests/test_boundary.py,sha256=1OSJh32FYFhAVYB5zqxhZGEXZLS0HPp9kvfHZvWmD3o,6227
|
| 663 |
+
networkx/algorithms/tests/test_bridges.py,sha256=FS34gA5cia8di_a2X4meeB7qI0JrsVtpQlL4fe_i1CA,4027
|
| 664 |
+
networkx/algorithms/tests/test_chains.py,sha256=SofaAxDEJDf1gt5sIGVC_O8vT9YcTc8Jq1vfnwVPhkM,4363
|
| 665 |
+
networkx/algorithms/tests/test_chordal.py,sha256=DPdNPY7KtqCsCwYVb4xQfnIm-z35dUJIWxNHtAiQLAQ,4438
|
| 666 |
+
networkx/algorithms/tests/test_clique.py,sha256=FPIF2f8NLODsz-k_qrHt7DolClV_VdNWSh68oe8-ygI,9413
|
| 667 |
+
networkx/algorithms/tests/test_cluster.py,sha256=AltwLWAblpSLa-24KvNuxYxM2IeVl5p2d-kozA9QJ-0,15595
|
| 668 |
+
networkx/algorithms/tests/test_communicability.py,sha256=4KK9wU9gAUqHAAAyHwAKpq2dV9g415s_X0qd7Tt83gU,2938
|
| 669 |
+
networkx/algorithms/tests/test_core.py,sha256=ZmLePvuK-Tv8aQ6tGCJd9965BHKUviNNVV7o3PzwfEE,7016
|
| 670 |
+
networkx/algorithms/tests/test_covering.py,sha256=EeBjQ5mxcVctgavqXZ255T8ryFocuxjxdVpIxVUNFvw,2718
|
| 671 |
+
networkx/algorithms/tests/test_cuts.py,sha256=2Ir5xyIG4cTC4Dgg1cceLXaEFiOCJ60ZTDDn33vz0Ns,5377
|
| 672 |
+
networkx/algorithms/tests/test_cycles.py,sha256=mrID4F3wdoZV1oBPETd8Ebx9UXasC2dWsccx8bq_5C8,34243
|
| 673 |
+
networkx/algorithms/tests/test_d_separation.py,sha256=md90cCjC409qAolNGTFwGTu5N577GdgK2RYW83lxopk,6600
|
| 674 |
+
networkx/algorithms/tests/test_dag.py,sha256=MMSD9Flgl_h2fCDIr7gPr9MACj-cU6Xnn5qK1-LeCSc,27722
|
| 675 |
+
networkx/algorithms/tests/test_distance_measures.py,sha256=LdVbsbebvMZghK2gOgecNGxs7v_WjO8z2okG9uF8rAY,22327
|
| 676 |
+
networkx/algorithms/tests/test_distance_regular.py,sha256=pPZ2CPKo4QLjhxlcJhBQZif6-_2qwfh1kpbrN_mu5tg,2312
|
| 677 |
+
networkx/algorithms/tests/test_dominance.py,sha256=nPqRGSF1GEvUR16ryo-dOql6fLdTvzBmYk8Y3ML-ONc,9373
|
| 678 |
+
networkx/algorithms/tests/test_dominating.py,sha256=hyta7ln6BbHaGlpEUla6jVzh2PRuSjvujLSGXrmwZbc,1228
|
| 679 |
+
networkx/algorithms/tests/test_efficiency.py,sha256=QKWMvyjCG1Byt-oNp7Rz_qxnVeT77Zk27lrzI1qH0mA,1894
|
| 680 |
+
networkx/algorithms/tests/test_euler.py,sha256=4ajCsO3PwKBaz8jTB_b_nHh_yOz9qSPTOhNBloIRAF8,10987
|
| 681 |
+
networkx/algorithms/tests/test_graph_hashing.py,sha256=duR9DQLUpRuy9bv0ZKQPt9gy9WxiX_K0-BVMlnF-WHY,23517
|
| 682 |
+
networkx/algorithms/tests/test_graphical.py,sha256=uhFjvs04odxABToY4IRig_CaUTpAC3SfZRu1p1T7FwY,5366
|
| 683 |
+
networkx/algorithms/tests/test_hierarchy.py,sha256=g3-0pNfzRo-RDW1BsiLXxyi2LwWIJukXx2i4JCpN2fg,941
|
| 684 |
+
networkx/algorithms/tests/test_hybrid.py,sha256=kQLzaMoqZcKFaJ3D7PKbY2O-FX59XDZ1pN5un8My-tk,720
|
| 685 |
+
networkx/algorithms/tests/test_isolate.py,sha256=LyR0YYHJDH5vppQzGzGiJK-aaIV17_Jmla8dMf93olg,555
|
| 686 |
+
networkx/algorithms/tests/test_link_prediction.py,sha256=7c322xESYdH5WEA0TsMw4Jcc_-lqfIsj-SjXP6Y0TVc,19442
|
| 687 |
+
networkx/algorithms/tests/test_lowest_common_ancestors.py,sha256=GvhYCQMnVYD9LHPCNFgWMAUmOV8V5gko0fe05zi1JwU,13153
|
| 688 |
+
networkx/algorithms/tests/test_matching.py,sha256=jhehNkApE5RuMPtbjWNeHn0tPqhVz65mL7QakfRA3Vw,20174
|
| 689 |
+
networkx/algorithms/tests/test_max_weight_clique.py,sha256=JWGZpbQfUaCklCGI170Gfpp3b5ICYwY7RH_DQ1mYQbc,6741
|
| 690 |
+
networkx/algorithms/tests/test_mis.py,sha256=jusLniyKcNWs0994srLJxY3SVeAQqkkXf-h-qtlrfGw,1875
|
| 691 |
+
networkx/algorithms/tests/test_moral.py,sha256=15PZgkx7O9aXQB1npQ2JNqBBkEqPPP2RfeZzKqY-GNU,452
|
| 692 |
+
networkx/algorithms/tests/test_node_classification.py,sha256=NgJJKUHH1GoD1GE3F4QRYBLM3fUo_En3RNtZvhqCjlg,4663
|
| 693 |
+
networkx/algorithms/tests/test_non_randomness.py,sha256=-8s-fJLYRxVNp7QpaMe5Dxrxi0kvewY78d4ja-nXNBk,782
|
| 694 |
+
networkx/algorithms/tests/test_planar_drawing.py,sha256=CBJv6U9tT0BzYVrmEBlARBZSMxBwTsX3krACAnAPfHg,8771
|
| 695 |
+
networkx/algorithms/tests/test_planarity.py,sha256=h9kUOsn0skbvYBcIYzKy5XDGmyP3sTwtvoXYKr_X230,13148
|
| 696 |
+
networkx/algorithms/tests/test_polynomials.py,sha256=baI0Kua1pRngRC6Scm5gRRwi1bl0iET5_Xxo3AZTP3A,1983
|
| 697 |
+
networkx/algorithms/tests/test_reciprocity.py,sha256=X_PXWFOTzuEcyMWpRdwEJfm8lJOfNE_1rb9AAybf4is,1296
|
| 698 |
+
networkx/algorithms/tests/test_regular.py,sha256=zGf7Mmh7XPtwunOoeTfgiICnfsVeCEbMop3NrDgIfqY,2457
|
| 699 |
+
networkx/algorithms/tests/test_richclub.py,sha256=hhRGQGNQ2EINvmTF-XkJxGZXROvQJZuWwubCYq8Mx9U,2585
|
| 700 |
+
networkx/algorithms/tests/test_similarity.py,sha256=JJYVUV-WtjswW-kDbY5tUuyjLI_3mVKOLUbaRz8wCM8,32216
|
| 701 |
+
networkx/algorithms/tests/test_simple_paths.py,sha256=mmuKfi8t9iXLO8tSIuQGbupFe9c6X6cSiGKEWYiWiqM,24075
|
| 702 |
+
networkx/algorithms/tests/test_smallworld.py,sha256=rfgNCRU6YF55f8sCuA5WmX6MmhDci89Tb4jaz4ALjcQ,2405
|
| 703 |
+
networkx/algorithms/tests/test_smetric.py,sha256=wihpgjZS4PaajOuE72RiDEbBWpQcoKPSAfjoAezuRxg,980
|
| 704 |
+
networkx/algorithms/tests/test_sparsifiers.py,sha256=A12V4ljWxvXaSFJ73mHSFK2YNO-k8ax6Me4yEWTsI4s,4043
|
| 705 |
+
networkx/algorithms/tests/test_structuralholes.py,sha256=-48vhIVXcUlmLAi603FdBP6afbVu447JZ1piSCIpRTE,5536
|
| 706 |
+
networkx/algorithms/tests/test_summarization.py,sha256=cGAep6r-v141uAdsPF9r8YTuT-nO7L7puOqPPv339wo,21313
|
| 707 |
+
networkx/algorithms/tests/test_swap.py,sha256=YRpN79MNL1i5Hm2FVb-mNl9SRfHDWAuDnn2Wx95_UYY,5307
|
| 708 |
+
networkx/algorithms/tests/test_threshold.py,sha256=RF_SM5tdMGJfEHETO19mFicnt69UIlvVeuCwI7rxb0M,9751
|
| 709 |
+
networkx/algorithms/tests/test_time_dependent.py,sha256=NmuV2kDo4nh2MeN0hwcJf0QSDtqMD0dfSeeKSsYBtQ8,13342
|
| 710 |
+
networkx/algorithms/tests/test_tournament.py,sha256=xxmLb9Lrmjkh9tKmyv2yYJrhB2PHWh-Bq71M-d1NjQo,4158
|
| 711 |
+
networkx/algorithms/tests/test_triads.py,sha256=tPMzSQDVHZQOmDOKa9Hyem76UO1zh7wcdaM9X_BhxG4,9088
|
| 712 |
+
networkx/algorithms/tests/test_vitality.py,sha256=p5lPWCtVMtbvxDw6TJUaf8vpb0zKPoz5pND722xiypQ,1380
|
| 713 |
+
networkx/algorithms/tests/test_voronoi.py,sha256=M4B6JtkJUw56ULEWRs1kyVEUsroNrnb5FBq9OioAyHM,3477
|
| 714 |
+
networkx/algorithms/tests/test_walks.py,sha256=X8cb-YvGHiiqbMEXuKMSdTAb9WtVtbHjIESNSqpJTmU,1499
|
| 715 |
+
networkx/algorithms/tests/test_wiener.py,sha256=NJJbXZ9L5ZeFGQpCpvYVWFNqyX3amkbuDQEBL7wCixw,2080
|
| 716 |
+
networkx/algorithms/threshold.py,sha256=1GUMnQQvN_6mR5oowUbgoykaWPyV4zO1mO1Dyb9NdAE,31088
|
| 717 |
+
networkx/algorithms/time_dependent.py,sha256=73WgWETl4IP4qsOrSDkIEIU7MJM3qc_j-LKRZUJlC4c,5757
|
| 718 |
+
networkx/algorithms/tournament.py,sha256=nTgdIzkkFhIyie_5jDh97USz2jQx9TgY34vHOPVXkN0,11676
|
| 719 |
+
networkx/algorithms/traversal/__init__.py,sha256=YtFrfNjciqTOI6jGePQaJ01tRSEQXTHqTGGNhDEDb_8,142
|
| 720 |
+
networkx/algorithms/traversal/__pycache__/__init__.cpython-311.pyc,,
|
| 721 |
+
networkx/algorithms/traversal/__pycache__/beamsearch.cpython-311.pyc,,
|
| 722 |
+
networkx/algorithms/traversal/__pycache__/breadth_first_search.cpython-311.pyc,,
|
| 723 |
+
networkx/algorithms/traversal/__pycache__/depth_first_search.cpython-311.pyc,,
|
| 724 |
+
networkx/algorithms/traversal/__pycache__/edgebfs.cpython-311.pyc,,
|
| 725 |
+
networkx/algorithms/traversal/__pycache__/edgedfs.cpython-311.pyc,,
|
| 726 |
+
networkx/algorithms/traversal/beamsearch.py,sha256=ABR8pOl4G3CbUyaHpR9F93jh3J0XjVKZe7DK5LetVWc,3424
|
| 727 |
+
networkx/algorithms/traversal/breadth_first_search.py,sha256=2sIfMwqc2qjGW2W3UcGwGBSCcc-_FWWa_ZRYQjhfro8,18107
|
| 728 |
+
networkx/algorithms/traversal/depth_first_search.py,sha256=aJ-3wtaLVLslz5dJD7nW3biDdXsjJi_rAJB8QQTg_8w,13730
|
| 729 |
+
networkx/algorithms/traversal/edgebfs.py,sha256=2eUhaoP2__-QSkDu1ie6wPd1WjuK3u8pU8rf87iAtKc,6239
|
| 730 |
+
networkx/algorithms/traversal/edgedfs.py,sha256=NaZfoYV5jl8mmo5UhgdQqM2YJ_PjZ--VKYF5T9qa6Ms,5952
|
| 731 |
+
networkx/algorithms/traversal/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 732 |
+
networkx/algorithms/traversal/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 733 |
+
networkx/algorithms/traversal/tests/__pycache__/test_beamsearch.cpython-311.pyc,,
|
| 734 |
+
networkx/algorithms/traversal/tests/__pycache__/test_bfs.cpython-311.pyc,,
|
| 735 |
+
networkx/algorithms/traversal/tests/__pycache__/test_dfs.cpython-311.pyc,,
|
| 736 |
+
networkx/algorithms/traversal/tests/__pycache__/test_edgebfs.cpython-311.pyc,,
|
| 737 |
+
networkx/algorithms/traversal/tests/__pycache__/test_edgedfs.cpython-311.pyc,,
|
| 738 |
+
networkx/algorithms/traversal/tests/test_beamsearch.py,sha256=b1fXCI0_BuWbnA536PZrXMMUfG1ejnHX1fpQGY-5hqI,1076
|
| 739 |
+
networkx/algorithms/traversal/tests/test_bfs.py,sha256=fC6HUKzd5Jd9LerxgODpfvCRE15BU5PbMzEaMLoXPZs,6796
|
| 740 |
+
networkx/algorithms/traversal/tests/test_dfs.py,sha256=4Gc1ACJQJ63rfOlPz0X0Tv6xW6k83ewMRVojBEnKMmk,8616
|
| 741 |
+
networkx/algorithms/traversal/tests/test_edgebfs.py,sha256=8oplCu0fct3QipT0JB0-292EA2aOm8zWlMkPedfe6iY,4702
|
| 742 |
+
networkx/algorithms/traversal/tests/test_edgedfs.py,sha256=HGmC3GUYSn9XLMHQpdefdE6g-Uh3KqbmgEEXBcckdYc,4775
|
| 743 |
+
networkx/algorithms/tree/__init__.py,sha256=wm_FjX3G7hqJfyNmeEaJsRjZI-8Kkv0Nb5jAmQNXzSc,149
|
| 744 |
+
networkx/algorithms/tree/__pycache__/__init__.cpython-311.pyc,,
|
| 745 |
+
networkx/algorithms/tree/__pycache__/branchings.cpython-311.pyc,,
|
| 746 |
+
networkx/algorithms/tree/__pycache__/coding.cpython-311.pyc,,
|
| 747 |
+
networkx/algorithms/tree/__pycache__/decomposition.cpython-311.pyc,,
|
| 748 |
+
networkx/algorithms/tree/__pycache__/mst.cpython-311.pyc,,
|
| 749 |
+
networkx/algorithms/tree/__pycache__/operations.cpython-311.pyc,,
|
| 750 |
+
networkx/algorithms/tree/__pycache__/recognition.cpython-311.pyc,,
|
| 751 |
+
networkx/algorithms/tree/branchings.py,sha256=ZJmoLcn_rtQ9VKBwsFqdx1Rkh8edqjNGgYWBUezNpvE,56003
|
| 752 |
+
networkx/algorithms/tree/coding.py,sha256=zB5ISLd1Jn-6wWfqrQaxYa2hbwchp59qzGKmCiuLVd8,13407
|
| 753 |
+
networkx/algorithms/tree/decomposition.py,sha256=MFV3zHYOt8y7n3jNBxQCQvO60IFJ9rl5XIgvBqjT5RQ,3047
|
| 754 |
+
networkx/algorithms/tree/mst.py,sha256=STCiAXhYmbt3x0yaqRQehwlp_GMJFoeU9vwdmzjFHNk,40276
|
| 755 |
+
networkx/algorithms/tree/operations.py,sha256=46nnbX2qF_iyzeuzsIJXrlXiJOEQfo2KguFB4rP5Ttg,4702
|
| 756 |
+
networkx/algorithms/tree/recognition.py,sha256=ZOdFP-cdG2Lv7jiX3M2nPi7g-e327wPN36_xbn4KiDs,7553
|
| 757 |
+
networkx/algorithms/tree/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 758 |
+
networkx/algorithms/tree/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 759 |
+
networkx/algorithms/tree/tests/__pycache__/test_branchings.cpython-311.pyc,,
|
| 760 |
+
networkx/algorithms/tree/tests/__pycache__/test_coding.cpython-311.pyc,,
|
| 761 |
+
networkx/algorithms/tree/tests/__pycache__/test_decomposition.cpython-311.pyc,,
|
| 762 |
+
networkx/algorithms/tree/tests/__pycache__/test_mst.cpython-311.pyc,,
|
| 763 |
+
networkx/algorithms/tree/tests/__pycache__/test_operations.cpython-311.pyc,,
|
| 764 |
+
networkx/algorithms/tree/tests/__pycache__/test_recognition.cpython-311.pyc,,
|
| 765 |
+
networkx/algorithms/tree/tests/test_branchings.py,sha256=chEEI0evEkVVJSphcP_kIqhMEdv0nhBONYGP8ffW40s,18008
|
| 766 |
+
networkx/algorithms/tree/tests/test_coding.py,sha256=f3A5dvfkWImC6Jp2qkuw2Sz3whOsabnaOfu6Eh9r65I,3954
|
| 767 |
+
networkx/algorithms/tree/tests/test_decomposition.py,sha256=vnl_xoQzi1LnlZL25vXOZWwvaWmon3-x222OKt4eDqE,1871
|
| 768 |
+
networkx/algorithms/tree/tests/test_mst.py,sha256=NgvEi2kwn18HN8ywvj1V20pZS98JIuo9vJOv31DqW2w,24749
|
| 769 |
+
networkx/algorithms/tree/tests/test_operations.py,sha256=ybU96kROTVJRTyjLG7JSJjYlPxaWmYjUVJqbXV5VGGI,1961
|
| 770 |
+
networkx/algorithms/tree/tests/test_recognition.py,sha256=hbS6q1lbshRClWH7o8Zj7Osd-TZuk_YOomUdTczHs3s,4171
|
| 771 |
+
networkx/algorithms/triads.py,sha256=4EF74EolTV1PJheA-J371tP_pTJA7-aGLnq4D8pac2E,15517
|
| 772 |
+
networkx/algorithms/vitality.py,sha256=yBXiKzewpz40SK0UzFpeZZDvOXXDSt_vh4jGLrNgnHg,2331
|
| 773 |
+
networkx/algorithms/voronoi.py,sha256=zCiFFQiklBS5afAEfln44GfiPsoAI9c7E6m0gbQ2Big,3178
|
| 774 |
+
networkx/algorithms/walks.py,sha256=3ulDmITV-YN8yBTr2qmVEDsSe-Gi8yzrnGyLP5dXQbQ,2419
|
| 775 |
+
networkx/algorithms/wiener.py,sha256=o8tYpFn-W9sneu3QMhpMZlCkqptgRo2ZdUFKfVCOL1s,2328
|
| 776 |
+
networkx/classes/__init__.py,sha256=Q9oONJrnTFs874SGpwcbV_kyJTDcrLI69GFt99MiE6I,364
|
| 777 |
+
networkx/classes/__pycache__/__init__.cpython-311.pyc,,
|
| 778 |
+
networkx/classes/__pycache__/coreviews.cpython-311.pyc,,
|
| 779 |
+
networkx/classes/__pycache__/digraph.cpython-311.pyc,,
|
| 780 |
+
networkx/classes/__pycache__/filters.cpython-311.pyc,,
|
| 781 |
+
networkx/classes/__pycache__/function.cpython-311.pyc,,
|
| 782 |
+
networkx/classes/__pycache__/graph.cpython-311.pyc,,
|
| 783 |
+
networkx/classes/__pycache__/graphviews.cpython-311.pyc,,
|
| 784 |
+
networkx/classes/__pycache__/multidigraph.cpython-311.pyc,,
|
| 785 |
+
networkx/classes/__pycache__/multigraph.cpython-311.pyc,,
|
| 786 |
+
networkx/classes/__pycache__/reportviews.cpython-311.pyc,,
|
| 787 |
+
networkx/classes/coreviews.py,sha256=jkbsDaqebCcFH952hAAAuXw3qZpi7xUdCHyKbUrFsc8,11010
|
| 788 |
+
networkx/classes/digraph.py,sha256=CnnSfxWTjOkabNkSNhBfE2bgwgSG32ylDD3scWxaPP0,47159
|
| 789 |
+
networkx/classes/filters.py,sha256=47OFApfkvvohVMoZ2v9sniM6sgv9rka869BDwmbdww4,1715
|
| 790 |
+
networkx/classes/function.py,sha256=55dS0xS5p7oiyeJQ03mGcSo7NwJLbfZ54_kIhVOx-q0,36323
|
| 791 |
+
networkx/classes/graph.py,sha256=DigVc4mmBx9v1ctgqhDYu8GZwT2wa4iyci85otpYZ6Q,70379
|
| 792 |
+
networkx/classes/graphviews.py,sha256=7rSoE4Pkh8SjjsP2G6t0U0SRAwnkUp5QLSgnJPZgPUQ,8558
|
| 793 |
+
networkx/classes/multidigraph.py,sha256=_5yJvVz99QMkp92iS2qONcahEBhsmS3C7bfaKrNNKoA,36283
|
| 794 |
+
networkx/classes/multigraph.py,sha256=5X1_tB0LJgfif8f1HckiL1MTm9tPDJ4YTRe_H22WFbA,47127
|
| 795 |
+
networkx/classes/reportviews.py,sha256=WQU6LBq2tXIohU6bDJALKeefFaeGMW46Ln8sUJoJ-yM,45606
|
| 796 |
+
networkx/classes/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 797 |
+
networkx/classes/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 798 |
+
networkx/classes/tests/__pycache__/dispatch_interface.cpython-311.pyc,,
|
| 799 |
+
networkx/classes/tests/__pycache__/historical_tests.cpython-311.pyc,,
|
| 800 |
+
networkx/classes/tests/__pycache__/test_backends.cpython-311.pyc,,
|
| 801 |
+
networkx/classes/tests/__pycache__/test_coreviews.cpython-311.pyc,,
|
| 802 |
+
networkx/classes/tests/__pycache__/test_digraph.cpython-311.pyc,,
|
| 803 |
+
networkx/classes/tests/__pycache__/test_digraph_historical.cpython-311.pyc,,
|
| 804 |
+
networkx/classes/tests/__pycache__/test_filters.cpython-311.pyc,,
|
| 805 |
+
networkx/classes/tests/__pycache__/test_function.cpython-311.pyc,,
|
| 806 |
+
networkx/classes/tests/__pycache__/test_graph.cpython-311.pyc,,
|
| 807 |
+
networkx/classes/tests/__pycache__/test_graph_historical.cpython-311.pyc,,
|
| 808 |
+
networkx/classes/tests/__pycache__/test_graphviews.cpython-311.pyc,,
|
| 809 |
+
networkx/classes/tests/__pycache__/test_multidigraph.cpython-311.pyc,,
|
| 810 |
+
networkx/classes/tests/__pycache__/test_multigraph.cpython-311.pyc,,
|
| 811 |
+
networkx/classes/tests/__pycache__/test_reportviews.cpython-311.pyc,,
|
| 812 |
+
networkx/classes/tests/__pycache__/test_special.cpython-311.pyc,,
|
| 813 |
+
networkx/classes/tests/__pycache__/test_subgraphviews.cpython-311.pyc,,
|
| 814 |
+
networkx/classes/tests/dispatch_interface.py,sha256=bOQdru35uGmAMKHNZEok-UBAeiuA0rF20JZEeo4ePT4,6683
|
| 815 |
+
networkx/classes/tests/historical_tests.py,sha256=3lbZKaRvv8uodIEzSbBJDguTPpO2MhqBqh-Pk1soZBM,16173
|
| 816 |
+
networkx/classes/tests/test_backends.py,sha256=IR8qFYv4cJX0y1q48lRV0zJEouj1sfSOmcwcm4FBxEg,2579
|
| 817 |
+
networkx/classes/tests/test_coreviews.py,sha256=qzdozzWK8vLag-CAUqrXAM2CZZwMFN5vMu6Tdrwdf-E,12128
|
| 818 |
+
networkx/classes/tests/test_digraph.py,sha256=uw0FuEu3y_YI-PSGuQCRytFpXLF7Eye2fqLJaKbXkBc,12283
|
| 819 |
+
networkx/classes/tests/test_digraph_historical.py,sha256=s9FpuIP81zIbGCiMfiDqB3OxqWU2p3GwWdhpGIOjD5Y,3683
|
| 820 |
+
networkx/classes/tests/test_filters.py,sha256=fBLig8z548gsBBlQw6VJdGZb4IcqJj7_0mi2Fd2ncEM,5851
|
| 821 |
+
networkx/classes/tests/test_function.py,sha256=e5vg_SjtC8nHrMDemCcEVTHcudcSiWToMsZF655eQi4,25770
|
| 822 |
+
networkx/classes/tests/test_graph.py,sha256=77t7pk1Pmz-txewyD2Dv19Vva6vWpWCtJSPtFx-EY_Y,30913
|
| 823 |
+
networkx/classes/tests/test_graph_historical.py,sha256=-jf961vQCuQLyly0ju50q9dbzWG5m2OAs9H6IVS670c,273
|
| 824 |
+
networkx/classes/tests/test_graphviews.py,sha256=i4x3ii8--PPg_pK4YA8aMR1axUQCdXZYpzmB05iEAOg,11466
|
| 825 |
+
networkx/classes/tests/test_multidigraph.py,sha256=ryTKegCoYixXbAqOn3mIt9vSMb5666Dv-pfMkXEjoUE,16342
|
| 826 |
+
networkx/classes/tests/test_multigraph.py,sha256=0vFQO3RCJaBpzXvnQzdWa_qYLHNo_I9DICYhPZJNUMk,18777
|
| 827 |
+
networkx/classes/tests/test_reportviews.py,sha256=-4Vd42cOvTdZfsPiWuQuAAvVDafosjB47RosYglmXUw,41470
|
| 828 |
+
networkx/classes/tests/test_special.py,sha256=IJsmqCS9LrTDoZ11KPmo-UOI7xEskL7NyduEJNPMNqs,4103
|
| 829 |
+
networkx/classes/tests/test_subgraphviews.py,sha256=1dcJHq3F00LyoFSu6CTFPqS7DFIkWK1PyQu4QvJh5ko,13223
|
| 830 |
+
networkx/conftest.py,sha256=v1f_RONRmJwf__rPjF4l-uFl2cyyF08mtst8WTnHXr4,7944
|
| 831 |
+
networkx/convert.py,sha256=0EbsMbOgm8pdKpW4A6p5Ea4T_KGEcq-P1a0gCnM-jzY,15977
|
| 832 |
+
networkx/convert_matrix.py,sha256=cnI56RdwsBke_XOz6dAbfgj_qVIwU2JeirRqMN9tM2w,41069
|
| 833 |
+
networkx/drawing/__init__.py,sha256=rnTFNzLc4fis1hTAEpnWTC80neAR88-llVQ-LObN-i4,160
|
| 834 |
+
networkx/drawing/__pycache__/__init__.cpython-311.pyc,,
|
| 835 |
+
networkx/drawing/__pycache__/layout.cpython-311.pyc,,
|
| 836 |
+
networkx/drawing/__pycache__/nx_agraph.cpython-311.pyc,,
|
| 837 |
+
networkx/drawing/__pycache__/nx_latex.cpython-311.pyc,,
|
| 838 |
+
networkx/drawing/__pycache__/nx_pydot.cpython-311.pyc,,
|
| 839 |
+
networkx/drawing/__pycache__/nx_pylab.cpython-311.pyc,,
|
| 840 |
+
networkx/drawing/layout.py,sha256=fvfHjubEdZZoRexknTKF2j0zO_Xj2N1nhzfuNTKY5BQ,38829
|
| 841 |
+
networkx/drawing/nx_agraph.py,sha256=9Q6bz0oT7u-iU2hDIjhjvQ3jmxWsyAHA5fMIr4BmhEE,14009
|
| 842 |
+
networkx/drawing/nx_latex.py,sha256=EZWQ1GJ9SWS7ufyAz8ey30gG1EtnCUVMgbLJ4-tIjgY,24805
|
| 843 |
+
networkx/drawing/nx_pydot.py,sha256=vS_lJC9ASmBPyXpecinbNs_OuhjgUNIj82CLks3SjPk,14135
|
| 844 |
+
networkx/drawing/nx_pylab.py,sha256=LOTf6wOfOkB_t-ml5EY-6SEOfMYAxdDzE-4uGJAxBuo,51138
|
| 845 |
+
networkx/drawing/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 846 |
+
networkx/drawing/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 847 |
+
networkx/drawing/tests/__pycache__/test_agraph.cpython-311.pyc,,
|
| 848 |
+
networkx/drawing/tests/__pycache__/test_latex.cpython-311.pyc,,
|
| 849 |
+
networkx/drawing/tests/__pycache__/test_layout.cpython-311.pyc,,
|
| 850 |
+
networkx/drawing/tests/__pycache__/test_pydot.cpython-311.pyc,,
|
| 851 |
+
networkx/drawing/tests/__pycache__/test_pylab.cpython-311.pyc,,
|
| 852 |
+
networkx/drawing/tests/baseline/test_house_with_colors.png,sha256=FQi9pIRFwjq4gvgB8cDdBHL5euQUJFw6sQlABf2kRVo,21918
|
| 853 |
+
networkx/drawing/tests/test_agraph.py,sha256=7qDwr3AruwHxoSUGNRACyL5OTK7_2qDM5bkCANSMql4,9045
|
| 854 |
+
networkx/drawing/tests/test_latex.py,sha256=_Wng73kMltC-_sUoxdo2uBL2bkEc7HMqkKhwo9ZDJGA,8710
|
| 855 |
+
networkx/drawing/tests/test_layout.py,sha256=JUHMitAFs28rgYcEvk3-8-8Ri0Qui9ir3DjY24L6MfU,17841
|
| 856 |
+
networkx/drawing/tests/test_pydot.py,sha256=-eRn39-HTFAZ1oVMR6ULSZxCS2531-HrlNjQaUa3i-8,6242
|
| 857 |
+
networkx/drawing/tests/test_pylab.py,sha256=hlStKEitfl74u2wnEYlajmWHVd0IwHdyFfxDcgooUfc,27576
|
| 858 |
+
networkx/exception.py,sha256=5v8tPTpYcuu3OFgSitgC8-wMUGNwfgxZog2gsBNeRPk,3537
|
| 859 |
+
networkx/generators/__init__.py,sha256=tEbG2IO2NkxVzAFjeApCpATxhjRYopOXes6iffqC6DI,1318
|
| 860 |
+
networkx/generators/__pycache__/__init__.cpython-311.pyc,,
|
| 861 |
+
networkx/generators/__pycache__/atlas.cpython-311.pyc,,
|
| 862 |
+
networkx/generators/__pycache__/classic.cpython-311.pyc,,
|
| 863 |
+
networkx/generators/__pycache__/cographs.cpython-311.pyc,,
|
| 864 |
+
networkx/generators/__pycache__/community.cpython-311.pyc,,
|
| 865 |
+
networkx/generators/__pycache__/degree_seq.cpython-311.pyc,,
|
| 866 |
+
networkx/generators/__pycache__/directed.cpython-311.pyc,,
|
| 867 |
+
networkx/generators/__pycache__/duplication.cpython-311.pyc,,
|
| 868 |
+
networkx/generators/__pycache__/ego.cpython-311.pyc,,
|
| 869 |
+
networkx/generators/__pycache__/expanders.cpython-311.pyc,,
|
| 870 |
+
networkx/generators/__pycache__/geometric.cpython-311.pyc,,
|
| 871 |
+
networkx/generators/__pycache__/harary_graph.cpython-311.pyc,,
|
| 872 |
+
networkx/generators/__pycache__/internet_as_graphs.cpython-311.pyc,,
|
| 873 |
+
networkx/generators/__pycache__/intersection.cpython-311.pyc,,
|
| 874 |
+
networkx/generators/__pycache__/interval_graph.cpython-311.pyc,,
|
| 875 |
+
networkx/generators/__pycache__/joint_degree_seq.cpython-311.pyc,,
|
| 876 |
+
networkx/generators/__pycache__/lattice.cpython-311.pyc,,
|
| 877 |
+
networkx/generators/__pycache__/line.cpython-311.pyc,,
|
| 878 |
+
networkx/generators/__pycache__/mycielski.cpython-311.pyc,,
|
| 879 |
+
networkx/generators/__pycache__/nonisomorphic_trees.cpython-311.pyc,,
|
| 880 |
+
networkx/generators/__pycache__/random_clustered.cpython-311.pyc,,
|
| 881 |
+
networkx/generators/__pycache__/random_graphs.cpython-311.pyc,,
|
| 882 |
+
networkx/generators/__pycache__/small.cpython-311.pyc,,
|
| 883 |
+
networkx/generators/__pycache__/social.cpython-311.pyc,,
|
| 884 |
+
networkx/generators/__pycache__/spectral_graph_forge.cpython-311.pyc,,
|
| 885 |
+
networkx/generators/__pycache__/stochastic.cpython-311.pyc,,
|
| 886 |
+
networkx/generators/__pycache__/sudoku.cpython-311.pyc,,
|
| 887 |
+
networkx/generators/__pycache__/time_series.cpython-311.pyc,,
|
| 888 |
+
networkx/generators/__pycache__/trees.cpython-311.pyc,,
|
| 889 |
+
networkx/generators/__pycache__/triads.cpython-311.pyc,,
|
| 890 |
+
networkx/generators/atlas.dat.gz,sha256=c_xBbfAWSSNgd1HLdZ9K6B3rX2VQvyW-Wcht47dH5B0,8887
|
| 891 |
+
networkx/generators/atlas.py,sha256=NG5jMwud76LrkzBCl9tNGrv0j3weSi4-A_wtPChdglY,5557
|
| 892 |
+
networkx/generators/classic.py,sha256=hmHiIsSsld_DVY8lpULBF8bGRLYDnhCWDD-Y_8u4o-k,28395
|
| 893 |
+
networkx/generators/cographs.py,sha256=oDJVZRiviNZOrHSGXxQNcXFbRvtB3DW0aFFEJ8bfQ_Y,1866
|
| 894 |
+
networkx/generators/community.py,sha256=bgbD7UfKYXf9lSUe9WJeo20pioNJJMyh1ZpenYOex6E,34690
|
| 895 |
+
networkx/generators/degree_seq.py,sha256=0Zpv4q5rYgrUepprOGaQFTw3PVg6EEWobo9i3Ira9ZI,30006
|
| 896 |
+
networkx/generators/directed.py,sha256=qlm-ArjKbqnGWJi2Ax9HuqaUQm_IUFPuwwDYvAUW4o8,15554
|
| 897 |
+
networkx/generators/duplication.py,sha256=1Ys4nb9suq49ooAVXSnkuKQjvW3H_llprd-xdp70wSs,5013
|
| 898 |
+
networkx/generators/ego.py,sha256=V373eWi-qyJXxgsa49NdLyVqFVCpqC-CMY9ATwQYws8,1873
|
| 899 |
+
networkx/generators/expanders.py,sha256=xDfzdnl2XYrVItnCiU_09szMKQB6S9xOaxWx6rFTHCE,6447
|
| 900 |
+
networkx/generators/geometric.py,sha256=8slijaPVv36oTzU5EsKx0bqtLmgICpbV5zl0vh7MfM8,30858
|
| 901 |
+
networkx/generators/harary_graph.py,sha256=-9SU_IDZklbmiz4bwyCOPbQ4DEnXHwKStim2fHbPz6A,6111
|
| 902 |
+
networkx/generators/internet_as_graphs.py,sha256=tMXL8U9YCAerfYYOV0wpEjPL16HIAJpEOzL8GdZAjxw,14148
|
| 903 |
+
networkx/generators/intersection.py,sha256=WW3yE7TbjDtjggrLU8UysmiY_ip6tLy_hggUYWXVRy8,4028
|
| 904 |
+
networkx/generators/interval_graph.py,sha256=LuXcLfLiRToVhmwz6nz1yWKivzqujFOB1MNZ0WRgnmg,2213
|
| 905 |
+
networkx/generators/joint_degree_seq.py,sha256=p49dvZCcda6NAEsz4zvbiogIw4deqT51HpgIb8rU2zY,24717
|
| 906 |
+
networkx/generators/lattice.py,sha256=8yw3GgxEH2erK2xBCW3oMT2hT2R5eCJC9OcBKz-R-vs,13380
|
| 907 |
+
networkx/generators/line.py,sha256=R5Nz58zz_Fq8LbbLPEDRrYbCGLlbaRj2htmRZJbEv3M,17500
|
| 908 |
+
networkx/generators/mycielski.py,sha256=0f_XLLjdpKsV_VS31PESe6LGg4yJI7nyX4DUWtyMU0U,3266
|
| 909 |
+
networkx/generators/nonisomorphic_trees.py,sha256=I6T3QaH-Asw1B5g0_jnQJO9tOydc4qEbSmNIFUvq6ik,5232
|
| 910 |
+
networkx/generators/random_clustered.py,sha256=4msP74PFIQvmWCxIs7F9WqYWvOTqDXXSf1wSuExEXF8,4159
|
| 911 |
+
networkx/generators/random_graphs.py,sha256=SSYM8SZWgRglwMI6vxBWukDnQDJEk_9lCFKWMm_NkjA,44729
|
| 912 |
+
networkx/generators/small.py,sha256=ADc-LfX8aEg_UYkPVfZk9YN4Na2KxpZxHsSvnVhj5D8,27217
|
| 913 |
+
networkx/generators/social.py,sha256=caDTR23cNv1nlA5j3OZvs3d4HuwExxNbjfO9Ijqv7qY,22867
|
| 914 |
+
networkx/generators/spectral_graph_forge.py,sha256=PPU6w9Z0_6iKQODsXSCE4ftVMYNrECBeH1Q_Y5Ea95U,4217
|
| 915 |
+
networkx/generators/stochastic.py,sha256=K_4B3xmc6EDTQkc53eaOK1wHzF6qijAogWmEMDIjwjc,1897
|
| 916 |
+
networkx/generators/sudoku.py,sha256=l-j2mo0KLarWRvMmjncZZfxJzoYn9ZGuz_3rlGZ5CRM,4264
|
| 917 |
+
networkx/generators/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 918 |
+
networkx/generators/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 919 |
+
networkx/generators/tests/__pycache__/test_atlas.cpython-311.pyc,,
|
| 920 |
+
networkx/generators/tests/__pycache__/test_classic.cpython-311.pyc,,
|
| 921 |
+
networkx/generators/tests/__pycache__/test_cographs.cpython-311.pyc,,
|
| 922 |
+
networkx/generators/tests/__pycache__/test_community.cpython-311.pyc,,
|
| 923 |
+
networkx/generators/tests/__pycache__/test_degree_seq.cpython-311.pyc,,
|
| 924 |
+
networkx/generators/tests/__pycache__/test_directed.cpython-311.pyc,,
|
| 925 |
+
networkx/generators/tests/__pycache__/test_duplication.cpython-311.pyc,,
|
| 926 |
+
networkx/generators/tests/__pycache__/test_ego.cpython-311.pyc,,
|
| 927 |
+
networkx/generators/tests/__pycache__/test_expanders.cpython-311.pyc,,
|
| 928 |
+
networkx/generators/tests/__pycache__/test_geometric.cpython-311.pyc,,
|
| 929 |
+
networkx/generators/tests/__pycache__/test_harary_graph.cpython-311.pyc,,
|
| 930 |
+
networkx/generators/tests/__pycache__/test_internet_as_graphs.cpython-311.pyc,,
|
| 931 |
+
networkx/generators/tests/__pycache__/test_intersection.cpython-311.pyc,,
|
| 932 |
+
networkx/generators/tests/__pycache__/test_interval_graph.cpython-311.pyc,,
|
| 933 |
+
networkx/generators/tests/__pycache__/test_joint_degree_seq.cpython-311.pyc,,
|
| 934 |
+
networkx/generators/tests/__pycache__/test_lattice.cpython-311.pyc,,
|
| 935 |
+
networkx/generators/tests/__pycache__/test_line.cpython-311.pyc,,
|
| 936 |
+
networkx/generators/tests/__pycache__/test_mycielski.cpython-311.pyc,,
|
| 937 |
+
networkx/generators/tests/__pycache__/test_nonisomorphic_trees.cpython-311.pyc,,
|
| 938 |
+
networkx/generators/tests/__pycache__/test_random_clustered.cpython-311.pyc,,
|
| 939 |
+
networkx/generators/tests/__pycache__/test_random_graphs.cpython-311.pyc,,
|
| 940 |
+
networkx/generators/tests/__pycache__/test_small.cpython-311.pyc,,
|
| 941 |
+
networkx/generators/tests/__pycache__/test_spectral_graph_forge.cpython-311.pyc,,
|
| 942 |
+
networkx/generators/tests/__pycache__/test_stochastic.cpython-311.pyc,,
|
| 943 |
+
networkx/generators/tests/__pycache__/test_sudoku.cpython-311.pyc,,
|
| 944 |
+
networkx/generators/tests/__pycache__/test_time_series.cpython-311.pyc,,
|
| 945 |
+
networkx/generators/tests/__pycache__/test_trees.cpython-311.pyc,,
|
| 946 |
+
networkx/generators/tests/__pycache__/test_triads.cpython-311.pyc,,
|
| 947 |
+
networkx/generators/tests/test_atlas.py,sha256=nwXJL4O5jUqhTwqhkPxHY8s3KXHQTDEdsfbg4MsSzVQ,2530
|
| 948 |
+
networkx/generators/tests/test_classic.py,sha256=RAELDkMqAVYaIo1nhBbjDbmAfzSrn6RBqSSd--mWqvs,22495
|
| 949 |
+
networkx/generators/tests/test_cographs.py,sha256=DkiQzP69sjw3QtjWVX2XV0EXoOuEvR42dixPWwuawSE,460
|
| 950 |
+
networkx/generators/tests/test_community.py,sha256=FGcDo3Ajb-yYc5kUkFbVfOJVMG-YppbAtjgBPcVzjLc,11311
|
| 951 |
+
networkx/generators/tests/test_degree_seq.py,sha256=in6lg1pwcAg1N08MA3lQdr3lnm2-aoUy3BRm6Yj_OBQ,7093
|
| 952 |
+
networkx/generators/tests/test_directed.py,sha256=00widU8dJGkdnU_b6-ZxL8KGtx-gSh4sRG7cwbMHvjQ,5258
|
| 953 |
+
networkx/generators/tests/test_duplication.py,sha256=IIzcHEfHp0NHsH7GTXSb4E4kgXAlt83q4IMibfx2FBw,1915
|
| 954 |
+
networkx/generators/tests/test_ego.py,sha256=8v1Qjmkli9wIhhUuqzgqCzysr0C1Z2C3oJMCUoNvgY4,1327
|
| 955 |
+
networkx/generators/tests/test_expanders.py,sha256=O6O68S5VFWycg-Ml-gvZXjX_vjwO0MBfaBcNYIBP9Io,2896
|
| 956 |
+
networkx/generators/tests/test_geometric.py,sha256=1wzo-eTOP937aOEk8lQGrsW7u2BDfRhyYQ1HpHQqslQ,12512
|
| 957 |
+
networkx/generators/tests/test_harary_graph.py,sha256=U5GfsoekBwVwTGMvk33e2eFOzHEL4czRIWv57j3nt_g,4937
|
| 958 |
+
networkx/generators/tests/test_internet_as_graphs.py,sha256=QmzkOnWg9bcSrv31UcaD6Cko55AV-GPLLY5Aqb_Dmvs,6795
|
| 959 |
+
networkx/generators/tests/test_intersection.py,sha256=hcIit5fKfOn3VjMhz9KqovZK9tzxZfmC6ezvA7gZAvM,819
|
| 960 |
+
networkx/generators/tests/test_interval_graph.py,sha256=-1yXDZDW-ygmNva9Bu-TsS_SYGLcW1KJplwZHFFYyWM,4278
|
| 961 |
+
networkx/generators/tests/test_joint_degree_seq.py,sha256=8TXTZI3Um2gBXtP-4yhGKf9vCi78-NVmWZw9r9WG3F8,4270
|
| 962 |
+
networkx/generators/tests/test_lattice.py,sha256=q4Ri-dH9mKhfq0PNX9xMeYRUiP0JlPBr7piSruZlFlg,9290
|
| 963 |
+
networkx/generators/tests/test_line.py,sha256=vXncJuny2j5ulCJyT01Rt1tTwPib4XelS3dJDdJXjx0,10378
|
| 964 |
+
networkx/generators/tests/test_mycielski.py,sha256=cAg2J6o_RrbwEdAc0vCuSF6zeS6w1KT4leTM0vkIeoA,822
|
| 965 |
+
networkx/generators/tests/test_nonisomorphic_trees.py,sha256=Y_qWyj_qZU9O_DC4BHEVD9xnIEALCmfdmZAYJjTxUYE,2384
|
| 966 |
+
networkx/generators/tests/test_random_clustered.py,sha256=LTfigb1swnYWS59OJoBmNcjFcUjsodnHVOwFxBXl7xg,979
|
| 967 |
+
networkx/generators/tests/test_random_graphs.py,sha256=DKEPbvKiFzZQsuofuj_MphGX2KJ8Bvz6ofIttDGMANk,13121
|
| 968 |
+
networkx/generators/tests/test_small.py,sha256=u_CTdGXfwnqvIYWjYv8VX_r_KB5Y1aCxXxQkxhx-WHs,6906
|
| 969 |
+
networkx/generators/tests/test_spectral_graph_forge.py,sha256=x4jyTiQiydaUPWYaGsNFsIB47PAzSSwQYCNXGa2B4SU,1594
|
| 970 |
+
networkx/generators/tests/test_stochastic.py,sha256=xdytPcz4ETnuqGtjMr0CI3zR4xWJqi91Zxbkly8Ijf8,2178
|
| 971 |
+
networkx/generators/tests/test_sudoku.py,sha256=dgOmk-B7MxCVkbHdZzsLZppQ61FAArVy4McSVL8Afzo,1968
|
| 972 |
+
networkx/generators/tests/test_time_series.py,sha256=74kHpcBfbed7zmd1Ofh2XoLIhIaEEFpEf51j1e2muMo,2229
|
| 973 |
+
networkx/generators/tests/test_trees.py,sha256=hv8oNYZOcYcaARXvaMQZptCVBvk-huk-nKI5mH9sB-8,7634
|
| 974 |
+
networkx/generators/tests/test_triads.py,sha256=mgpHFf0Z34CqtnXgkdf7gK1dC77ppYAqwviXsaU1HVs,332
|
| 975 |
+
networkx/generators/time_series.py,sha256=Jz33n3mprkLrVbwLRLznQg_lDQvmIL2jWNoY4LCla80,2414
|
| 976 |
+
networkx/generators/trees.py,sha256=xR9H01HkI1WR24KdSEv8inTz6rgbzjwt1vL0GfOImts,39067
|
| 977 |
+
networkx/generators/triads.py,sha256=bXfoxFUH9CJaO7PMxjwiB9SvhPp4ZL3HxlUsL-67Yv4,2233
|
| 978 |
+
networkx/lazy_imports.py,sha256=MDfQ4C99G30uYBmLJBGtGEcrOzHMUcxvOyZpN674DYw,5784
|
| 979 |
+
networkx/linalg/__init__.py,sha256=7iyNZ_YYBnlsW8zSfhUgvEkywOrUWfpIuyS86ZOKlG8,568
|
| 980 |
+
networkx/linalg/__pycache__/__init__.cpython-311.pyc,,
|
| 981 |
+
networkx/linalg/__pycache__/algebraicconnectivity.cpython-311.pyc,,
|
| 982 |
+
networkx/linalg/__pycache__/attrmatrix.cpython-311.pyc,,
|
| 983 |
+
networkx/linalg/__pycache__/bethehessianmatrix.cpython-311.pyc,,
|
| 984 |
+
networkx/linalg/__pycache__/graphmatrix.cpython-311.pyc,,
|
| 985 |
+
networkx/linalg/__pycache__/laplacianmatrix.cpython-311.pyc,,
|
| 986 |
+
networkx/linalg/__pycache__/modularitymatrix.cpython-311.pyc,,
|
| 987 |
+
networkx/linalg/__pycache__/spectrum.cpython-311.pyc,,
|
| 988 |
+
networkx/linalg/algebraicconnectivity.py,sha256=CScaTuN7V1BfEBPA8LSSe1FLV7uE-Am8Iaf9Q9Crgtw,21106
|
| 989 |
+
networkx/linalg/attrmatrix.py,sha256=93xWJq-tIvayQTEUp7UaHLmAQQpSPYMHKF4KqPEfSUE,15504
|
| 990 |
+
networkx/linalg/bethehessianmatrix.py,sha256=sNCKJoRe9jidTrqdX5I8mwl1t08GKzaL14R4ujk42Vk,2692
|
| 991 |
+
networkx/linalg/graphmatrix.py,sha256=TRbhk2cHeJtKW15Gl-lGD7Ih1M3eHkSOC7yoerb7WBU,5513
|
| 992 |
+
networkx/linalg/laplacianmatrix.py,sha256=WQJnmPEVsDTL8kUfQmqg-GJEPeHx3HO4PQLTO-XUp44,13330
|
| 993 |
+
networkx/linalg/modularitymatrix.py,sha256=gtFN_MajMpZlvfsUqzBygLS6l5hZKi2_g1YqzPPedJw,4698
|
| 994 |
+
networkx/linalg/spectrum.py,sha256=oxo9HSRM6jP2g8hKT1lk54Yinhr38AcanSK6RwHnDG0,4194
|
| 995 |
+
networkx/linalg/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 996 |
+
networkx/linalg/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 997 |
+
networkx/linalg/tests/__pycache__/test_algebraic_connectivity.cpython-311.pyc,,
|
| 998 |
+
networkx/linalg/tests/__pycache__/test_attrmatrix.cpython-311.pyc,,
|
| 999 |
+
networkx/linalg/tests/__pycache__/test_bethehessian.cpython-311.pyc,,
|
| 1000 |
+
networkx/linalg/tests/__pycache__/test_graphmatrix.cpython-311.pyc,,
|
| 1001 |
+
networkx/linalg/tests/__pycache__/test_laplacian.cpython-311.pyc,,
|
| 1002 |
+
networkx/linalg/tests/__pycache__/test_modularity.cpython-311.pyc,,
|
| 1003 |
+
networkx/linalg/tests/__pycache__/test_spectrum.cpython-311.pyc,,
|
| 1004 |
+
networkx/linalg/tests/test_algebraic_connectivity.py,sha256=Kj2ct6gQ71xXFP7usAbFLJxD7ZdtTzneHiFJQOoVCUQ,13737
|
| 1005 |
+
networkx/linalg/tests/test_attrmatrix.py,sha256=XD3YuPc5yXKWbhwVSI8YiV_wABWM-rLtwf1uwwWlnI0,2833
|
| 1006 |
+
networkx/linalg/tests/test_bethehessian.py,sha256=0r-Do902ywV10TyqTlIJ2Ls3iMqM6sSs2PZbod7kWBM,1327
|
| 1007 |
+
networkx/linalg/tests/test_graphmatrix.py,sha256=e5YSH9ih1VL64nnYgZFDvLyKbP3BFqpp0jY6t-8b2eY,8708
|
| 1008 |
+
networkx/linalg/tests/test_laplacian.py,sha256=K8p2upJTJLfNHfAf0B9ohPXBZ4k_2VMpSvIc-jXZ_rM,9934
|
| 1009 |
+
networkx/linalg/tests/test_modularity.py,sha256=mfKUvwc3bj6Rud1aG4oK3Eu1qg12o6cB8-pv5ZFicYY,3115
|
| 1010 |
+
networkx/linalg/tests/test_spectrum.py,sha256=agP2DsiEIvtkNUkT94mdPtJjwnobnjMTUOwjIQa4giA,2828
|
| 1011 |
+
networkx/readwrite/__init__.py,sha256=iHycAh1rjr4bCPQMNiHiqm8cP3iu-g1v_uKiGZtkuXY,562
|
| 1012 |
+
networkx/readwrite/__pycache__/__init__.cpython-311.pyc,,
|
| 1013 |
+
networkx/readwrite/__pycache__/adjlist.cpython-311.pyc,,
|
| 1014 |
+
networkx/readwrite/__pycache__/edgelist.cpython-311.pyc,,
|
| 1015 |
+
networkx/readwrite/__pycache__/gexf.cpython-311.pyc,,
|
| 1016 |
+
networkx/readwrite/__pycache__/gml.cpython-311.pyc,,
|
| 1017 |
+
networkx/readwrite/__pycache__/graph6.cpython-311.pyc,,
|
| 1018 |
+
networkx/readwrite/__pycache__/graphml.cpython-311.pyc,,
|
| 1019 |
+
networkx/readwrite/__pycache__/leda.cpython-311.pyc,,
|
| 1020 |
+
networkx/readwrite/__pycache__/multiline_adjlist.cpython-311.pyc,,
|
| 1021 |
+
networkx/readwrite/__pycache__/p2g.cpython-311.pyc,,
|
| 1022 |
+
networkx/readwrite/__pycache__/pajek.cpython-311.pyc,,
|
| 1023 |
+
networkx/readwrite/__pycache__/sparse6.cpython-311.pyc,,
|
| 1024 |
+
networkx/readwrite/__pycache__/text.cpython-311.pyc,,
|
| 1025 |
+
networkx/readwrite/adjlist.py,sha256=P8W_dQu-1NQCC8FX-Zpyta_b0L-NuruRE4X-GKSWNSQ,8386
|
| 1026 |
+
networkx/readwrite/edgelist.py,sha256=qkS9reBZWrSviBp2ZkUMt5gEo4FbFcBfQXhO14OSI-E,14160
|
| 1027 |
+
networkx/readwrite/gexf.py,sha256=UZPVSIlQNH_t0KNTEjclEcJ96FdeLWLVQ84f7u1NoDM,39668
|
| 1028 |
+
networkx/readwrite/gml.py,sha256=NK9jDDQhShmf70wrH2P2hNV59KdFUbC866vhvRc_qV8,31104
|
| 1029 |
+
networkx/readwrite/graph6.py,sha256=P2jrsgiX75XGMCK4wyIGpXo8snOJ--ZZ6r6N5m1jusE,11355
|
| 1030 |
+
networkx/readwrite/graphml.py,sha256=YIxHdP3zXFixYb_rVL051-yyfN9rJwFs_D1tB39NH8w,39183
|
| 1031 |
+
networkx/readwrite/json_graph/__init__.py,sha256=31_5zVLXYEZkjOB-TKXZ5bi83JybPWgpCaRKOXIGoOA,676
|
| 1032 |
+
networkx/readwrite/json_graph/__pycache__/__init__.cpython-311.pyc,,
|
| 1033 |
+
networkx/readwrite/json_graph/__pycache__/adjacency.cpython-311.pyc,,
|
| 1034 |
+
networkx/readwrite/json_graph/__pycache__/cytoscape.cpython-311.pyc,,
|
| 1035 |
+
networkx/readwrite/json_graph/__pycache__/node_link.cpython-311.pyc,,
|
| 1036 |
+
networkx/readwrite/json_graph/__pycache__/tree.cpython-311.pyc,,
|
| 1037 |
+
networkx/readwrite/json_graph/adjacency.py,sha256=QAUoN4LI5ehEjBv__T_hpmHA2n0eHuE3f3OwQv4kiqA,4692
|
| 1038 |
+
networkx/readwrite/json_graph/cytoscape.py,sha256=1UqpoAB-96c4sFGKqTjCziInavrHcFJRHFQo4_iits4,5234
|
| 1039 |
+
networkx/readwrite/json_graph/node_link.py,sha256=8ujpdgQapwClUautmCOF3Up3JoFiLgZRHu6PUxF1B7Q,7450
|
| 1040 |
+
networkx/readwrite/json_graph/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 1041 |
+
networkx/readwrite/json_graph/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 1042 |
+
networkx/readwrite/json_graph/tests/__pycache__/test_adjacency.cpython-311.pyc,,
|
| 1043 |
+
networkx/readwrite/json_graph/tests/__pycache__/test_cytoscape.cpython-311.pyc,,
|
| 1044 |
+
networkx/readwrite/json_graph/tests/__pycache__/test_node_link.cpython-311.pyc,,
|
| 1045 |
+
networkx/readwrite/json_graph/tests/__pycache__/test_tree.cpython-311.pyc,,
|
| 1046 |
+
networkx/readwrite/json_graph/tests/test_adjacency.py,sha256=jueQE3Z_W5BZuCjr0hEsOWSfoQ2fP51p0o0m7IcXUuE,2456
|
| 1047 |
+
networkx/readwrite/json_graph/tests/test_cytoscape.py,sha256=vFoDzcSRI9THlmp4Fu2HHhIF9AUmECWs5mftVWjaWWs,2044
|
| 1048 |
+
networkx/readwrite/json_graph/tests/test_node_link.py,sha256=bDe2Vv1M4h0IDbKjS482p8ZE7SZtBfHDgZ1OEPibwoo,4536
|
| 1049 |
+
networkx/readwrite/json_graph/tests/test_tree.py,sha256=zBXv3_db2XGxFs3XQ35btNf_ku52aLXXiHZmmX4ixAs,1352
|
| 1050 |
+
networkx/readwrite/json_graph/tree.py,sha256=ETjeYnUMyqZ0PbvSR97ar9rJnH8ncLI_Qd16qGFb-jw,3827
|
| 1051 |
+
networkx/readwrite/leda.py,sha256=No8DKw26vB2fzaDQNmfOEOuiUS9XGdvBXSKrctJhipg,2749
|
| 1052 |
+
networkx/readwrite/multiline_adjlist.py,sha256=Zo7K6gE-FpOBao4KiVaA-yRk4mbQzCJzIl4uUgrWYfM,11255
|
| 1053 |
+
networkx/readwrite/p2g.py,sha256=j8vNdr8KKD3o0d1zvfYUJnhe8J9vWxAHLzw3mW85apE,3043
|
| 1054 |
+
networkx/readwrite/pajek.py,sha256=aFKB04KvFuCqBawdjvR7U4N8BzPDDatqkf97s8zY_eI,8690
|
| 1055 |
+
networkx/readwrite/sparse6.py,sha256=sPL2NBYvB9blDaSJEEdYocHxaU7SmV1OVhYf8a_-LsI,10269
|
| 1056 |
+
networkx/readwrite/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 1057 |
+
networkx/readwrite/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 1058 |
+
networkx/readwrite/tests/__pycache__/test_adjlist.cpython-311.pyc,,
|
| 1059 |
+
networkx/readwrite/tests/__pycache__/test_edgelist.cpython-311.pyc,,
|
| 1060 |
+
networkx/readwrite/tests/__pycache__/test_gexf.cpython-311.pyc,,
|
| 1061 |
+
networkx/readwrite/tests/__pycache__/test_gml.cpython-311.pyc,,
|
| 1062 |
+
networkx/readwrite/tests/__pycache__/test_graph6.cpython-311.pyc,,
|
| 1063 |
+
networkx/readwrite/tests/__pycache__/test_graphml.cpython-311.pyc,,
|
| 1064 |
+
networkx/readwrite/tests/__pycache__/test_leda.cpython-311.pyc,,
|
| 1065 |
+
networkx/readwrite/tests/__pycache__/test_p2g.cpython-311.pyc,,
|
| 1066 |
+
networkx/readwrite/tests/__pycache__/test_pajek.cpython-311.pyc,,
|
| 1067 |
+
networkx/readwrite/tests/__pycache__/test_sparse6.cpython-311.pyc,,
|
| 1068 |
+
networkx/readwrite/tests/__pycache__/test_text.cpython-311.pyc,,
|
| 1069 |
+
networkx/readwrite/tests/test_adjlist.py,sha256=dLEv3txnBrHYxajOYAQhA8CA7axiuPw1ECbaHL5p338,9922
|
| 1070 |
+
networkx/readwrite/tests/test_edgelist.py,sha256=atBg6Qjhk8boXs3gUZk4gmg-6GOT5rCosEf30sqOZO4,9969
|
| 1071 |
+
networkx/readwrite/tests/test_gexf.py,sha256=Tbqueeh0XRQ8vtmGwXcyy9K3tWPlnLu6Gop0Hy4cZcc,19405
|
| 1072 |
+
networkx/readwrite/tests/test_gml.py,sha256=GF8rfOj2M3tMtdQ65DMsXypXSFMeWzKEI1qYV-jd5xA,21334
|
| 1073 |
+
networkx/readwrite/tests/test_graph6.py,sha256=IjBpfTr-czBLHb8UT_JzvOTBROpnOf5TKKkfCnEeQT8,6069
|
| 1074 |
+
networkx/readwrite/tests/test_graphml.py,sha256=u4u-udRXPCXFUZ9oB0_X4UUx3MVULQjx9tkXUdwebhI,67149
|
| 1075 |
+
networkx/readwrite/tests/test_leda.py,sha256=_5F4nLLQ1oAZQMZtTQoFncZL0Oc-IsztFBglEdQeH3k,1392
|
| 1076 |
+
networkx/readwrite/tests/test_p2g.py,sha256=drsdod5amV9TGCk-qE2RwsvAop78IKEI1WguVFfd9rs,1320
|
| 1077 |
+
networkx/readwrite/tests/test_pajek.py,sha256=XTsnaCaYjroysCHlTsYwMGGrDR0B1MRwWkA-WXbAXTg,4703
|
| 1078 |
+
networkx/readwrite/tests/test_sparse6.py,sha256=fLpTG0YgcptNOpUipcCcVlni5i8IyC21kkk3ZeD0XhM,5470
|
| 1079 |
+
networkx/readwrite/tests/test_text.py,sha256=w17FdFQ4vK3J8d2UKPZUEtIo5udp6UyilPXyIr8JfpE,56562
|
| 1080 |
+
networkx/readwrite/text.py,sha256=4rWNkDgtUSmqGUAIXPkOKU7u9PFQOlp5eBqn6yt9QKk,32132
|
| 1081 |
+
networkx/relabel.py,sha256=m8R1KovP9IBtzTE2_6NYgMRxB5AFDwZmUCOFYkDoNXI,10279
|
| 1082 |
+
networkx/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 1083 |
+
networkx/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 1084 |
+
networkx/tests/__pycache__/test_all_random_functions.cpython-311.pyc,,
|
| 1085 |
+
networkx/tests/__pycache__/test_convert.cpython-311.pyc,,
|
| 1086 |
+
networkx/tests/__pycache__/test_convert_numpy.cpython-311.pyc,,
|
| 1087 |
+
networkx/tests/__pycache__/test_convert_pandas.cpython-311.pyc,,
|
| 1088 |
+
networkx/tests/__pycache__/test_convert_scipy.cpython-311.pyc,,
|
| 1089 |
+
networkx/tests/__pycache__/test_exceptions.cpython-311.pyc,,
|
| 1090 |
+
networkx/tests/__pycache__/test_import.cpython-311.pyc,,
|
| 1091 |
+
networkx/tests/__pycache__/test_lazy_imports.cpython-311.pyc,,
|
| 1092 |
+
networkx/tests/__pycache__/test_relabel.cpython-311.pyc,,
|
| 1093 |
+
networkx/tests/test_all_random_functions.py,sha256=tbFGmaqLrF8lEp0Hn8sOuPzD5rzIpOVOeeBoBk3_W6g,8653
|
| 1094 |
+
networkx/tests/test_convert.py,sha256=SoIVrqJFF9Gu9Jff_apfbpqg8QhkfC6QW4qzoSM-ukM,12731
|
| 1095 |
+
networkx/tests/test_convert_numpy.py,sha256=R4y5ud0hVZFSGrFjUHD6Anu_aaasy2O_Eke4FaOhPqU,14951
|
| 1096 |
+
networkx/tests/test_convert_pandas.py,sha256=cZJEdV0jP8afRZMqJ8-aL9Ma5NdXSWMuj1hVbjGMR2g,12257
|
| 1097 |
+
networkx/tests/test_convert_scipy.py,sha256=C2cY_8dgBksO0uttkhyCnjACXtC6KHjxqHUk47P5wH8,10436
|
| 1098 |
+
networkx/tests/test_exceptions.py,sha256=XYkpPzqMepSw3MPRUJN5LcFsUsy3YT_fiRDhm0OeAeQ,927
|
| 1099 |
+
networkx/tests/test_import.py,sha256=Gm4ujfH9JkQtDrSjOlwXXXUuubI057wskKLCkF6Z92k,220
|
| 1100 |
+
networkx/tests/test_lazy_imports.py,sha256=nKykNQPt_ZV8JxCH_EkwwcPNayAgZGQVf89e8I7uIlI,2680
|
| 1101 |
+
networkx/tests/test_relabel.py,sha256=dffbjiW_VUAQe7iD8knFS_KepUITt0F6xuwf7daWwKw,14517
|
| 1102 |
+
networkx/utils/__init__.py,sha256=T8IdHaWU2MOGbU-1a7JZcAn5YFtO9iDQVt6ky-BRkJg,227
|
| 1103 |
+
networkx/utils/__pycache__/__init__.cpython-311.pyc,,
|
| 1104 |
+
networkx/utils/__pycache__/backends.cpython-311.pyc,,
|
| 1105 |
+
networkx/utils/__pycache__/decorators.cpython-311.pyc,,
|
| 1106 |
+
networkx/utils/__pycache__/heaps.cpython-311.pyc,,
|
| 1107 |
+
networkx/utils/__pycache__/mapped_queue.cpython-311.pyc,,
|
| 1108 |
+
networkx/utils/__pycache__/misc.cpython-311.pyc,,
|
| 1109 |
+
networkx/utils/__pycache__/random_sequence.cpython-311.pyc,,
|
| 1110 |
+
networkx/utils/__pycache__/rcm.cpython-311.pyc,,
|
| 1111 |
+
networkx/utils/__pycache__/union_find.cpython-311.pyc,,
|
| 1112 |
+
networkx/utils/backends.py,sha256=5z_pQQrT3kGUCtihbDDqy3TvR9t82KxyMGAaAdsgKLs,40939
|
| 1113 |
+
networkx/utils/decorators.py,sha256=Z3U3-pXWD1OKa3cciHG_LSwwylVrpSXdP2rPALq_gZc,46464
|
| 1114 |
+
networkx/utils/heaps.py,sha256=HUZuETHfELEqiXdMBPmD9fA2KiACVhp6iEahcrjFxYM,10391
|
| 1115 |
+
networkx/utils/mapped_queue.py,sha256=ywJN0Z32EAQ1dezF8ORXP_ca0n16sxQlcIrkQQn5i7I,10185
|
| 1116 |
+
networkx/utils/misc.py,sha256=pyN1TGuUFHFfPLubIL-wP-zl_Ybm_U_UWxVw37_tI3g,14351
|
| 1117 |
+
networkx/utils/random_sequence.py,sha256=KzKh0BRMri0MBZlzxHNMl3qRTy2DnBexW3eDzmxKab4,4237
|
| 1118 |
+
networkx/utils/rcm.py,sha256=MeOhFkv91ALieKJtGHqkhxgO7KJBz53mB8tRcYCX3xk,4623
|
| 1119 |
+
networkx/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 1120 |
+
networkx/utils/tests/__pycache__/__init__.cpython-311.pyc,,
|
| 1121 |
+
networkx/utils/tests/__pycache__/test__init.cpython-311.pyc,,
|
| 1122 |
+
networkx/utils/tests/__pycache__/test_decorators.cpython-311.pyc,,
|
| 1123 |
+
networkx/utils/tests/__pycache__/test_heaps.cpython-311.pyc,,
|
| 1124 |
+
networkx/utils/tests/__pycache__/test_mapped_queue.cpython-311.pyc,,
|
| 1125 |
+
networkx/utils/tests/__pycache__/test_misc.cpython-311.pyc,,
|
| 1126 |
+
networkx/utils/tests/__pycache__/test_random_sequence.cpython-311.pyc,,
|
| 1127 |
+
networkx/utils/tests/__pycache__/test_rcm.cpython-311.pyc,,
|
| 1128 |
+
networkx/utils/tests/__pycache__/test_unionfind.cpython-311.pyc,,
|
| 1129 |
+
networkx/utils/tests/test__init.py,sha256=QE0i-lNE4pG2eYjB2mZ0uw7jPD-7TdL7Y9p73JoWQmo,363
|
| 1130 |
+
networkx/utils/tests/test_decorators.py,sha256=AfxQ_C4BcKG8q9wepyglzIebzD_pPpGRPR4dovl6JR4,13334
|
| 1131 |
+
networkx/utils/tests/test_heaps.py,sha256=qCuWMzpcMH1Gwu014CAams78o151QD5YL0mB1fz16Yw,3711
|
| 1132 |
+
networkx/utils/tests/test_mapped_queue.py,sha256=l1Nguzz68Fv91FnAT7y7B0GXSoje9uoWiObHo7TliGM,7354
|
| 1133 |
+
networkx/utils/tests/test_misc.py,sha256=3oa6D5fnxm9VFODhEwM540hU4IBzEucOoD6DiGvP5gc,8218
|
| 1134 |
+
networkx/utils/tests/test_random_sequence.py,sha256=Ou-IeCFybibZuycoin5gUQzzC-iy5yanZFmrqvdGt6Q,925
|
| 1135 |
+
networkx/utils/tests/test_rcm.py,sha256=UvUAkgmQMGk_Nn94TJyQsle4A5SLQFqMQWld1tiQ2lk,1421
|
| 1136 |
+
networkx/utils/tests/test_unionfind.py,sha256=j-DF5XyeJzq1hoeAgN5Nye2Au7EPD040t8oS4Aw2IwU,1579
|
| 1137 |
+
networkx/utils/union_find.py,sha256=NxKlBlyS71A1Wlnt28L-wyZoI9ExZvJth_0e2XSVris,3338
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[networkx.backends]
|
| 2 |
+
nx-loopback = networkx.classes.tests.dispatch_interface:dispatcher
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx-3.2.1.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
networkx
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/__init__.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
r""" This module provides functions and operations for bipartite
|
| 2 |
+
graphs. Bipartite graphs `B = (U, V, E)` have two node sets `U,V` and edges in
|
| 3 |
+
`E` that only connect nodes from opposite sets. It is common in the literature
|
| 4 |
+
to use an spatial analogy referring to the two node sets as top and bottom nodes.
|
| 5 |
+
|
| 6 |
+
The bipartite algorithms are not imported into the networkx namespace
|
| 7 |
+
at the top level so the easiest way to use them is with:
|
| 8 |
+
|
| 9 |
+
>>> from networkx.algorithms import bipartite
|
| 10 |
+
|
| 11 |
+
NetworkX does not have a custom bipartite graph class but the Graph()
|
| 12 |
+
or DiGraph() classes can be used to represent bipartite graphs. However,
|
| 13 |
+
you have to keep track of which set each node belongs to, and make
|
| 14 |
+
sure that there is no edge between nodes of the same set. The convention used
|
| 15 |
+
in NetworkX is to use a node attribute named `bipartite` with values 0 or 1 to
|
| 16 |
+
identify the sets each node belongs to. This convention is not enforced in
|
| 17 |
+
the source code of bipartite functions, it's only a recommendation.
|
| 18 |
+
|
| 19 |
+
For example:
|
| 20 |
+
|
| 21 |
+
>>> B = nx.Graph()
|
| 22 |
+
>>> # Add nodes with the node attribute "bipartite"
|
| 23 |
+
>>> B.add_nodes_from([1, 2, 3, 4], bipartite=0)
|
| 24 |
+
>>> B.add_nodes_from(["a", "b", "c"], bipartite=1)
|
| 25 |
+
>>> # Add edges only between nodes of opposite node sets
|
| 26 |
+
>>> B.add_edges_from([(1, "a"), (1, "b"), (2, "b"), (2, "c"), (3, "c"), (4, "a")])
|
| 27 |
+
|
| 28 |
+
Many algorithms of the bipartite module of NetworkX require, as an argument, a
|
| 29 |
+
container with all the nodes that belong to one set, in addition to the bipartite
|
| 30 |
+
graph `B`. The functions in the bipartite package do not check that the node set
|
| 31 |
+
is actually correct nor that the input graph is actually bipartite.
|
| 32 |
+
If `B` is connected, you can find the two node sets using a two-coloring
|
| 33 |
+
algorithm:
|
| 34 |
+
|
| 35 |
+
>>> nx.is_connected(B)
|
| 36 |
+
True
|
| 37 |
+
>>> bottom_nodes, top_nodes = bipartite.sets(B)
|
| 38 |
+
|
| 39 |
+
However, if the input graph is not connected, there are more than one possible
|
| 40 |
+
colorations. This is the reason why we require the user to pass a container
|
| 41 |
+
with all nodes of one bipartite node set as an argument to most bipartite
|
| 42 |
+
functions. In the face of ambiguity, we refuse the temptation to guess and
|
| 43 |
+
raise an :exc:`AmbiguousSolution <networkx.AmbiguousSolution>`
|
| 44 |
+
Exception if the input graph for
|
| 45 |
+
:func:`bipartite.sets <networkx.algorithms.bipartite.basic.sets>`
|
| 46 |
+
is disconnected.
|
| 47 |
+
|
| 48 |
+
Using the `bipartite` node attribute, you can easily get the two node sets:
|
| 49 |
+
|
| 50 |
+
>>> top_nodes = {n for n, d in B.nodes(data=True) if d["bipartite"] == 0}
|
| 51 |
+
>>> bottom_nodes = set(B) - top_nodes
|
| 52 |
+
|
| 53 |
+
So you can easily use the bipartite algorithms that require, as an argument, a
|
| 54 |
+
container with all nodes that belong to one node set:
|
| 55 |
+
|
| 56 |
+
>>> print(round(bipartite.density(B, bottom_nodes), 2))
|
| 57 |
+
0.5
|
| 58 |
+
>>> G = bipartite.projected_graph(B, top_nodes)
|
| 59 |
+
|
| 60 |
+
All bipartite graph generators in NetworkX build bipartite graphs with the
|
| 61 |
+
`bipartite` node attribute. Thus, you can use the same approach:
|
| 62 |
+
|
| 63 |
+
>>> RB = bipartite.random_graph(5, 7, 0.2)
|
| 64 |
+
>>> RB_top = {n for n, d in RB.nodes(data=True) if d["bipartite"] == 0}
|
| 65 |
+
>>> RB_bottom = set(RB) - RB_top
|
| 66 |
+
>>> list(RB_top)
|
| 67 |
+
[0, 1, 2, 3, 4]
|
| 68 |
+
>>> list(RB_bottom)
|
| 69 |
+
[5, 6, 7, 8, 9, 10, 11]
|
| 70 |
+
|
| 71 |
+
For other bipartite graph generators see
|
| 72 |
+
:mod:`Generators <networkx.algorithms.bipartite.generators>`.
|
| 73 |
+
|
| 74 |
+
"""
|
| 75 |
+
|
| 76 |
+
from networkx.algorithms.bipartite.basic import *
|
| 77 |
+
from networkx.algorithms.bipartite.centrality import *
|
| 78 |
+
from networkx.algorithms.bipartite.cluster import *
|
| 79 |
+
from networkx.algorithms.bipartite.covering import *
|
| 80 |
+
from networkx.algorithms.bipartite.edgelist import *
|
| 81 |
+
from networkx.algorithms.bipartite.matching import *
|
| 82 |
+
from networkx.algorithms.bipartite.matrix import *
|
| 83 |
+
from networkx.algorithms.bipartite.projection import *
|
| 84 |
+
from networkx.algorithms.bipartite.redundancy import *
|
| 85 |
+
from networkx.algorithms.bipartite.spectral import *
|
| 86 |
+
from networkx.algorithms.bipartite.generators import *
|
| 87 |
+
from networkx.algorithms.bipartite.extendability import *
|
tuning-competition-ba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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Functions for computing clustering of pairs
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import itertools
|
| 6 |
+
|
| 7 |
+
import networkx as nx
|
| 8 |
+
|
| 9 |
+
__all__ = [
|
| 10 |
+
"clustering",
|
| 11 |
+
"average_clustering",
|
| 12 |
+
"latapy_clustering",
|
| 13 |
+
"robins_alexander_clustering",
|
| 14 |
+
]
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def cc_dot(nu, nv):
|
| 18 |
+
return len(nu & nv) / len(nu | nv)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def cc_max(nu, nv):
|
| 22 |
+
return len(nu & nv) / max(len(nu), len(nv))
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def cc_min(nu, nv):
|
| 26 |
+
return len(nu & nv) / min(len(nu), len(nv))
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
modes = {"dot": cc_dot, "min": cc_min, "max": cc_max}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
@nx._dispatch
|
| 33 |
+
def latapy_clustering(G, nodes=None, mode="dot"):
|
| 34 |
+
r"""Compute a bipartite clustering coefficient for nodes.
|
| 35 |
+
|
| 36 |
+
The bipartite clustering coefficient is a measure of local density
|
| 37 |
+
of connections defined as [1]_:
|
| 38 |
+
|
| 39 |
+
.. math::
|
| 40 |
+
|
| 41 |
+
c_u = \frac{\sum_{v \in N(N(u))} c_{uv} }{|N(N(u))|}
|
| 42 |
+
|
| 43 |
+
where `N(N(u))` are the second order neighbors of `u` in `G` excluding `u`,
|
| 44 |
+
and `c_{uv}` is the pairwise clustering coefficient between nodes
|
| 45 |
+
`u` and `v`.
|
| 46 |
+
|
| 47 |
+
The mode selects the function for `c_{uv}` which can be:
|
| 48 |
+
|
| 49 |
+
`dot`:
|
| 50 |
+
|
| 51 |
+
.. math::
|
| 52 |
+
|
| 53 |
+
c_{uv}=\frac{|N(u)\cap N(v)|}{|N(u) \cup N(v)|}
|
| 54 |
+
|
| 55 |
+
`min`:
|
| 56 |
+
|
| 57 |
+
.. math::
|
| 58 |
+
|
| 59 |
+
c_{uv}=\frac{|N(u)\cap N(v)|}{min(|N(u)|,|N(v)|)}
|
| 60 |
+
|
| 61 |
+
`max`:
|
| 62 |
+
|
| 63 |
+
.. math::
|
| 64 |
+
|
| 65 |
+
c_{uv}=\frac{|N(u)\cap N(v)|}{max(|N(u)|,|N(v)|)}
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
Parameters
|
| 69 |
+
----------
|
| 70 |
+
G : graph
|
| 71 |
+
A bipartite graph
|
| 72 |
+
|
| 73 |
+
nodes : list or iterable (optional)
|
| 74 |
+
Compute bipartite clustering for these nodes. The default
|
| 75 |
+
is all nodes in G.
|
| 76 |
+
|
| 77 |
+
mode : string
|
| 78 |
+
The pairwise bipartite clustering method to be used in the computation.
|
| 79 |
+
It must be "dot", "max", or "min".
|
| 80 |
+
|
| 81 |
+
Returns
|
| 82 |
+
-------
|
| 83 |
+
clustering : dictionary
|
| 84 |
+
A dictionary keyed by node with the clustering coefficient value.
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
Examples
|
| 88 |
+
--------
|
| 89 |
+
>>> from networkx.algorithms import bipartite
|
| 90 |
+
>>> G = nx.path_graph(4) # path graphs are bipartite
|
| 91 |
+
>>> c = bipartite.clustering(G)
|
| 92 |
+
>>> c[0]
|
| 93 |
+
0.5
|
| 94 |
+
>>> c = bipartite.clustering(G, mode="min")
|
| 95 |
+
>>> c[0]
|
| 96 |
+
1.0
|
| 97 |
+
|
| 98 |
+
See Also
|
| 99 |
+
--------
|
| 100 |
+
robins_alexander_clustering
|
| 101 |
+
average_clustering
|
| 102 |
+
networkx.algorithms.cluster.square_clustering
|
| 103 |
+
|
| 104 |
+
References
|
| 105 |
+
----------
|
| 106 |
+
.. [1] Latapy, Matthieu, Clémence Magnien, and Nathalie Del Vecchio (2008).
|
| 107 |
+
Basic notions for the analysis of large two-mode networks.
|
| 108 |
+
Social Networks 30(1), 31--48.
|
| 109 |
+
"""
|
| 110 |
+
if not nx.algorithms.bipartite.is_bipartite(G):
|
| 111 |
+
raise nx.NetworkXError("Graph is not bipartite")
|
| 112 |
+
|
| 113 |
+
try:
|
| 114 |
+
cc_func = modes[mode]
|
| 115 |
+
except KeyError as err:
|
| 116 |
+
raise nx.NetworkXError(
|
| 117 |
+
"Mode for bipartite clustering must be: dot, min or max"
|
| 118 |
+
) from err
|
| 119 |
+
|
| 120 |
+
if nodes is None:
|
| 121 |
+
nodes = G
|
| 122 |
+
ccs = {}
|
| 123 |
+
for v in nodes:
|
| 124 |
+
cc = 0.0
|
| 125 |
+
nbrs2 = {u for nbr in G[v] for u in G[nbr]} - {v}
|
| 126 |
+
for u in nbrs2:
|
| 127 |
+
cc += cc_func(set(G[u]), set(G[v]))
|
| 128 |
+
if cc > 0.0: # len(nbrs2)>0
|
| 129 |
+
cc /= len(nbrs2)
|
| 130 |
+
ccs[v] = cc
|
| 131 |
+
return ccs
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
clustering = latapy_clustering
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
@nx._dispatch(name="bipartite_average_clustering")
|
| 138 |
+
def average_clustering(G, nodes=None, mode="dot"):
|
| 139 |
+
r"""Compute the average bipartite clustering coefficient.
|
| 140 |
+
|
| 141 |
+
A clustering coefficient for the whole graph is the average,
|
| 142 |
+
|
| 143 |
+
.. math::
|
| 144 |
+
|
| 145 |
+
C = \frac{1}{n}\sum_{v \in G} c_v,
|
| 146 |
+
|
| 147 |
+
where `n` is the number of nodes in `G`.
|
| 148 |
+
|
| 149 |
+
Similar measures for the two bipartite sets can be defined [1]_
|
| 150 |
+
|
| 151 |
+
.. math::
|
| 152 |
+
|
| 153 |
+
C_X = \frac{1}{|X|}\sum_{v \in X} c_v,
|
| 154 |
+
|
| 155 |
+
where `X` is a bipartite set of `G`.
|
| 156 |
+
|
| 157 |
+
Parameters
|
| 158 |
+
----------
|
| 159 |
+
G : graph
|
| 160 |
+
a bipartite graph
|
| 161 |
+
|
| 162 |
+
nodes : list or iterable, optional
|
| 163 |
+
A container of nodes to use in computing the average.
|
| 164 |
+
The nodes should be either the entire graph (the default) or one of the
|
| 165 |
+
bipartite sets.
|
| 166 |
+
|
| 167 |
+
mode : string
|
| 168 |
+
The pairwise bipartite clustering method.
|
| 169 |
+
It must be "dot", "max", or "min"
|
| 170 |
+
|
| 171 |
+
Returns
|
| 172 |
+
-------
|
| 173 |
+
clustering : float
|
| 174 |
+
The average bipartite clustering for the given set of nodes or the
|
| 175 |
+
entire graph if no nodes are specified.
|
| 176 |
+
|
| 177 |
+
Examples
|
| 178 |
+
--------
|
| 179 |
+
>>> from networkx.algorithms import bipartite
|
| 180 |
+
>>> G = nx.star_graph(3) # star graphs are bipartite
|
| 181 |
+
>>> bipartite.average_clustering(G)
|
| 182 |
+
0.75
|
| 183 |
+
>>> X, Y = bipartite.sets(G)
|
| 184 |
+
>>> bipartite.average_clustering(G, X)
|
| 185 |
+
0.0
|
| 186 |
+
>>> bipartite.average_clustering(G, Y)
|
| 187 |
+
1.0
|
| 188 |
+
|
| 189 |
+
See Also
|
| 190 |
+
--------
|
| 191 |
+
clustering
|
| 192 |
+
|
| 193 |
+
Notes
|
| 194 |
+
-----
|
| 195 |
+
The container of nodes passed to this function must contain all of the nodes
|
| 196 |
+
in one of the bipartite sets ("top" or "bottom") in order to compute
|
| 197 |
+
the correct average bipartite clustering coefficients.
|
| 198 |
+
See :mod:`bipartite documentation <networkx.algorithms.bipartite>`
|
| 199 |
+
for further details on how bipartite graphs are handled in NetworkX.
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
References
|
| 203 |
+
----------
|
| 204 |
+
.. [1] Latapy, Matthieu, Clémence Magnien, and Nathalie Del Vecchio (2008).
|
| 205 |
+
Basic notions for the analysis of large two-mode networks.
|
| 206 |
+
Social Networks 30(1), 31--48.
|
| 207 |
+
"""
|
| 208 |
+
if nodes is None:
|
| 209 |
+
nodes = G
|
| 210 |
+
ccs = latapy_clustering(G, nodes=nodes, mode=mode)
|
| 211 |
+
return sum(ccs[v] for v in nodes) / len(nodes)
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
@nx._dispatch
|
| 215 |
+
def robins_alexander_clustering(G):
|
| 216 |
+
r"""Compute the bipartite clustering of G.
|
| 217 |
+
|
| 218 |
+
Robins and Alexander [1]_ defined bipartite clustering coefficient as
|
| 219 |
+
four times the number of four cycles `C_4` divided by the number of
|
| 220 |
+
three paths `L_3` in a bipartite graph:
|
| 221 |
+
|
| 222 |
+
.. math::
|
| 223 |
+
|
| 224 |
+
CC_4 = \frac{4 * C_4}{L_3}
|
| 225 |
+
|
| 226 |
+
Parameters
|
| 227 |
+
----------
|
| 228 |
+
G : graph
|
| 229 |
+
a bipartite graph
|
| 230 |
+
|
| 231 |
+
Returns
|
| 232 |
+
-------
|
| 233 |
+
clustering : float
|
| 234 |
+
The Robins and Alexander bipartite clustering for the input graph.
|
| 235 |
+
|
| 236 |
+
Examples
|
| 237 |
+
--------
|
| 238 |
+
>>> from networkx.algorithms import bipartite
|
| 239 |
+
>>> G = nx.davis_southern_women_graph()
|
| 240 |
+
>>> print(round(bipartite.robins_alexander_clustering(G), 3))
|
| 241 |
+
0.468
|
| 242 |
+
|
| 243 |
+
See Also
|
| 244 |
+
--------
|
| 245 |
+
latapy_clustering
|
| 246 |
+
networkx.algorithms.cluster.square_clustering
|
| 247 |
+
|
| 248 |
+
References
|
| 249 |
+
----------
|
| 250 |
+
.. [1] Robins, G. and M. Alexander (2004). Small worlds among interlocking
|
| 251 |
+
directors: Network structure and distance in bipartite graphs.
|
| 252 |
+
Computational & Mathematical Organization Theory 10(1), 69–94.
|
| 253 |
+
|
| 254 |
+
"""
|
| 255 |
+
if G.order() < 4 or G.size() < 3:
|
| 256 |
+
return 0
|
| 257 |
+
L_3 = _threepaths(G)
|
| 258 |
+
if L_3 == 0:
|
| 259 |
+
return 0
|
| 260 |
+
C_4 = _four_cycles(G)
|
| 261 |
+
return (4.0 * C_4) / L_3
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
def _four_cycles(G):
|
| 265 |
+
cycles = 0
|
| 266 |
+
for v in G:
|
| 267 |
+
for u, w in itertools.combinations(G[v], 2):
|
| 268 |
+
cycles += len((set(G[u]) & set(G[w])) - {v})
|
| 269 |
+
return cycles / 4
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
def _threepaths(G):
|
| 273 |
+
paths = 0
|
| 274 |
+
for v in G:
|
| 275 |
+
for u in G[v]:
|
| 276 |
+
for w in set(G[u]) - {v}:
|
| 277 |
+
paths += len(set(G[w]) - {v, u})
|
| 278 |
+
# Divide by two because we count each three path twice
|
| 279 |
+
# one for each possible starting point
|
| 280 |
+
return paths / 2
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/covering.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
""" Functions related to graph covers."""
|
| 2 |
+
|
| 3 |
+
import networkx as nx
|
| 4 |
+
from networkx.algorithms.bipartite.matching import hopcroft_karp_matching
|
| 5 |
+
from networkx.algorithms.covering import min_edge_cover as _min_edge_cover
|
| 6 |
+
from networkx.utils import not_implemented_for
|
| 7 |
+
|
| 8 |
+
__all__ = ["min_edge_cover"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
@not_implemented_for("directed")
|
| 12 |
+
@not_implemented_for("multigraph")
|
| 13 |
+
@nx._dispatch(name="bipartite_min_edge_cover")
|
| 14 |
+
def min_edge_cover(G, matching_algorithm=None):
|
| 15 |
+
"""Returns a set of edges which constitutes
|
| 16 |
+
the minimum edge cover of the graph.
|
| 17 |
+
|
| 18 |
+
The smallest edge cover can be found in polynomial time by finding
|
| 19 |
+
a maximum matching and extending it greedily so that all nodes
|
| 20 |
+
are covered.
|
| 21 |
+
|
| 22 |
+
Parameters
|
| 23 |
+
----------
|
| 24 |
+
G : NetworkX graph
|
| 25 |
+
An undirected bipartite graph.
|
| 26 |
+
|
| 27 |
+
matching_algorithm : function
|
| 28 |
+
A function that returns a maximum cardinality matching in a
|
| 29 |
+
given bipartite graph. The function must take one input, the
|
| 30 |
+
graph ``G``, and return a dictionary mapping each node to its
|
| 31 |
+
mate. If not specified,
|
| 32 |
+
:func:`~networkx.algorithms.bipartite.matching.hopcroft_karp_matching`
|
| 33 |
+
will be used. Other possibilities include
|
| 34 |
+
:func:`~networkx.algorithms.bipartite.matching.eppstein_matching`,
|
| 35 |
+
|
| 36 |
+
Returns
|
| 37 |
+
-------
|
| 38 |
+
set
|
| 39 |
+
A set of the edges in a minimum edge cover of the graph, given as
|
| 40 |
+
pairs of nodes. It contains both the edges `(u, v)` and `(v, u)`
|
| 41 |
+
for given nodes `u` and `v` among the edges of minimum edge cover.
|
| 42 |
+
|
| 43 |
+
Notes
|
| 44 |
+
-----
|
| 45 |
+
An edge cover of a graph is a set of edges such that every node of
|
| 46 |
+
the graph is incident to at least one edge of the set.
|
| 47 |
+
A minimum edge cover is an edge covering of smallest cardinality.
|
| 48 |
+
|
| 49 |
+
Due to its implementation, the worst-case running time of this algorithm
|
| 50 |
+
is bounded by the worst-case running time of the function
|
| 51 |
+
``matching_algorithm``.
|
| 52 |
+
"""
|
| 53 |
+
if G.order() == 0: # Special case for the empty graph
|
| 54 |
+
return set()
|
| 55 |
+
if matching_algorithm is None:
|
| 56 |
+
matching_algorithm = hopcroft_karp_matching
|
| 57 |
+
return _min_edge_cover(G, matching_algorithm=matching_algorithm)
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/edgelist.py
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
+
Bipartite Edge Lists
|
| 4 |
+
********************
|
| 5 |
+
Read and write NetworkX graphs as bipartite edge lists.
|
| 6 |
+
|
| 7 |
+
Format
|
| 8 |
+
------
|
| 9 |
+
You can read or write three formats of edge lists with these functions.
|
| 10 |
+
|
| 11 |
+
Node pairs with no data::
|
| 12 |
+
|
| 13 |
+
1 2
|
| 14 |
+
|
| 15 |
+
Python dictionary as data::
|
| 16 |
+
|
| 17 |
+
1 2 {'weight':7, 'color':'green'}
|
| 18 |
+
|
| 19 |
+
Arbitrary data::
|
| 20 |
+
|
| 21 |
+
1 2 7 green
|
| 22 |
+
|
| 23 |
+
For each edge (u, v) the node u is assigned to part 0 and the node v to part 1.
|
| 24 |
+
"""
|
| 25 |
+
__all__ = ["generate_edgelist", "write_edgelist", "parse_edgelist", "read_edgelist"]
|
| 26 |
+
|
| 27 |
+
import networkx as nx
|
| 28 |
+
from networkx.utils import not_implemented_for, open_file
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
@open_file(1, mode="wb")
|
| 32 |
+
def write_edgelist(G, path, comments="#", delimiter=" ", data=True, encoding="utf-8"):
|
| 33 |
+
"""Write a bipartite graph as a list of edges.
|
| 34 |
+
|
| 35 |
+
Parameters
|
| 36 |
+
----------
|
| 37 |
+
G : Graph
|
| 38 |
+
A NetworkX bipartite graph
|
| 39 |
+
path : file or string
|
| 40 |
+
File or filename to write. If a file is provided, it must be
|
| 41 |
+
opened in 'wb' mode. Filenames ending in .gz or .bz2 will be compressed.
|
| 42 |
+
comments : string, optional
|
| 43 |
+
The character used to indicate the start of a comment
|
| 44 |
+
delimiter : string, optional
|
| 45 |
+
The string used to separate values. The default is whitespace.
|
| 46 |
+
data : bool or list, optional
|
| 47 |
+
If False write no edge data.
|
| 48 |
+
If True write a string representation of the edge data dictionary..
|
| 49 |
+
If a list (or other iterable) is provided, write the keys specified
|
| 50 |
+
in the list.
|
| 51 |
+
encoding: string, optional
|
| 52 |
+
Specify which encoding to use when writing file.
|
| 53 |
+
|
| 54 |
+
Examples
|
| 55 |
+
--------
|
| 56 |
+
>>> G = nx.path_graph(4)
|
| 57 |
+
>>> G.add_nodes_from([0, 2], bipartite=0)
|
| 58 |
+
>>> G.add_nodes_from([1, 3], bipartite=1)
|
| 59 |
+
>>> nx.write_edgelist(G, "test.edgelist")
|
| 60 |
+
>>> fh = open("test.edgelist", "wb")
|
| 61 |
+
>>> nx.write_edgelist(G, fh)
|
| 62 |
+
>>> nx.write_edgelist(G, "test.edgelist.gz")
|
| 63 |
+
>>> nx.write_edgelist(G, "test.edgelist.gz", data=False)
|
| 64 |
+
|
| 65 |
+
>>> G = nx.Graph()
|
| 66 |
+
>>> G.add_edge(1, 2, weight=7, color="red")
|
| 67 |
+
>>> nx.write_edgelist(G, "test.edgelist", data=False)
|
| 68 |
+
>>> nx.write_edgelist(G, "test.edgelist", data=["color"])
|
| 69 |
+
>>> nx.write_edgelist(G, "test.edgelist", data=["color", "weight"])
|
| 70 |
+
|
| 71 |
+
See Also
|
| 72 |
+
--------
|
| 73 |
+
write_edgelist
|
| 74 |
+
generate_edgelist
|
| 75 |
+
"""
|
| 76 |
+
for line in generate_edgelist(G, delimiter, data):
|
| 77 |
+
line += "\n"
|
| 78 |
+
path.write(line.encode(encoding))
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
@not_implemented_for("directed")
|
| 82 |
+
def generate_edgelist(G, delimiter=" ", data=True):
|
| 83 |
+
"""Generate a single line of the bipartite graph G in edge list format.
|
| 84 |
+
|
| 85 |
+
Parameters
|
| 86 |
+
----------
|
| 87 |
+
G : NetworkX graph
|
| 88 |
+
The graph is assumed to have node attribute `part` set to 0,1 representing
|
| 89 |
+
the two graph parts
|
| 90 |
+
|
| 91 |
+
delimiter : string, optional
|
| 92 |
+
Separator for node labels
|
| 93 |
+
|
| 94 |
+
data : bool or list of keys
|
| 95 |
+
If False generate no edge data. If True use a dictionary
|
| 96 |
+
representation of edge data. If a list of keys use a list of data
|
| 97 |
+
values corresponding to the keys.
|
| 98 |
+
|
| 99 |
+
Returns
|
| 100 |
+
-------
|
| 101 |
+
lines : string
|
| 102 |
+
Lines of data in adjlist format.
|
| 103 |
+
|
| 104 |
+
Examples
|
| 105 |
+
--------
|
| 106 |
+
>>> from networkx.algorithms import bipartite
|
| 107 |
+
>>> G = nx.path_graph(4)
|
| 108 |
+
>>> G.add_nodes_from([0, 2], bipartite=0)
|
| 109 |
+
>>> G.add_nodes_from([1, 3], bipartite=1)
|
| 110 |
+
>>> G[1][2]["weight"] = 3
|
| 111 |
+
>>> G[2][3]["capacity"] = 12
|
| 112 |
+
>>> for line in bipartite.generate_edgelist(G, data=False):
|
| 113 |
+
... print(line)
|
| 114 |
+
0 1
|
| 115 |
+
2 1
|
| 116 |
+
2 3
|
| 117 |
+
|
| 118 |
+
>>> for line in bipartite.generate_edgelist(G):
|
| 119 |
+
... print(line)
|
| 120 |
+
0 1 {}
|
| 121 |
+
2 1 {'weight': 3}
|
| 122 |
+
2 3 {'capacity': 12}
|
| 123 |
+
|
| 124 |
+
>>> for line in bipartite.generate_edgelist(G, data=["weight"]):
|
| 125 |
+
... print(line)
|
| 126 |
+
0 1
|
| 127 |
+
2 1 3
|
| 128 |
+
2 3
|
| 129 |
+
"""
|
| 130 |
+
try:
|
| 131 |
+
part0 = [n for n, d in G.nodes.items() if d["bipartite"] == 0]
|
| 132 |
+
except BaseException as err:
|
| 133 |
+
raise AttributeError("Missing node attribute `bipartite`") from err
|
| 134 |
+
if data is True or data is False:
|
| 135 |
+
for n in part0:
|
| 136 |
+
for edge in G.edges(n, data=data):
|
| 137 |
+
yield delimiter.join(map(str, edge))
|
| 138 |
+
else:
|
| 139 |
+
for n in part0:
|
| 140 |
+
for u, v, d in G.edges(n, data=True):
|
| 141 |
+
edge = [u, v]
|
| 142 |
+
try:
|
| 143 |
+
edge.extend(d[k] for k in data)
|
| 144 |
+
except KeyError:
|
| 145 |
+
pass # missing data for this edge, should warn?
|
| 146 |
+
yield delimiter.join(map(str, edge))
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
@nx._dispatch(name="bipartite_parse_edgelist", graphs=None)
|
| 150 |
+
def parse_edgelist(
|
| 151 |
+
lines, comments="#", delimiter=None, create_using=None, nodetype=None, data=True
|
| 152 |
+
):
|
| 153 |
+
"""Parse lines of an edge list representation of a bipartite graph.
|
| 154 |
+
|
| 155 |
+
Parameters
|
| 156 |
+
----------
|
| 157 |
+
lines : list or iterator of strings
|
| 158 |
+
Input data in edgelist format
|
| 159 |
+
comments : string, optional
|
| 160 |
+
Marker for comment lines
|
| 161 |
+
delimiter : string, optional
|
| 162 |
+
Separator for node labels
|
| 163 |
+
create_using: NetworkX graph container, optional
|
| 164 |
+
Use given NetworkX graph for holding nodes or edges.
|
| 165 |
+
nodetype : Python type, optional
|
| 166 |
+
Convert nodes to this type.
|
| 167 |
+
data : bool or list of (label,type) tuples
|
| 168 |
+
If False generate no edge data or if True use a dictionary
|
| 169 |
+
representation of edge data or a list tuples specifying dictionary
|
| 170 |
+
key names and types for edge data.
|
| 171 |
+
|
| 172 |
+
Returns
|
| 173 |
+
-------
|
| 174 |
+
G: NetworkX Graph
|
| 175 |
+
The bipartite graph corresponding to lines
|
| 176 |
+
|
| 177 |
+
Examples
|
| 178 |
+
--------
|
| 179 |
+
Edgelist with no data:
|
| 180 |
+
|
| 181 |
+
>>> from networkx.algorithms import bipartite
|
| 182 |
+
>>> lines = ["1 2", "2 3", "3 4"]
|
| 183 |
+
>>> G = bipartite.parse_edgelist(lines, nodetype=int)
|
| 184 |
+
>>> sorted(G.nodes())
|
| 185 |
+
[1, 2, 3, 4]
|
| 186 |
+
>>> sorted(G.nodes(data=True))
|
| 187 |
+
[(1, {'bipartite': 0}), (2, {'bipartite': 0}), (3, {'bipartite': 0}), (4, {'bipartite': 1})]
|
| 188 |
+
>>> sorted(G.edges())
|
| 189 |
+
[(1, 2), (2, 3), (3, 4)]
|
| 190 |
+
|
| 191 |
+
Edgelist with data in Python dictionary representation:
|
| 192 |
+
|
| 193 |
+
>>> lines = ["1 2 {'weight':3}", "2 3 {'weight':27}", "3 4 {'weight':3.0}"]
|
| 194 |
+
>>> G = bipartite.parse_edgelist(lines, nodetype=int)
|
| 195 |
+
>>> sorted(G.nodes())
|
| 196 |
+
[1, 2, 3, 4]
|
| 197 |
+
>>> sorted(G.edges(data=True))
|
| 198 |
+
[(1, 2, {'weight': 3}), (2, 3, {'weight': 27}), (3, 4, {'weight': 3.0})]
|
| 199 |
+
|
| 200 |
+
Edgelist with data in a list:
|
| 201 |
+
|
| 202 |
+
>>> lines = ["1 2 3", "2 3 27", "3 4 3.0"]
|
| 203 |
+
>>> G = bipartite.parse_edgelist(lines, nodetype=int, data=(("weight", float),))
|
| 204 |
+
>>> sorted(G.nodes())
|
| 205 |
+
[1, 2, 3, 4]
|
| 206 |
+
>>> sorted(G.edges(data=True))
|
| 207 |
+
[(1, 2, {'weight': 3.0}), (2, 3, {'weight': 27.0}), (3, 4, {'weight': 3.0})]
|
| 208 |
+
|
| 209 |
+
See Also
|
| 210 |
+
--------
|
| 211 |
+
"""
|
| 212 |
+
from ast import literal_eval
|
| 213 |
+
|
| 214 |
+
G = nx.empty_graph(0, create_using)
|
| 215 |
+
for line in lines:
|
| 216 |
+
p = line.find(comments)
|
| 217 |
+
if p >= 0:
|
| 218 |
+
line = line[:p]
|
| 219 |
+
if not len(line):
|
| 220 |
+
continue
|
| 221 |
+
# split line, should have 2 or more
|
| 222 |
+
s = line.strip().split(delimiter)
|
| 223 |
+
if len(s) < 2:
|
| 224 |
+
continue
|
| 225 |
+
u = s.pop(0)
|
| 226 |
+
v = s.pop(0)
|
| 227 |
+
d = s
|
| 228 |
+
if nodetype is not None:
|
| 229 |
+
try:
|
| 230 |
+
u = nodetype(u)
|
| 231 |
+
v = nodetype(v)
|
| 232 |
+
except BaseException as err:
|
| 233 |
+
raise TypeError(
|
| 234 |
+
f"Failed to convert nodes {u},{v} " f"to type {nodetype}."
|
| 235 |
+
) from err
|
| 236 |
+
|
| 237 |
+
if len(d) == 0 or data is False:
|
| 238 |
+
# no data or data type specified
|
| 239 |
+
edgedata = {}
|
| 240 |
+
elif data is True:
|
| 241 |
+
# no edge types specified
|
| 242 |
+
try: # try to evaluate as dictionary
|
| 243 |
+
edgedata = dict(literal_eval(" ".join(d)))
|
| 244 |
+
except BaseException as err:
|
| 245 |
+
raise TypeError(
|
| 246 |
+
f"Failed to convert edge data ({d})" f"to dictionary."
|
| 247 |
+
) from err
|
| 248 |
+
else:
|
| 249 |
+
# convert edge data to dictionary with specified keys and type
|
| 250 |
+
if len(d) != len(data):
|
| 251 |
+
raise IndexError(
|
| 252 |
+
f"Edge data {d} and data_keys {data} are not the same length"
|
| 253 |
+
)
|
| 254 |
+
edgedata = {}
|
| 255 |
+
for (edge_key, edge_type), edge_value in zip(data, d):
|
| 256 |
+
try:
|
| 257 |
+
edge_value = edge_type(edge_value)
|
| 258 |
+
except BaseException as err:
|
| 259 |
+
raise TypeError(
|
| 260 |
+
f"Failed to convert {edge_key} data "
|
| 261 |
+
f"{edge_value} to type {edge_type}."
|
| 262 |
+
) from err
|
| 263 |
+
edgedata.update({edge_key: edge_value})
|
| 264 |
+
G.add_node(u, bipartite=0)
|
| 265 |
+
G.add_node(v, bipartite=1)
|
| 266 |
+
G.add_edge(u, v, **edgedata)
|
| 267 |
+
return G
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
@open_file(0, mode="rb")
|
| 271 |
+
@nx._dispatch(name="bipartite_read_edgelist", graphs=None)
|
| 272 |
+
def read_edgelist(
|
| 273 |
+
path,
|
| 274 |
+
comments="#",
|
| 275 |
+
delimiter=None,
|
| 276 |
+
create_using=None,
|
| 277 |
+
nodetype=None,
|
| 278 |
+
data=True,
|
| 279 |
+
edgetype=None,
|
| 280 |
+
encoding="utf-8",
|
| 281 |
+
):
|
| 282 |
+
"""Read a bipartite graph from a list of edges.
|
| 283 |
+
|
| 284 |
+
Parameters
|
| 285 |
+
----------
|
| 286 |
+
path : file or string
|
| 287 |
+
File or filename to read. If a file is provided, it must be
|
| 288 |
+
opened in 'rb' mode.
|
| 289 |
+
Filenames ending in .gz or .bz2 will be uncompressed.
|
| 290 |
+
comments : string, optional
|
| 291 |
+
The character used to indicate the start of a comment.
|
| 292 |
+
delimiter : string, optional
|
| 293 |
+
The string used to separate values. The default is whitespace.
|
| 294 |
+
create_using : Graph container, optional,
|
| 295 |
+
Use specified container to build graph. The default is networkx.Graph,
|
| 296 |
+
an undirected graph.
|
| 297 |
+
nodetype : int, float, str, Python type, optional
|
| 298 |
+
Convert node data from strings to specified type
|
| 299 |
+
data : bool or list of (label,type) tuples
|
| 300 |
+
Tuples specifying dictionary key names and types for edge data
|
| 301 |
+
edgetype : int, float, str, Python type, optional OBSOLETE
|
| 302 |
+
Convert edge data from strings to specified type and use as 'weight'
|
| 303 |
+
encoding: string, optional
|
| 304 |
+
Specify which encoding to use when reading file.
|
| 305 |
+
|
| 306 |
+
Returns
|
| 307 |
+
-------
|
| 308 |
+
G : graph
|
| 309 |
+
A networkx Graph or other type specified with create_using
|
| 310 |
+
|
| 311 |
+
Examples
|
| 312 |
+
--------
|
| 313 |
+
>>> from networkx.algorithms import bipartite
|
| 314 |
+
>>> G = nx.path_graph(4)
|
| 315 |
+
>>> G.add_nodes_from([0, 2], bipartite=0)
|
| 316 |
+
>>> G.add_nodes_from([1, 3], bipartite=1)
|
| 317 |
+
>>> bipartite.write_edgelist(G, "test.edgelist")
|
| 318 |
+
>>> G = bipartite.read_edgelist("test.edgelist")
|
| 319 |
+
|
| 320 |
+
>>> fh = open("test.edgelist", "rb")
|
| 321 |
+
>>> G = bipartite.read_edgelist(fh)
|
| 322 |
+
>>> fh.close()
|
| 323 |
+
|
| 324 |
+
>>> G = bipartite.read_edgelist("test.edgelist", nodetype=int)
|
| 325 |
+
|
| 326 |
+
Edgelist with data in a list:
|
| 327 |
+
|
| 328 |
+
>>> textline = "1 2 3"
|
| 329 |
+
>>> fh = open("test.edgelist", "w")
|
| 330 |
+
>>> d = fh.write(textline)
|
| 331 |
+
>>> fh.close()
|
| 332 |
+
>>> G = bipartite.read_edgelist(
|
| 333 |
+
... "test.edgelist", nodetype=int, data=(("weight", float),)
|
| 334 |
+
... )
|
| 335 |
+
>>> list(G)
|
| 336 |
+
[1, 2]
|
| 337 |
+
>>> list(G.edges(data=True))
|
| 338 |
+
[(1, 2, {'weight': 3.0})]
|
| 339 |
+
|
| 340 |
+
See parse_edgelist() for more examples of formatting.
|
| 341 |
+
|
| 342 |
+
See Also
|
| 343 |
+
--------
|
| 344 |
+
parse_edgelist
|
| 345 |
+
|
| 346 |
+
Notes
|
| 347 |
+
-----
|
| 348 |
+
Since nodes must be hashable, the function nodetype must return hashable
|
| 349 |
+
types (e.g. int, float, str, frozenset - or tuples of those, etc.)
|
| 350 |
+
"""
|
| 351 |
+
lines = (line.decode(encoding) for line in path)
|
| 352 |
+
return parse_edgelist(
|
| 353 |
+
lines,
|
| 354 |
+
comments=comments,
|
| 355 |
+
delimiter=delimiter,
|
| 356 |
+
create_using=create_using,
|
| 357 |
+
nodetype=nodetype,
|
| 358 |
+
data=data,
|
| 359 |
+
)
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/generators.py
ADDED
|
@@ -0,0 +1,603 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Generators and functions for bipartite graphs.
|
| 3 |
+
"""
|
| 4 |
+
import math
|
| 5 |
+
import numbers
|
| 6 |
+
from functools import reduce
|
| 7 |
+
|
| 8 |
+
import networkx as nx
|
| 9 |
+
from networkx.utils import nodes_or_number, py_random_state
|
| 10 |
+
|
| 11 |
+
__all__ = [
|
| 12 |
+
"configuration_model",
|
| 13 |
+
"havel_hakimi_graph",
|
| 14 |
+
"reverse_havel_hakimi_graph",
|
| 15 |
+
"alternating_havel_hakimi_graph",
|
| 16 |
+
"preferential_attachment_graph",
|
| 17 |
+
"random_graph",
|
| 18 |
+
"gnmk_random_graph",
|
| 19 |
+
"complete_bipartite_graph",
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
@nodes_or_number([0, 1])
|
| 24 |
+
@nx._dispatch(graphs=None)
|
| 25 |
+
def complete_bipartite_graph(n1, n2, create_using=None):
|
| 26 |
+
"""Returns the complete bipartite graph `K_{n_1,n_2}`.
|
| 27 |
+
|
| 28 |
+
The graph is composed of two partitions with nodes 0 to (n1 - 1)
|
| 29 |
+
in the first and nodes n1 to (n1 + n2 - 1) in the second.
|
| 30 |
+
Each node in the first is connected to each node in the second.
|
| 31 |
+
|
| 32 |
+
Parameters
|
| 33 |
+
----------
|
| 34 |
+
n1, n2 : integer or iterable container of nodes
|
| 35 |
+
If integers, nodes are from `range(n1)` and `range(n1, n1 + n2)`.
|
| 36 |
+
If a container, the elements are the nodes.
|
| 37 |
+
create_using : NetworkX graph instance, (default: nx.Graph)
|
| 38 |
+
Return graph of this type.
|
| 39 |
+
|
| 40 |
+
Notes
|
| 41 |
+
-----
|
| 42 |
+
Nodes are the integers 0 to `n1 + n2 - 1` unless either n1 or n2 are
|
| 43 |
+
containers of nodes. If only one of n1 or n2 are integers, that
|
| 44 |
+
integer is replaced by `range` of that integer.
|
| 45 |
+
|
| 46 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 47 |
+
to indicate which bipartite set the node belongs to.
|
| 48 |
+
|
| 49 |
+
This function is not imported in the main namespace.
|
| 50 |
+
To use it use nx.bipartite.complete_bipartite_graph
|
| 51 |
+
"""
|
| 52 |
+
G = nx.empty_graph(0, create_using)
|
| 53 |
+
if G.is_directed():
|
| 54 |
+
raise nx.NetworkXError("Directed Graph not supported")
|
| 55 |
+
|
| 56 |
+
n1, top = n1
|
| 57 |
+
n2, bottom = n2
|
| 58 |
+
if isinstance(n1, numbers.Integral) and isinstance(n2, numbers.Integral):
|
| 59 |
+
bottom = [n1 + i for i in bottom]
|
| 60 |
+
G.add_nodes_from(top, bipartite=0)
|
| 61 |
+
G.add_nodes_from(bottom, bipartite=1)
|
| 62 |
+
if len(G) != len(top) + len(bottom):
|
| 63 |
+
raise nx.NetworkXError("Inputs n1 and n2 must contain distinct nodes")
|
| 64 |
+
G.add_edges_from((u, v) for u in top for v in bottom)
|
| 65 |
+
G.graph["name"] = f"complete_bipartite_graph({n1}, {n2})"
|
| 66 |
+
return G
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
@py_random_state(3)
|
| 70 |
+
@nx._dispatch(name="bipartite_configuration_model", graphs=None)
|
| 71 |
+
def configuration_model(aseq, bseq, create_using=None, seed=None):
|
| 72 |
+
"""Returns a random bipartite graph from two given degree sequences.
|
| 73 |
+
|
| 74 |
+
Parameters
|
| 75 |
+
----------
|
| 76 |
+
aseq : list
|
| 77 |
+
Degree sequence for node set A.
|
| 78 |
+
bseq : list
|
| 79 |
+
Degree sequence for node set B.
|
| 80 |
+
create_using : NetworkX graph instance, optional
|
| 81 |
+
Return graph of this type.
|
| 82 |
+
seed : integer, random_state, or None (default)
|
| 83 |
+
Indicator of random number generation state.
|
| 84 |
+
See :ref:`Randomness<randomness>`.
|
| 85 |
+
|
| 86 |
+
The graph is composed of two partitions. Set A has nodes 0 to
|
| 87 |
+
(len(aseq) - 1) and set B has nodes len(aseq) to (len(bseq) - 1).
|
| 88 |
+
Nodes from set A are connected to nodes in set B by choosing
|
| 89 |
+
randomly from the possible free stubs, one in A and one in B.
|
| 90 |
+
|
| 91 |
+
Notes
|
| 92 |
+
-----
|
| 93 |
+
The sum of the two sequences must be equal: sum(aseq)=sum(bseq)
|
| 94 |
+
If no graph type is specified use MultiGraph with parallel edges.
|
| 95 |
+
If you want a graph with no parallel edges use create_using=Graph()
|
| 96 |
+
but then the resulting degree sequences might not be exact.
|
| 97 |
+
|
| 98 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 99 |
+
to indicate which bipartite set the node belongs to.
|
| 100 |
+
|
| 101 |
+
This function is not imported in the main namespace.
|
| 102 |
+
To use it use nx.bipartite.configuration_model
|
| 103 |
+
"""
|
| 104 |
+
G = nx.empty_graph(0, create_using, default=nx.MultiGraph)
|
| 105 |
+
if G.is_directed():
|
| 106 |
+
raise nx.NetworkXError("Directed Graph not supported")
|
| 107 |
+
|
| 108 |
+
# length and sum of each sequence
|
| 109 |
+
lena = len(aseq)
|
| 110 |
+
lenb = len(bseq)
|
| 111 |
+
suma = sum(aseq)
|
| 112 |
+
sumb = sum(bseq)
|
| 113 |
+
|
| 114 |
+
if not suma == sumb:
|
| 115 |
+
raise nx.NetworkXError(
|
| 116 |
+
f"invalid degree sequences, sum(aseq)!=sum(bseq),{suma},{sumb}"
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
G = _add_nodes_with_bipartite_label(G, lena, lenb)
|
| 120 |
+
|
| 121 |
+
if len(aseq) == 0 or max(aseq) == 0:
|
| 122 |
+
return G # done if no edges
|
| 123 |
+
|
| 124 |
+
# build lists of degree-repeated vertex numbers
|
| 125 |
+
stubs = [[v] * aseq[v] for v in range(lena)]
|
| 126 |
+
astubs = [x for subseq in stubs for x in subseq]
|
| 127 |
+
|
| 128 |
+
stubs = [[v] * bseq[v - lena] for v in range(lena, lena + lenb)]
|
| 129 |
+
bstubs = [x for subseq in stubs for x in subseq]
|
| 130 |
+
|
| 131 |
+
# shuffle lists
|
| 132 |
+
seed.shuffle(astubs)
|
| 133 |
+
seed.shuffle(bstubs)
|
| 134 |
+
|
| 135 |
+
G.add_edges_from([astubs[i], bstubs[i]] for i in range(suma))
|
| 136 |
+
|
| 137 |
+
G.name = "bipartite_configuration_model"
|
| 138 |
+
return G
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
@nx._dispatch(name="bipartite_havel_hakimi_graph", graphs=None)
|
| 142 |
+
def havel_hakimi_graph(aseq, bseq, create_using=None):
|
| 143 |
+
"""Returns a bipartite graph from two given degree sequences using a
|
| 144 |
+
Havel-Hakimi style construction.
|
| 145 |
+
|
| 146 |
+
The graph is composed of two partitions. Set A has nodes 0 to
|
| 147 |
+
(len(aseq) - 1) and set B has nodes len(aseq) to (len(bseq) - 1).
|
| 148 |
+
Nodes from the set A are connected to nodes in the set B by
|
| 149 |
+
connecting the highest degree nodes in set A to the highest degree
|
| 150 |
+
nodes in set B until all stubs are connected.
|
| 151 |
+
|
| 152 |
+
Parameters
|
| 153 |
+
----------
|
| 154 |
+
aseq : list
|
| 155 |
+
Degree sequence for node set A.
|
| 156 |
+
bseq : list
|
| 157 |
+
Degree sequence for node set B.
|
| 158 |
+
create_using : NetworkX graph instance, optional
|
| 159 |
+
Return graph of this type.
|
| 160 |
+
|
| 161 |
+
Notes
|
| 162 |
+
-----
|
| 163 |
+
The sum of the two sequences must be equal: sum(aseq)=sum(bseq)
|
| 164 |
+
If no graph type is specified use MultiGraph with parallel edges.
|
| 165 |
+
If you want a graph with no parallel edges use create_using=Graph()
|
| 166 |
+
but then the resulting degree sequences might not be exact.
|
| 167 |
+
|
| 168 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 169 |
+
to indicate which bipartite set the node belongs to.
|
| 170 |
+
|
| 171 |
+
This function is not imported in the main namespace.
|
| 172 |
+
To use it use nx.bipartite.havel_hakimi_graph
|
| 173 |
+
"""
|
| 174 |
+
G = nx.empty_graph(0, create_using, default=nx.MultiGraph)
|
| 175 |
+
if G.is_directed():
|
| 176 |
+
raise nx.NetworkXError("Directed Graph not supported")
|
| 177 |
+
|
| 178 |
+
# length of the each sequence
|
| 179 |
+
naseq = len(aseq)
|
| 180 |
+
nbseq = len(bseq)
|
| 181 |
+
|
| 182 |
+
suma = sum(aseq)
|
| 183 |
+
sumb = sum(bseq)
|
| 184 |
+
|
| 185 |
+
if not suma == sumb:
|
| 186 |
+
raise nx.NetworkXError(
|
| 187 |
+
f"invalid degree sequences, sum(aseq)!=sum(bseq),{suma},{sumb}"
|
| 188 |
+
)
|
| 189 |
+
|
| 190 |
+
G = _add_nodes_with_bipartite_label(G, naseq, nbseq)
|
| 191 |
+
|
| 192 |
+
if len(aseq) == 0 or max(aseq) == 0:
|
| 193 |
+
return G # done if no edges
|
| 194 |
+
|
| 195 |
+
# build list of degree-repeated vertex numbers
|
| 196 |
+
astubs = [[aseq[v], v] for v in range(naseq)]
|
| 197 |
+
bstubs = [[bseq[v - naseq], v] for v in range(naseq, naseq + nbseq)]
|
| 198 |
+
astubs.sort()
|
| 199 |
+
while astubs:
|
| 200 |
+
(degree, u) = astubs.pop() # take of largest degree node in the a set
|
| 201 |
+
if degree == 0:
|
| 202 |
+
break # done, all are zero
|
| 203 |
+
# connect the source to largest degree nodes in the b set
|
| 204 |
+
bstubs.sort()
|
| 205 |
+
for target in bstubs[-degree:]:
|
| 206 |
+
v = target[1]
|
| 207 |
+
G.add_edge(u, v)
|
| 208 |
+
target[0] -= 1 # note this updates bstubs too.
|
| 209 |
+
if target[0] == 0:
|
| 210 |
+
bstubs.remove(target)
|
| 211 |
+
|
| 212 |
+
G.name = "bipartite_havel_hakimi_graph"
|
| 213 |
+
return G
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
@nx._dispatch(graphs=None)
|
| 217 |
+
def reverse_havel_hakimi_graph(aseq, bseq, create_using=None):
|
| 218 |
+
"""Returns a bipartite graph from two given degree sequences using a
|
| 219 |
+
Havel-Hakimi style construction.
|
| 220 |
+
|
| 221 |
+
The graph is composed of two partitions. Set A has nodes 0 to
|
| 222 |
+
(len(aseq) - 1) and set B has nodes len(aseq) to (len(bseq) - 1).
|
| 223 |
+
Nodes from set A are connected to nodes in the set B by connecting
|
| 224 |
+
the highest degree nodes in set A to the lowest degree nodes in
|
| 225 |
+
set B until all stubs are connected.
|
| 226 |
+
|
| 227 |
+
Parameters
|
| 228 |
+
----------
|
| 229 |
+
aseq : list
|
| 230 |
+
Degree sequence for node set A.
|
| 231 |
+
bseq : list
|
| 232 |
+
Degree sequence for node set B.
|
| 233 |
+
create_using : NetworkX graph instance, optional
|
| 234 |
+
Return graph of this type.
|
| 235 |
+
|
| 236 |
+
Notes
|
| 237 |
+
-----
|
| 238 |
+
The sum of the two sequences must be equal: sum(aseq)=sum(bseq)
|
| 239 |
+
If no graph type is specified use MultiGraph with parallel edges.
|
| 240 |
+
If you want a graph with no parallel edges use create_using=Graph()
|
| 241 |
+
but then the resulting degree sequences might not be exact.
|
| 242 |
+
|
| 243 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 244 |
+
to indicate which bipartite set the node belongs to.
|
| 245 |
+
|
| 246 |
+
This function is not imported in the main namespace.
|
| 247 |
+
To use it use nx.bipartite.reverse_havel_hakimi_graph
|
| 248 |
+
"""
|
| 249 |
+
G = nx.empty_graph(0, create_using, default=nx.MultiGraph)
|
| 250 |
+
if G.is_directed():
|
| 251 |
+
raise nx.NetworkXError("Directed Graph not supported")
|
| 252 |
+
|
| 253 |
+
# length of the each sequence
|
| 254 |
+
lena = len(aseq)
|
| 255 |
+
lenb = len(bseq)
|
| 256 |
+
suma = sum(aseq)
|
| 257 |
+
sumb = sum(bseq)
|
| 258 |
+
|
| 259 |
+
if not suma == sumb:
|
| 260 |
+
raise nx.NetworkXError(
|
| 261 |
+
f"invalid degree sequences, sum(aseq)!=sum(bseq),{suma},{sumb}"
|
| 262 |
+
)
|
| 263 |
+
|
| 264 |
+
G = _add_nodes_with_bipartite_label(G, lena, lenb)
|
| 265 |
+
|
| 266 |
+
if len(aseq) == 0 or max(aseq) == 0:
|
| 267 |
+
return G # done if no edges
|
| 268 |
+
|
| 269 |
+
# build list of degree-repeated vertex numbers
|
| 270 |
+
astubs = [[aseq[v], v] for v in range(lena)]
|
| 271 |
+
bstubs = [[bseq[v - lena], v] for v in range(lena, lena + lenb)]
|
| 272 |
+
astubs.sort()
|
| 273 |
+
bstubs.sort()
|
| 274 |
+
while astubs:
|
| 275 |
+
(degree, u) = astubs.pop() # take of largest degree node in the a set
|
| 276 |
+
if degree == 0:
|
| 277 |
+
break # done, all are zero
|
| 278 |
+
# connect the source to the smallest degree nodes in the b set
|
| 279 |
+
for target in bstubs[0:degree]:
|
| 280 |
+
v = target[1]
|
| 281 |
+
G.add_edge(u, v)
|
| 282 |
+
target[0] -= 1 # note this updates bstubs too.
|
| 283 |
+
if target[0] == 0:
|
| 284 |
+
bstubs.remove(target)
|
| 285 |
+
|
| 286 |
+
G.name = "bipartite_reverse_havel_hakimi_graph"
|
| 287 |
+
return G
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
@nx._dispatch(graphs=None)
|
| 291 |
+
def alternating_havel_hakimi_graph(aseq, bseq, create_using=None):
|
| 292 |
+
"""Returns a bipartite graph from two given degree sequences using
|
| 293 |
+
an alternating Havel-Hakimi style construction.
|
| 294 |
+
|
| 295 |
+
The graph is composed of two partitions. Set A has nodes 0 to
|
| 296 |
+
(len(aseq) - 1) and set B has nodes len(aseq) to (len(bseq) - 1).
|
| 297 |
+
Nodes from the set A are connected to nodes in the set B by
|
| 298 |
+
connecting the highest degree nodes in set A to alternatively the
|
| 299 |
+
highest and the lowest degree nodes in set B until all stubs are
|
| 300 |
+
connected.
|
| 301 |
+
|
| 302 |
+
Parameters
|
| 303 |
+
----------
|
| 304 |
+
aseq : list
|
| 305 |
+
Degree sequence for node set A.
|
| 306 |
+
bseq : list
|
| 307 |
+
Degree sequence for node set B.
|
| 308 |
+
create_using : NetworkX graph instance, optional
|
| 309 |
+
Return graph of this type.
|
| 310 |
+
|
| 311 |
+
Notes
|
| 312 |
+
-----
|
| 313 |
+
The sum of the two sequences must be equal: sum(aseq)=sum(bseq)
|
| 314 |
+
If no graph type is specified use MultiGraph with parallel edges.
|
| 315 |
+
If you want a graph with no parallel edges use create_using=Graph()
|
| 316 |
+
but then the resulting degree sequences might not be exact.
|
| 317 |
+
|
| 318 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 319 |
+
to indicate which bipartite set the node belongs to.
|
| 320 |
+
|
| 321 |
+
This function is not imported in the main namespace.
|
| 322 |
+
To use it use nx.bipartite.alternating_havel_hakimi_graph
|
| 323 |
+
"""
|
| 324 |
+
G = nx.empty_graph(0, create_using, default=nx.MultiGraph)
|
| 325 |
+
if G.is_directed():
|
| 326 |
+
raise nx.NetworkXError("Directed Graph not supported")
|
| 327 |
+
|
| 328 |
+
# length of the each sequence
|
| 329 |
+
naseq = len(aseq)
|
| 330 |
+
nbseq = len(bseq)
|
| 331 |
+
suma = sum(aseq)
|
| 332 |
+
sumb = sum(bseq)
|
| 333 |
+
|
| 334 |
+
if not suma == sumb:
|
| 335 |
+
raise nx.NetworkXError(
|
| 336 |
+
f"invalid degree sequences, sum(aseq)!=sum(bseq),{suma},{sumb}"
|
| 337 |
+
)
|
| 338 |
+
|
| 339 |
+
G = _add_nodes_with_bipartite_label(G, naseq, nbseq)
|
| 340 |
+
|
| 341 |
+
if len(aseq) == 0 or max(aseq) == 0:
|
| 342 |
+
return G # done if no edges
|
| 343 |
+
# build list of degree-repeated vertex numbers
|
| 344 |
+
astubs = [[aseq[v], v] for v in range(naseq)]
|
| 345 |
+
bstubs = [[bseq[v - naseq], v] for v in range(naseq, naseq + nbseq)]
|
| 346 |
+
while astubs:
|
| 347 |
+
astubs.sort()
|
| 348 |
+
(degree, u) = astubs.pop() # take of largest degree node in the a set
|
| 349 |
+
if degree == 0:
|
| 350 |
+
break # done, all are zero
|
| 351 |
+
bstubs.sort()
|
| 352 |
+
small = bstubs[0 : degree // 2] # add these low degree targets
|
| 353 |
+
large = bstubs[(-degree + degree // 2) :] # now high degree targets
|
| 354 |
+
stubs = [x for z in zip(large, small) for x in z] # combine, sorry
|
| 355 |
+
if len(stubs) < len(small) + len(large): # check for zip truncation
|
| 356 |
+
stubs.append(large.pop())
|
| 357 |
+
for target in stubs:
|
| 358 |
+
v = target[1]
|
| 359 |
+
G.add_edge(u, v)
|
| 360 |
+
target[0] -= 1 # note this updates bstubs too.
|
| 361 |
+
if target[0] == 0:
|
| 362 |
+
bstubs.remove(target)
|
| 363 |
+
|
| 364 |
+
G.name = "bipartite_alternating_havel_hakimi_graph"
|
| 365 |
+
return G
|
| 366 |
+
|
| 367 |
+
|
| 368 |
+
@py_random_state(3)
|
| 369 |
+
@nx._dispatch(graphs=None)
|
| 370 |
+
def preferential_attachment_graph(aseq, p, create_using=None, seed=None):
|
| 371 |
+
"""Create a bipartite graph with a preferential attachment model from
|
| 372 |
+
a given single degree sequence.
|
| 373 |
+
|
| 374 |
+
The graph is composed of two partitions. Set A has nodes 0 to
|
| 375 |
+
(len(aseq) - 1) and set B has nodes starting with node len(aseq).
|
| 376 |
+
The number of nodes in set B is random.
|
| 377 |
+
|
| 378 |
+
Parameters
|
| 379 |
+
----------
|
| 380 |
+
aseq : list
|
| 381 |
+
Degree sequence for node set A.
|
| 382 |
+
p : float
|
| 383 |
+
Probability that a new bottom node is added.
|
| 384 |
+
create_using : NetworkX graph instance, optional
|
| 385 |
+
Return graph of this type.
|
| 386 |
+
seed : integer, random_state, or None (default)
|
| 387 |
+
Indicator of random number generation state.
|
| 388 |
+
See :ref:`Randomness<randomness>`.
|
| 389 |
+
|
| 390 |
+
References
|
| 391 |
+
----------
|
| 392 |
+
.. [1] Guillaume, J.L. and Latapy, M.,
|
| 393 |
+
Bipartite graphs as models of complex networks.
|
| 394 |
+
Physica A: Statistical Mechanics and its Applications,
|
| 395 |
+
2006, 371(2), pp.795-813.
|
| 396 |
+
.. [2] Jean-Loup Guillaume and Matthieu Latapy,
|
| 397 |
+
Bipartite structure of all complex networks,
|
| 398 |
+
Inf. Process. Lett. 90, 2004, pg. 215-221
|
| 399 |
+
https://doi.org/10.1016/j.ipl.2004.03.007
|
| 400 |
+
|
| 401 |
+
Notes
|
| 402 |
+
-----
|
| 403 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 404 |
+
to indicate which bipartite set the node belongs to.
|
| 405 |
+
|
| 406 |
+
This function is not imported in the main namespace.
|
| 407 |
+
To use it use nx.bipartite.preferential_attachment_graph
|
| 408 |
+
"""
|
| 409 |
+
G = nx.empty_graph(0, create_using, default=nx.MultiGraph)
|
| 410 |
+
if G.is_directed():
|
| 411 |
+
raise nx.NetworkXError("Directed Graph not supported")
|
| 412 |
+
|
| 413 |
+
if p > 1:
|
| 414 |
+
raise nx.NetworkXError(f"probability {p} > 1")
|
| 415 |
+
|
| 416 |
+
naseq = len(aseq)
|
| 417 |
+
G = _add_nodes_with_bipartite_label(G, naseq, 0)
|
| 418 |
+
vv = [[v] * aseq[v] for v in range(naseq)]
|
| 419 |
+
while vv:
|
| 420 |
+
while vv[0]:
|
| 421 |
+
source = vv[0][0]
|
| 422 |
+
vv[0].remove(source)
|
| 423 |
+
if seed.random() < p or len(G) == naseq:
|
| 424 |
+
target = len(G)
|
| 425 |
+
G.add_node(target, bipartite=1)
|
| 426 |
+
G.add_edge(source, target)
|
| 427 |
+
else:
|
| 428 |
+
bb = [[b] * G.degree(b) for b in range(naseq, len(G))]
|
| 429 |
+
# flatten the list of lists into a list.
|
| 430 |
+
bbstubs = reduce(lambda x, y: x + y, bb)
|
| 431 |
+
# choose preferentially a bottom node.
|
| 432 |
+
target = seed.choice(bbstubs)
|
| 433 |
+
G.add_node(target, bipartite=1)
|
| 434 |
+
G.add_edge(source, target)
|
| 435 |
+
vv.remove(vv[0])
|
| 436 |
+
G.name = "bipartite_preferential_attachment_model"
|
| 437 |
+
return G
|
| 438 |
+
|
| 439 |
+
|
| 440 |
+
@py_random_state(3)
|
| 441 |
+
@nx._dispatch(graphs=None)
|
| 442 |
+
def random_graph(n, m, p, seed=None, directed=False):
|
| 443 |
+
"""Returns a bipartite random graph.
|
| 444 |
+
|
| 445 |
+
This is a bipartite version of the binomial (Erdős-Rényi) graph.
|
| 446 |
+
The graph is composed of two partitions. Set A has nodes 0 to
|
| 447 |
+
(n - 1) and set B has nodes n to (n + m - 1).
|
| 448 |
+
|
| 449 |
+
Parameters
|
| 450 |
+
----------
|
| 451 |
+
n : int
|
| 452 |
+
The number of nodes in the first bipartite set.
|
| 453 |
+
m : int
|
| 454 |
+
The number of nodes in the second bipartite set.
|
| 455 |
+
p : float
|
| 456 |
+
Probability for edge creation.
|
| 457 |
+
seed : integer, random_state, or None (default)
|
| 458 |
+
Indicator of random number generation state.
|
| 459 |
+
See :ref:`Randomness<randomness>`.
|
| 460 |
+
directed : bool, optional (default=False)
|
| 461 |
+
If True return a directed graph
|
| 462 |
+
|
| 463 |
+
Notes
|
| 464 |
+
-----
|
| 465 |
+
The bipartite random graph algorithm chooses each of the n*m (undirected)
|
| 466 |
+
or 2*nm (directed) possible edges with probability p.
|
| 467 |
+
|
| 468 |
+
This algorithm is $O(n+m)$ where $m$ is the expected number of edges.
|
| 469 |
+
|
| 470 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 471 |
+
to indicate which bipartite set the node belongs to.
|
| 472 |
+
|
| 473 |
+
This function is not imported in the main namespace.
|
| 474 |
+
To use it use nx.bipartite.random_graph
|
| 475 |
+
|
| 476 |
+
See Also
|
| 477 |
+
--------
|
| 478 |
+
gnp_random_graph, configuration_model
|
| 479 |
+
|
| 480 |
+
References
|
| 481 |
+
----------
|
| 482 |
+
.. [1] Vladimir Batagelj and Ulrik Brandes,
|
| 483 |
+
"Efficient generation of large random networks",
|
| 484 |
+
Phys. Rev. E, 71, 036113, 2005.
|
| 485 |
+
"""
|
| 486 |
+
G = nx.Graph()
|
| 487 |
+
G = _add_nodes_with_bipartite_label(G, n, m)
|
| 488 |
+
if directed:
|
| 489 |
+
G = nx.DiGraph(G)
|
| 490 |
+
G.name = f"fast_gnp_random_graph({n},{m},{p})"
|
| 491 |
+
|
| 492 |
+
if p <= 0:
|
| 493 |
+
return G
|
| 494 |
+
if p >= 1:
|
| 495 |
+
return nx.complete_bipartite_graph(n, m)
|
| 496 |
+
|
| 497 |
+
lp = math.log(1.0 - p)
|
| 498 |
+
|
| 499 |
+
v = 0
|
| 500 |
+
w = -1
|
| 501 |
+
while v < n:
|
| 502 |
+
lr = math.log(1.0 - seed.random())
|
| 503 |
+
w = w + 1 + int(lr / lp)
|
| 504 |
+
while w >= m and v < n:
|
| 505 |
+
w = w - m
|
| 506 |
+
v = v + 1
|
| 507 |
+
if v < n:
|
| 508 |
+
G.add_edge(v, n + w)
|
| 509 |
+
|
| 510 |
+
if directed:
|
| 511 |
+
# use the same algorithm to
|
| 512 |
+
# add edges from the "m" to "n" set
|
| 513 |
+
v = 0
|
| 514 |
+
w = -1
|
| 515 |
+
while v < n:
|
| 516 |
+
lr = math.log(1.0 - seed.random())
|
| 517 |
+
w = w + 1 + int(lr / lp)
|
| 518 |
+
while w >= m and v < n:
|
| 519 |
+
w = w - m
|
| 520 |
+
v = v + 1
|
| 521 |
+
if v < n:
|
| 522 |
+
G.add_edge(n + w, v)
|
| 523 |
+
|
| 524 |
+
return G
|
| 525 |
+
|
| 526 |
+
|
| 527 |
+
@py_random_state(3)
|
| 528 |
+
@nx._dispatch(graphs=None)
|
| 529 |
+
def gnmk_random_graph(n, m, k, seed=None, directed=False):
|
| 530 |
+
"""Returns a random bipartite graph G_{n,m,k}.
|
| 531 |
+
|
| 532 |
+
Produces a bipartite graph chosen randomly out of the set of all graphs
|
| 533 |
+
with n top nodes, m bottom nodes, and k edges.
|
| 534 |
+
The graph is composed of two sets of nodes.
|
| 535 |
+
Set A has nodes 0 to (n - 1) and set B has nodes n to (n + m - 1).
|
| 536 |
+
|
| 537 |
+
Parameters
|
| 538 |
+
----------
|
| 539 |
+
n : int
|
| 540 |
+
The number of nodes in the first bipartite set.
|
| 541 |
+
m : int
|
| 542 |
+
The number of nodes in the second bipartite set.
|
| 543 |
+
k : int
|
| 544 |
+
The number of edges
|
| 545 |
+
seed : integer, random_state, or None (default)
|
| 546 |
+
Indicator of random number generation state.
|
| 547 |
+
See :ref:`Randomness<randomness>`.
|
| 548 |
+
directed : bool, optional (default=False)
|
| 549 |
+
If True return a directed graph
|
| 550 |
+
|
| 551 |
+
Examples
|
| 552 |
+
--------
|
| 553 |
+
from nx.algorithms import bipartite
|
| 554 |
+
G = bipartite.gnmk_random_graph(10,20,50)
|
| 555 |
+
|
| 556 |
+
See Also
|
| 557 |
+
--------
|
| 558 |
+
gnm_random_graph
|
| 559 |
+
|
| 560 |
+
Notes
|
| 561 |
+
-----
|
| 562 |
+
If k > m * n then a complete bipartite graph is returned.
|
| 563 |
+
|
| 564 |
+
This graph is a bipartite version of the `G_{nm}` random graph model.
|
| 565 |
+
|
| 566 |
+
The nodes are assigned the attribute 'bipartite' with the value 0 or 1
|
| 567 |
+
to indicate which bipartite set the node belongs to.
|
| 568 |
+
|
| 569 |
+
This function is not imported in the main namespace.
|
| 570 |
+
To use it use nx.bipartite.gnmk_random_graph
|
| 571 |
+
"""
|
| 572 |
+
G = nx.Graph()
|
| 573 |
+
G = _add_nodes_with_bipartite_label(G, n, m)
|
| 574 |
+
if directed:
|
| 575 |
+
G = nx.DiGraph(G)
|
| 576 |
+
G.name = f"bipartite_gnm_random_graph({n},{m},{k})"
|
| 577 |
+
if n == 1 or m == 1:
|
| 578 |
+
return G
|
| 579 |
+
max_edges = n * m # max_edges for bipartite networks
|
| 580 |
+
if k >= max_edges: # Maybe we should raise an exception here
|
| 581 |
+
return nx.complete_bipartite_graph(n, m, create_using=G)
|
| 582 |
+
|
| 583 |
+
top = [n for n, d in G.nodes(data=True) if d["bipartite"] == 0]
|
| 584 |
+
bottom = list(set(G) - set(top))
|
| 585 |
+
edge_count = 0
|
| 586 |
+
while edge_count < k:
|
| 587 |
+
# generate random edge,u,v
|
| 588 |
+
u = seed.choice(top)
|
| 589 |
+
v = seed.choice(bottom)
|
| 590 |
+
if v in G[u]:
|
| 591 |
+
continue
|
| 592 |
+
else:
|
| 593 |
+
G.add_edge(u, v)
|
| 594 |
+
edge_count += 1
|
| 595 |
+
return G
|
| 596 |
+
|
| 597 |
+
|
| 598 |
+
def _add_nodes_with_bipartite_label(G, lena, lenb):
|
| 599 |
+
G.add_nodes_from(range(lena + lenb))
|
| 600 |
+
b = dict(zip(range(lena), [0] * lena))
|
| 601 |
+
b.update(dict(zip(range(lena, lena + lenb), [1] * lenb)))
|
| 602 |
+
nx.set_node_attributes(G, b, "bipartite")
|
| 603 |
+
return G
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/matrix.py
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
====================
|
| 3 |
+
Biadjacency matrices
|
| 4 |
+
====================
|
| 5 |
+
"""
|
| 6 |
+
import itertools
|
| 7 |
+
|
| 8 |
+
import networkx as nx
|
| 9 |
+
from networkx.convert_matrix import _generate_weighted_edges
|
| 10 |
+
|
| 11 |
+
__all__ = ["biadjacency_matrix", "from_biadjacency_matrix"]
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@nx._dispatch(edge_attrs="weight")
|
| 15 |
+
def biadjacency_matrix(
|
| 16 |
+
G, row_order, column_order=None, dtype=None, weight="weight", format="csr"
|
| 17 |
+
):
|
| 18 |
+
r"""Returns the biadjacency matrix of the bipartite graph G.
|
| 19 |
+
|
| 20 |
+
Let `G = (U, V, E)` be a bipartite graph with node sets
|
| 21 |
+
`U = u_{1},...,u_{r}` and `V = v_{1},...,v_{s}`. The biadjacency
|
| 22 |
+
matrix [1]_ is the `r` x `s` matrix `B` in which `b_{i,j} = 1`
|
| 23 |
+
if, and only if, `(u_i, v_j) \in E`. If the parameter `weight` is
|
| 24 |
+
not `None` and matches the name of an edge attribute, its value is
|
| 25 |
+
used instead of 1.
|
| 26 |
+
|
| 27 |
+
Parameters
|
| 28 |
+
----------
|
| 29 |
+
G : graph
|
| 30 |
+
A NetworkX graph
|
| 31 |
+
|
| 32 |
+
row_order : list of nodes
|
| 33 |
+
The rows of the matrix are ordered according to the list of nodes.
|
| 34 |
+
|
| 35 |
+
column_order : list, optional
|
| 36 |
+
The columns of the matrix are ordered according to the list of nodes.
|
| 37 |
+
If column_order is None, then the ordering of columns is arbitrary.
|
| 38 |
+
|
| 39 |
+
dtype : NumPy data-type, optional
|
| 40 |
+
A valid NumPy dtype used to initialize the array. If None, then the
|
| 41 |
+
NumPy default is used.
|
| 42 |
+
|
| 43 |
+
weight : string or None, optional (default='weight')
|
| 44 |
+
The edge data key used to provide each value in the matrix.
|
| 45 |
+
If None, then each edge has weight 1.
|
| 46 |
+
|
| 47 |
+
format : str in {'bsr', 'csr', 'csc', 'coo', 'lil', 'dia', 'dok'}
|
| 48 |
+
The type of the matrix to be returned (default 'csr'). For
|
| 49 |
+
some algorithms different implementations of sparse matrices
|
| 50 |
+
can perform better. See [2]_ for details.
|
| 51 |
+
|
| 52 |
+
Returns
|
| 53 |
+
-------
|
| 54 |
+
M : SciPy sparse array
|
| 55 |
+
Biadjacency matrix representation of the bipartite graph G.
|
| 56 |
+
|
| 57 |
+
Notes
|
| 58 |
+
-----
|
| 59 |
+
No attempt is made to check that the input graph is bipartite.
|
| 60 |
+
|
| 61 |
+
For directed bipartite graphs only successors are considered as neighbors.
|
| 62 |
+
To obtain an adjacency matrix with ones (or weight values) for both
|
| 63 |
+
predecessors and successors you have to generate two biadjacency matrices
|
| 64 |
+
where the rows of one of them are the columns of the other, and then add
|
| 65 |
+
one to the transpose of the other.
|
| 66 |
+
|
| 67 |
+
See Also
|
| 68 |
+
--------
|
| 69 |
+
adjacency_matrix
|
| 70 |
+
from_biadjacency_matrix
|
| 71 |
+
|
| 72 |
+
References
|
| 73 |
+
----------
|
| 74 |
+
.. [1] https://en.wikipedia.org/wiki/Adjacency_matrix#Adjacency_matrix_of_a_bipartite_graph
|
| 75 |
+
.. [2] Scipy Dev. References, "Sparse Matrices",
|
| 76 |
+
https://docs.scipy.org/doc/scipy/reference/sparse.html
|
| 77 |
+
"""
|
| 78 |
+
import scipy as sp
|
| 79 |
+
|
| 80 |
+
nlen = len(row_order)
|
| 81 |
+
if nlen == 0:
|
| 82 |
+
raise nx.NetworkXError("row_order is empty list")
|
| 83 |
+
if len(row_order) != len(set(row_order)):
|
| 84 |
+
msg = "Ambiguous ordering: `row_order` contained duplicates."
|
| 85 |
+
raise nx.NetworkXError(msg)
|
| 86 |
+
if column_order is None:
|
| 87 |
+
column_order = list(set(G) - set(row_order))
|
| 88 |
+
mlen = len(column_order)
|
| 89 |
+
if len(column_order) != len(set(column_order)):
|
| 90 |
+
msg = "Ambiguous ordering: `column_order` contained duplicates."
|
| 91 |
+
raise nx.NetworkXError(msg)
|
| 92 |
+
|
| 93 |
+
row_index = dict(zip(row_order, itertools.count()))
|
| 94 |
+
col_index = dict(zip(column_order, itertools.count()))
|
| 95 |
+
|
| 96 |
+
if G.number_of_edges() == 0:
|
| 97 |
+
row, col, data = [], [], []
|
| 98 |
+
else:
|
| 99 |
+
row, col, data = zip(
|
| 100 |
+
*(
|
| 101 |
+
(row_index[u], col_index[v], d.get(weight, 1))
|
| 102 |
+
for u, v, d in G.edges(row_order, data=True)
|
| 103 |
+
if u in row_index and v in col_index
|
| 104 |
+
)
|
| 105 |
+
)
|
| 106 |
+
A = sp.sparse.coo_array((data, (row, col)), shape=(nlen, mlen), dtype=dtype)
|
| 107 |
+
try:
|
| 108 |
+
return A.asformat(format)
|
| 109 |
+
except ValueError as err:
|
| 110 |
+
raise nx.NetworkXError(f"Unknown sparse array format: {format}") from err
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
@nx._dispatch(graphs=None)
|
| 114 |
+
def from_biadjacency_matrix(A, create_using=None, edge_attribute="weight"):
|
| 115 |
+
r"""Creates a new bipartite graph from a biadjacency matrix given as a
|
| 116 |
+
SciPy sparse array.
|
| 117 |
+
|
| 118 |
+
Parameters
|
| 119 |
+
----------
|
| 120 |
+
A: scipy sparse array
|
| 121 |
+
A biadjacency matrix representation of a graph
|
| 122 |
+
|
| 123 |
+
create_using: NetworkX graph
|
| 124 |
+
Use specified graph for result. The default is Graph()
|
| 125 |
+
|
| 126 |
+
edge_attribute: string
|
| 127 |
+
Name of edge attribute to store matrix numeric value. The data will
|
| 128 |
+
have the same type as the matrix entry (int, float, (real,imag)).
|
| 129 |
+
|
| 130 |
+
Notes
|
| 131 |
+
-----
|
| 132 |
+
The nodes are labeled with the attribute `bipartite` set to an integer
|
| 133 |
+
0 or 1 representing membership in part 0 or part 1 of the bipartite graph.
|
| 134 |
+
|
| 135 |
+
If `create_using` is an instance of :class:`networkx.MultiGraph` or
|
| 136 |
+
:class:`networkx.MultiDiGraph` and the entries of `A` are of
|
| 137 |
+
type :class:`int`, then this function returns a multigraph (of the same
|
| 138 |
+
type as `create_using`) with parallel edges. In this case, `edge_attribute`
|
| 139 |
+
will be ignored.
|
| 140 |
+
|
| 141 |
+
See Also
|
| 142 |
+
--------
|
| 143 |
+
biadjacency_matrix
|
| 144 |
+
from_numpy_array
|
| 145 |
+
|
| 146 |
+
References
|
| 147 |
+
----------
|
| 148 |
+
[1] https://en.wikipedia.org/wiki/Adjacency_matrix#Adjacency_matrix_of_a_bipartite_graph
|
| 149 |
+
"""
|
| 150 |
+
G = nx.empty_graph(0, create_using)
|
| 151 |
+
n, m = A.shape
|
| 152 |
+
# Make sure we get even the isolated nodes of the graph.
|
| 153 |
+
G.add_nodes_from(range(n), bipartite=0)
|
| 154 |
+
G.add_nodes_from(range(n, n + m), bipartite=1)
|
| 155 |
+
# Create an iterable over (u, v, w) triples and for each triple, add an
|
| 156 |
+
# edge from u to v with weight w.
|
| 157 |
+
triples = ((u, n + v, d) for (u, v, d) in _generate_weighted_edges(A))
|
| 158 |
+
# If the entries in the adjacency matrix are integers and the graph is a
|
| 159 |
+
# multigraph, then create parallel edges, each with weight 1, for each
|
| 160 |
+
# entry in the adjacency matrix. Otherwise, create one edge for each
|
| 161 |
+
# positive entry in the adjacency matrix and set the weight of that edge to
|
| 162 |
+
# be the entry in the matrix.
|
| 163 |
+
if A.dtype.kind in ("i", "u") and G.is_multigraph():
|
| 164 |
+
chain = itertools.chain.from_iterable
|
| 165 |
+
triples = chain(((u, v, 1) for d in range(w)) for (u, v, w) in triples)
|
| 166 |
+
G.add_weighted_edges_from(triples, weight=edge_attribute)
|
| 167 |
+
return G
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/flow/tests/gw1.gpickle.bz2
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f79f0e90fa4c51ec79165f15963e1ed89477576e06bcaa67ae622c260411931
|
| 3 |
+
size 42248
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/traversal/tests/__pycache__/test_bfs.cpython-311.pyc
ADDED
|
Binary file (15.3 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/algorithms/traversal/tests/test_edgebfs.py
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
|
| 3 |
+
import networkx as nx
|
| 4 |
+
from networkx.algorithms.traversal.edgedfs import FORWARD, REVERSE
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class TestEdgeBFS:
|
| 8 |
+
@classmethod
|
| 9 |
+
def setup_class(cls):
|
| 10 |
+
cls.nodes = [0, 1, 2, 3]
|
| 11 |
+
cls.edges = [(0, 1), (1, 0), (1, 0), (2, 0), (2, 1), (3, 1)]
|
| 12 |
+
|
| 13 |
+
def test_empty(self):
|
| 14 |
+
G = nx.Graph()
|
| 15 |
+
edges = list(nx.edge_bfs(G))
|
| 16 |
+
assert edges == []
|
| 17 |
+
|
| 18 |
+
def test_graph_single_source(self):
|
| 19 |
+
G = nx.Graph(self.edges)
|
| 20 |
+
G.add_edge(4, 5)
|
| 21 |
+
x = list(nx.edge_bfs(G, [0]))
|
| 22 |
+
x_ = [(0, 1), (0, 2), (1, 2), (1, 3)]
|
| 23 |
+
assert x == x_
|
| 24 |
+
|
| 25 |
+
def test_graph(self):
|
| 26 |
+
G = nx.Graph(self.edges)
|
| 27 |
+
x = list(nx.edge_bfs(G, self.nodes))
|
| 28 |
+
x_ = [(0, 1), (0, 2), (1, 2), (1, 3)]
|
| 29 |
+
assert x == x_
|
| 30 |
+
|
| 31 |
+
def test_digraph(self):
|
| 32 |
+
G = nx.DiGraph(self.edges)
|
| 33 |
+
x = list(nx.edge_bfs(G, self.nodes))
|
| 34 |
+
x_ = [(0, 1), (1, 0), (2, 0), (2, 1), (3, 1)]
|
| 35 |
+
assert x == x_
|
| 36 |
+
|
| 37 |
+
def test_digraph_orientation_invalid(self):
|
| 38 |
+
G = nx.DiGraph(self.edges)
|
| 39 |
+
edge_iterator = nx.edge_bfs(G, self.nodes, orientation="hello")
|
| 40 |
+
pytest.raises(nx.NetworkXError, list, edge_iterator)
|
| 41 |
+
|
| 42 |
+
def test_digraph_orientation_none(self):
|
| 43 |
+
G = nx.DiGraph(self.edges)
|
| 44 |
+
x = list(nx.edge_bfs(G, self.nodes, orientation=None))
|
| 45 |
+
x_ = [(0, 1), (1, 0), (2, 0), (2, 1), (3, 1)]
|
| 46 |
+
assert x == x_
|
| 47 |
+
|
| 48 |
+
def test_digraph_orientation_original(self):
|
| 49 |
+
G = nx.DiGraph(self.edges)
|
| 50 |
+
x = list(nx.edge_bfs(G, self.nodes, orientation="original"))
|
| 51 |
+
x_ = [
|
| 52 |
+
(0, 1, FORWARD),
|
| 53 |
+
(1, 0, FORWARD),
|
| 54 |
+
(2, 0, FORWARD),
|
| 55 |
+
(2, 1, FORWARD),
|
| 56 |
+
(3, 1, FORWARD),
|
| 57 |
+
]
|
| 58 |
+
assert x == x_
|
| 59 |
+
|
| 60 |
+
def test_digraph2(self):
|
| 61 |
+
G = nx.DiGraph()
|
| 62 |
+
nx.add_path(G, range(4))
|
| 63 |
+
x = list(nx.edge_bfs(G, [0]))
|
| 64 |
+
x_ = [(0, 1), (1, 2), (2, 3)]
|
| 65 |
+
assert x == x_
|
| 66 |
+
|
| 67 |
+
def test_digraph_rev(self):
|
| 68 |
+
G = nx.DiGraph(self.edges)
|
| 69 |
+
x = list(nx.edge_bfs(G, self.nodes, orientation="reverse"))
|
| 70 |
+
x_ = [
|
| 71 |
+
(1, 0, REVERSE),
|
| 72 |
+
(2, 0, REVERSE),
|
| 73 |
+
(0, 1, REVERSE),
|
| 74 |
+
(2, 1, REVERSE),
|
| 75 |
+
(3, 1, REVERSE),
|
| 76 |
+
]
|
| 77 |
+
assert x == x_
|
| 78 |
+
|
| 79 |
+
def test_digraph_rev2(self):
|
| 80 |
+
G = nx.DiGraph()
|
| 81 |
+
nx.add_path(G, range(4))
|
| 82 |
+
x = list(nx.edge_bfs(G, [3], orientation="reverse"))
|
| 83 |
+
x_ = [(2, 3, REVERSE), (1, 2, REVERSE), (0, 1, REVERSE)]
|
| 84 |
+
assert x == x_
|
| 85 |
+
|
| 86 |
+
def test_multigraph(self):
|
| 87 |
+
G = nx.MultiGraph(self.edges)
|
| 88 |
+
x = list(nx.edge_bfs(G, self.nodes))
|
| 89 |
+
x_ = [(0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (1, 2, 0), (1, 3, 0)]
|
| 90 |
+
# This is an example of where hash randomization can break.
|
| 91 |
+
# There are 3! * 2 alternative outputs, such as:
|
| 92 |
+
# [(0, 1, 1), (1, 0, 0), (0, 1, 2), (1, 3, 0), (1, 2, 0)]
|
| 93 |
+
# But note, the edges (1,2,0) and (1,3,0) always follow the (0,1,k)
|
| 94 |
+
# edges. So the algorithm only guarantees a partial order. A total
|
| 95 |
+
# order is guaranteed only if the graph data structures are ordered.
|
| 96 |
+
assert x == x_
|
| 97 |
+
|
| 98 |
+
def test_multidigraph(self):
|
| 99 |
+
G = nx.MultiDiGraph(self.edges)
|
| 100 |
+
x = list(nx.edge_bfs(G, self.nodes))
|
| 101 |
+
x_ = [(0, 1, 0), (1, 0, 0), (1, 0, 1), (2, 0, 0), (2, 1, 0), (3, 1, 0)]
|
| 102 |
+
assert x == x_
|
| 103 |
+
|
| 104 |
+
def test_multidigraph_rev(self):
|
| 105 |
+
G = nx.MultiDiGraph(self.edges)
|
| 106 |
+
x = list(nx.edge_bfs(G, self.nodes, orientation="reverse"))
|
| 107 |
+
x_ = [
|
| 108 |
+
(1, 0, 0, REVERSE),
|
| 109 |
+
(1, 0, 1, REVERSE),
|
| 110 |
+
(2, 0, 0, REVERSE),
|
| 111 |
+
(0, 1, 0, REVERSE),
|
| 112 |
+
(2, 1, 0, REVERSE),
|
| 113 |
+
(3, 1, 0, REVERSE),
|
| 114 |
+
]
|
| 115 |
+
assert x == x_
|
| 116 |
+
|
| 117 |
+
def test_digraph_ignore(self):
|
| 118 |
+
G = nx.DiGraph(self.edges)
|
| 119 |
+
x = list(nx.edge_bfs(G, self.nodes, orientation="ignore"))
|
| 120 |
+
x_ = [
|
| 121 |
+
(0, 1, FORWARD),
|
| 122 |
+
(1, 0, REVERSE),
|
| 123 |
+
(2, 0, REVERSE),
|
| 124 |
+
(2, 1, REVERSE),
|
| 125 |
+
(3, 1, REVERSE),
|
| 126 |
+
]
|
| 127 |
+
assert x == x_
|
| 128 |
+
|
| 129 |
+
def test_digraph_ignore2(self):
|
| 130 |
+
G = nx.DiGraph()
|
| 131 |
+
nx.add_path(G, range(4))
|
| 132 |
+
x = list(nx.edge_bfs(G, [0], orientation="ignore"))
|
| 133 |
+
x_ = [(0, 1, FORWARD), (1, 2, FORWARD), (2, 3, FORWARD)]
|
| 134 |
+
assert x == x_
|
| 135 |
+
|
| 136 |
+
def test_multidigraph_ignore(self):
|
| 137 |
+
G = nx.MultiDiGraph(self.edges)
|
| 138 |
+
x = list(nx.edge_bfs(G, self.nodes, orientation="ignore"))
|
| 139 |
+
x_ = [
|
| 140 |
+
(0, 1, 0, FORWARD),
|
| 141 |
+
(1, 0, 0, REVERSE),
|
| 142 |
+
(1, 0, 1, REVERSE),
|
| 143 |
+
(2, 0, 0, REVERSE),
|
| 144 |
+
(2, 1, 0, REVERSE),
|
| 145 |
+
(3, 1, 0, REVERSE),
|
| 146 |
+
]
|
| 147 |
+
assert x == x_
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (1.76 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/__pycache__/atlas.cpython-311.pyc
ADDED
|
Binary file (6.12 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/__pycache__/nonisomorphic_trees.cpython-311.pyc
ADDED
|
Binary file (7.73 kB). View file
|
|
|
tuning-competition-baseline/.venv/lib/python3.11/site-packages/networkx/generators/tests/test_community.py
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
|
| 3 |
+
import networkx as nx
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def test_random_partition_graph():
|
| 7 |
+
G = nx.random_partition_graph([3, 3, 3], 1, 0, seed=42)
|
| 8 |
+
C = G.graph["partition"]
|
| 9 |
+
assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
|
| 10 |
+
assert len(G) == 9
|
| 11 |
+
assert len(list(G.edges())) == 9
|
| 12 |
+
|
| 13 |
+
G = nx.random_partition_graph([3, 3, 3], 0, 1)
|
| 14 |
+
C = G.graph["partition"]
|
| 15 |
+
assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
|
| 16 |
+
assert len(G) == 9
|
| 17 |
+
assert len(list(G.edges())) == 27
|
| 18 |
+
|
| 19 |
+
G = nx.random_partition_graph([3, 3, 3], 1, 0, directed=True)
|
| 20 |
+
C = G.graph["partition"]
|
| 21 |
+
assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
|
| 22 |
+
assert len(G) == 9
|
| 23 |
+
assert len(list(G.edges())) == 18
|
| 24 |
+
|
| 25 |
+
G = nx.random_partition_graph([3, 3, 3], 0, 1, directed=True)
|
| 26 |
+
C = G.graph["partition"]
|
| 27 |
+
assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
|
| 28 |
+
assert len(G) == 9
|
| 29 |
+
assert len(list(G.edges())) == 54
|
| 30 |
+
|
| 31 |
+
G = nx.random_partition_graph([1, 2, 3, 4, 5], 0.5, 0.1)
|
| 32 |
+
C = G.graph["partition"]
|
| 33 |
+
assert C == [{0}, {1, 2}, {3, 4, 5}, {6, 7, 8, 9}, {10, 11, 12, 13, 14}]
|
| 34 |
+
assert len(G) == 15
|
| 35 |
+
|
| 36 |
+
rpg = nx.random_partition_graph
|
| 37 |
+
pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], 1.1, 0.1)
|
| 38 |
+
pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], -0.1, 0.1)
|
| 39 |
+
pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], 0.1, 1.1)
|
| 40 |
+
pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], 0.1, -0.1)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def test_planted_partition_graph():
|
| 44 |
+
G = nx.planted_partition_graph(4, 3, 1, 0, seed=42)
|
| 45 |
+
C = G.graph["partition"]
|
| 46 |
+
assert len(C) == 4
|
| 47 |
+
assert len(G) == 12
|
| 48 |
+
assert len(list(G.edges())) == 12
|
| 49 |
+
|
| 50 |
+
G = nx.planted_partition_graph(4, 3, 0, 1)
|
| 51 |
+
C = G.graph["partition"]
|
| 52 |
+
assert len(C) == 4
|
| 53 |
+
assert len(G) == 12
|
| 54 |
+
assert len(list(G.edges())) == 54
|
| 55 |
+
|
| 56 |
+
G = nx.planted_partition_graph(10, 4, 0.5, 0.1, seed=42)
|
| 57 |
+
C = G.graph["partition"]
|
| 58 |
+
assert len(C) == 10
|
| 59 |
+
assert len(G) == 40
|
| 60 |
+
|
| 61 |
+
G = nx.planted_partition_graph(4, 3, 1, 0, directed=True)
|
| 62 |
+
C = G.graph["partition"]
|
| 63 |
+
assert len(C) == 4
|
| 64 |
+
assert len(G) == 12
|
| 65 |
+
assert len(list(G.edges())) == 24
|
| 66 |
+
|
| 67 |
+
G = nx.planted_partition_graph(4, 3, 0, 1, directed=True)
|
| 68 |
+
C = G.graph["partition"]
|
| 69 |
+
assert len(C) == 4
|
| 70 |
+
assert len(G) == 12
|
| 71 |
+
assert len(list(G.edges())) == 108
|
| 72 |
+
|
| 73 |
+
G = nx.planted_partition_graph(10, 4, 0.5, 0.1, seed=42, directed=True)
|
| 74 |
+
C = G.graph["partition"]
|
| 75 |
+
assert len(C) == 10
|
| 76 |
+
assert len(G) == 40
|
| 77 |
+
|
| 78 |
+
ppg = nx.planted_partition_graph
|
| 79 |
+
pytest.raises(nx.NetworkXError, ppg, 3, 3, 1.1, 0.1)
|
| 80 |
+
pytest.raises(nx.NetworkXError, ppg, 3, 3, -0.1, 0.1)
|
| 81 |
+
pytest.raises(nx.NetworkXError, ppg, 3, 3, 0.1, 1.1)
|
| 82 |
+
pytest.raises(nx.NetworkXError, ppg, 3, 3, 0.1, -0.1)
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
def test_relaxed_caveman_graph():
|
| 86 |
+
G = nx.relaxed_caveman_graph(4, 3, 0)
|
| 87 |
+
assert len(G) == 12
|
| 88 |
+
G = nx.relaxed_caveman_graph(4, 3, 1)
|
| 89 |
+
assert len(G) == 12
|
| 90 |
+
G = nx.relaxed_caveman_graph(4, 3, 0.5)
|
| 91 |
+
assert len(G) == 12
|
| 92 |
+
G = nx.relaxed_caveman_graph(4, 3, 0.5, seed=42)
|
| 93 |
+
assert len(G) == 12
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def test_connected_caveman_graph():
|
| 97 |
+
G = nx.connected_caveman_graph(4, 3)
|
| 98 |
+
assert len(G) == 12
|
| 99 |
+
|
| 100 |
+
G = nx.connected_caveman_graph(1, 5)
|
| 101 |
+
K5 = nx.complete_graph(5)
|
| 102 |
+
K5.remove_edge(3, 4)
|
| 103 |
+
assert nx.is_isomorphic(G, K5)
|
| 104 |
+
|
| 105 |
+
# need at least 2 nodes in each clique
|
| 106 |
+
pytest.raises(nx.NetworkXError, nx.connected_caveman_graph, 4, 1)
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def test_caveman_graph():
|
| 110 |
+
G = nx.caveman_graph(4, 3)
|
| 111 |
+
assert len(G) == 12
|
| 112 |
+
|
| 113 |
+
G = nx.caveman_graph(5, 1)
|
| 114 |
+
E5 = nx.empty_graph(5)
|
| 115 |
+
assert nx.is_isomorphic(G, E5)
|
| 116 |
+
|
| 117 |
+
G = nx.caveman_graph(1, 5)
|
| 118 |
+
K5 = nx.complete_graph(5)
|
| 119 |
+
assert nx.is_isomorphic(G, K5)
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def test_gaussian_random_partition_graph():
|
| 123 |
+
G = nx.gaussian_random_partition_graph(100, 10, 10, 0.3, 0.01)
|
| 124 |
+
assert len(G) == 100
|
| 125 |
+
G = nx.gaussian_random_partition_graph(100, 10, 10, 0.3, 0.01, directed=True)
|
| 126 |
+
assert len(G) == 100
|
| 127 |
+
G = nx.gaussian_random_partition_graph(
|
| 128 |
+
100, 10, 10, 0.3, 0.01, directed=False, seed=42
|
| 129 |
+
)
|
| 130 |
+
assert len(G) == 100
|
| 131 |
+
assert not isinstance(G, nx.DiGraph)
|
| 132 |
+
G = nx.gaussian_random_partition_graph(
|
| 133 |
+
100, 10, 10, 0.3, 0.01, directed=True, seed=42
|
| 134 |
+
)
|
| 135 |
+
assert len(G) == 100
|
| 136 |
+
assert isinstance(G, nx.DiGraph)
|
| 137 |
+
pytest.raises(
|
| 138 |
+
nx.NetworkXError, nx.gaussian_random_partition_graph, 100, 101, 10, 1, 0
|
| 139 |
+
)
|
| 140 |
+
# Test when clusters are likely less than 1
|
| 141 |
+
G = nx.gaussian_random_partition_graph(10, 0.5, 0.5, 0.5, 0.5, seed=1)
|
| 142 |
+
assert len(G) == 10
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def test_ring_of_cliques():
|
| 146 |
+
for i in range(2, 20, 3):
|
| 147 |
+
for j in range(2, 20, 3):
|
| 148 |
+
G = nx.ring_of_cliques(i, j)
|
| 149 |
+
assert G.number_of_nodes() == i * j
|
| 150 |
+
if i != 2 or j != 1:
|
| 151 |
+
expected_num_edges = i * (((j * (j - 1)) // 2) + 1)
|
| 152 |
+
else:
|
| 153 |
+
# the edge that already exists cannot be duplicated
|
| 154 |
+
expected_num_edges = i * (((j * (j - 1)) // 2) + 1) - 1
|
| 155 |
+
assert G.number_of_edges() == expected_num_edges
|
| 156 |
+
with pytest.raises(
|
| 157 |
+
nx.NetworkXError, match="A ring of cliques must have at least two cliques"
|
| 158 |
+
):
|
| 159 |
+
nx.ring_of_cliques(1, 5)
|
| 160 |
+
with pytest.raises(
|
| 161 |
+
nx.NetworkXError, match="The cliques must have at least two nodes"
|
| 162 |
+
):
|
| 163 |
+
nx.ring_of_cliques(3, 0)
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def test_windmill_graph():
|
| 167 |
+
for n in range(2, 20, 3):
|
| 168 |
+
for k in range(2, 20, 3):
|
| 169 |
+
G = nx.windmill_graph(n, k)
|
| 170 |
+
assert G.number_of_nodes() == (k - 1) * n + 1
|
| 171 |
+
assert G.number_of_edges() == n * k * (k - 1) / 2
|
| 172 |
+
assert G.degree(0) == G.number_of_nodes() - 1
|
| 173 |
+
for i in range(1, G.number_of_nodes()):
|
| 174 |
+
assert G.degree(i) == k - 1
|
| 175 |
+
with pytest.raises(
|
| 176 |
+
nx.NetworkXError, match="A windmill graph must have at least two cliques"
|
| 177 |
+
):
|
| 178 |
+
nx.windmill_graph(1, 3)
|
| 179 |
+
with pytest.raises(
|
| 180 |
+
nx.NetworkXError, match="The cliques must have at least two nodes"
|
| 181 |
+
):
|
| 182 |
+
nx.windmill_graph(3, 0)
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
def test_stochastic_block_model():
|
| 186 |
+
sizes = [75, 75, 300]
|
| 187 |
+
probs = [[0.25, 0.05, 0.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]]
|
| 188 |
+
G = nx.stochastic_block_model(sizes, probs, seed=0)
|
| 189 |
+
C = G.graph["partition"]
|
| 190 |
+
assert len(C) == 3
|
| 191 |
+
assert len(G) == 450
|
| 192 |
+
assert G.size() == 22160
|
| 193 |
+
|
| 194 |
+
GG = nx.stochastic_block_model(sizes, probs, range(450), seed=0)
|
| 195 |
+
assert G.nodes == GG.nodes
|
| 196 |
+
|
| 197 |
+
# Test Exceptions
|
| 198 |
+
sbm = nx.stochastic_block_model
|
| 199 |
+
badnodelist = list(range(400)) # not enough nodes to match sizes
|
| 200 |
+
badprobs1 = [[0.25, 0.05, 1.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]]
|
| 201 |
+
badprobs2 = [[0.25, 0.05, 0.02], [0.05, -0.35, 0.07], [0.02, 0.07, 0.40]]
|
| 202 |
+
probs_rect1 = [[0.25, 0.05, 0.02], [0.05, -0.35, 0.07]]
|
| 203 |
+
probs_rect2 = [[0.25, 0.05], [0.05, -0.35], [0.02, 0.07]]
|
| 204 |
+
asymprobs = [[0.25, 0.05, 0.01], [0.05, -0.35, 0.07], [0.02, 0.07, 0.40]]
|
| 205 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, badprobs1)
|
| 206 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, badprobs2)
|
| 207 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, probs_rect1, directed=True)
|
| 208 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, probs_rect2, directed=True)
|
| 209 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, asymprobs, directed=False)
|
| 210 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, probs, badnodelist)
|
| 211 |
+
nodelist = [0] + list(range(449)) # repeated node name in nodelist
|
| 212 |
+
pytest.raises(nx.NetworkXException, sbm, sizes, probs, nodelist)
|
| 213 |
+
|
| 214 |
+
# Extra keyword arguments test
|
| 215 |
+
GG = nx.stochastic_block_model(sizes, probs, seed=0, selfloops=True)
|
| 216 |
+
assert G.nodes == GG.nodes
|
| 217 |
+
GG = nx.stochastic_block_model(sizes, probs, selfloops=True, directed=True)
|
| 218 |
+
assert G.nodes == GG.nodes
|
| 219 |
+
GG = nx.stochastic_block_model(sizes, probs, seed=0, sparse=False)
|
| 220 |
+
assert G.nodes == GG.nodes
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
def test_generator():
|
| 224 |
+
n = 250
|
| 225 |
+
tau1 = 3
|
| 226 |
+
tau2 = 1.5
|
| 227 |
+
mu = 0.1
|
| 228 |
+
G = nx.LFR_benchmark_graph(
|
| 229 |
+
n, tau1, tau2, mu, average_degree=5, min_community=20, seed=10
|
| 230 |
+
)
|
| 231 |
+
assert len(G) == 250
|
| 232 |
+
C = {frozenset(G.nodes[v]["community"]) for v in G}
|
| 233 |
+
assert nx.community.is_partition(G.nodes(), C)
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
def test_invalid_tau1():
|
| 237 |
+
with pytest.raises(nx.NetworkXError, match="tau2 must be greater than one"):
|
| 238 |
+
n = 100
|
| 239 |
+
tau1 = 2
|
| 240 |
+
tau2 = 1
|
| 241 |
+
mu = 0.1
|
| 242 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def test_invalid_tau2():
|
| 246 |
+
with pytest.raises(nx.NetworkXError, match="tau1 must be greater than one"):
|
| 247 |
+
n = 100
|
| 248 |
+
tau1 = 1
|
| 249 |
+
tau2 = 2
|
| 250 |
+
mu = 0.1
|
| 251 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
def test_mu_too_large():
|
| 255 |
+
with pytest.raises(nx.NetworkXError, match="mu must be in the interval \\[0, 1\\]"):
|
| 256 |
+
n = 100
|
| 257 |
+
tau1 = 2
|
| 258 |
+
tau2 = 2
|
| 259 |
+
mu = 1.1
|
| 260 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
def test_mu_too_small():
|
| 264 |
+
with pytest.raises(nx.NetworkXError, match="mu must be in the interval \\[0, 1\\]"):
|
| 265 |
+
n = 100
|
| 266 |
+
tau1 = 2
|
| 267 |
+
tau2 = 2
|
| 268 |
+
mu = -1
|
| 269 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
def test_both_degrees_none():
|
| 273 |
+
with pytest.raises(
|
| 274 |
+
nx.NetworkXError,
|
| 275 |
+
match="Must assign exactly one of min_degree and average_degree",
|
| 276 |
+
):
|
| 277 |
+
n = 100
|
| 278 |
+
tau1 = 2
|
| 279 |
+
tau2 = 2
|
| 280 |
+
mu = 1
|
| 281 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu)
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
def test_neither_degrees_none():
|
| 285 |
+
with pytest.raises(
|
| 286 |
+
nx.NetworkXError,
|
| 287 |
+
match="Must assign exactly one of min_degree and average_degree",
|
| 288 |
+
):
|
| 289 |
+
n = 100
|
| 290 |
+
tau1 = 2
|
| 291 |
+
tau2 = 2
|
| 292 |
+
mu = 1
|
| 293 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2, average_degree=5)
|
| 294 |
+
|
| 295 |
+
|
| 296 |
+
def test_max_iters_exceeded():
|
| 297 |
+
with pytest.raises(
|
| 298 |
+
nx.ExceededMaxIterations,
|
| 299 |
+
match="Could not assign communities; try increasing min_community",
|
| 300 |
+
):
|
| 301 |
+
n = 10
|
| 302 |
+
tau1 = 2
|
| 303 |
+
tau2 = 2
|
| 304 |
+
mu = 0.1
|
| 305 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2, max_iters=10, seed=1)
|
| 306 |
+
|
| 307 |
+
|
| 308 |
+
def test_max_deg_out_of_range():
|
| 309 |
+
with pytest.raises(
|
| 310 |
+
nx.NetworkXError, match="max_degree must be in the interval \\(0, n\\]"
|
| 311 |
+
):
|
| 312 |
+
n = 10
|
| 313 |
+
tau1 = 2
|
| 314 |
+
tau2 = 2
|
| 315 |
+
mu = 0.1
|
| 316 |
+
nx.LFR_benchmark_graph(
|
| 317 |
+
n, tau1, tau2, mu, max_degree=n + 1, max_iters=10, seed=1
|
| 318 |
+
)
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
def test_max_community():
|
| 322 |
+
n = 250
|
| 323 |
+
tau1 = 3
|
| 324 |
+
tau2 = 1.5
|
| 325 |
+
mu = 0.1
|
| 326 |
+
G = nx.LFR_benchmark_graph(
|
| 327 |
+
n,
|
| 328 |
+
tau1,
|
| 329 |
+
tau2,
|
| 330 |
+
mu,
|
| 331 |
+
average_degree=5,
|
| 332 |
+
max_degree=100,
|
| 333 |
+
min_community=50,
|
| 334 |
+
max_community=200,
|
| 335 |
+
seed=10,
|
| 336 |
+
)
|
| 337 |
+
assert len(G) == 250
|
| 338 |
+
C = {frozenset(G.nodes[v]["community"]) for v in G}
|
| 339 |
+
assert nx.community.is_partition(G.nodes(), C)
|
| 340 |
+
|
| 341 |
+
|
| 342 |
+
def test_powerlaw_iterations_exceeded():
|
| 343 |
+
with pytest.raises(
|
| 344 |
+
nx.ExceededMaxIterations, match="Could not create power law sequence"
|
| 345 |
+
):
|
| 346 |
+
n = 100
|
| 347 |
+
tau1 = 2
|
| 348 |
+
tau2 = 2
|
| 349 |
+
mu = 1
|
| 350 |
+
nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2, max_iters=0)
|
| 351 |
+
|
| 352 |
+
|
| 353 |
+
def test_no_scipy_zeta():
|
| 354 |
+
zeta2 = 1.6449340668482264
|
| 355 |
+
assert abs(zeta2 - nx.generators.community._hurwitz_zeta(2, 1, 0.0001)) < 0.01
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
def test_generate_min_degree_itr():
|
| 359 |
+
with pytest.raises(
|
| 360 |
+
nx.ExceededMaxIterations, match="Could not match average_degree"
|
| 361 |
+
):
|
| 362 |
+
nx.generators.community._generate_min_degree(2, 2, 1, 0.01, 0)
|