Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +1 -0
- evalkit_tf437/lib/python3.10/site-packages/diffusers-0.27.2.dist-info/LICENSE +201 -0
- evalkit_tf437/lib/python3.10/site-packages/open_clip_torch-2.29.0.dist-info/INSTALLER +1 -0
- evalkit_tf437/lib/python3.10/site-packages/open_clip_torch-2.29.0.dist-info/REQUESTED +0 -0
- evalkit_tf449/lib/python3.10/site-packages/datasets/__pycache__/arrow_dataset.cpython-310.pyc +3 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_generic_alias.cpython-310.pyc +0 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/arithmetic.pyi +121 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_constructors.pyi +33 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_like.pyi +16 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_pad.pyi +6 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/arrayprint.pyi +14 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/arrayterator.pyi +14 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/bitwise_ops.pyi +20 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/char.pyi +66 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/chararray.pyi +62 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/comparisons.pyi +27 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/constants.pyi +7 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/datasource.pyi +15 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/dtype.pyi +20 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/einsumfunc.pyi +15 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/false_positives.pyi +11 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/flatiter.pyi +25 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/fromnumeric.pyi +161 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/histograms.pyi +12 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/index_tricks.pyi +14 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_function_base.pyi +53 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_polynomial.pyi +29 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_utils.pyi +13 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_version.pyi +6 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/linalg.pyi +48 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/memmap.pyi +5 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/modules.pyi +18 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/multiarray.pyi +55 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ndarray.pyi +11 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ndarray_misc.pyi +43 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/nditer.pyi +8 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/nested_sequence.pyi +17 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/npyio.pyi +30 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/numerictypes.pyi +13 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/random.pyi +61 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/rec.pyi +17 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/scalars.pyi +92 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/shape_base.pyi +8 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/stride_tricks.pyi +9 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/testing.pyi +28 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/twodim_base.pyi +37 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/type_check.pyi +13 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ufunc_config.pyi +21 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ufunclike.pyi +21 -0
- evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ufuncs.pyi +41 -0
.gitattributes
CHANGED
|
@@ -1236,3 +1236,4 @@ evalkit_cambrian/lib/python3.10/site-packages/scipy/integrate/_test_odeint_bande
|
|
| 1236 |
evalkit_cambrian/lib/python3.10/site-packages/scipy/sparse/csgraph/_flow.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1237 |
evalkit_tf449/lib/python3.10/site-packages/opencv_python.libs/libavformat-3ff1be5b.so.59.27.100 filter=lfs diff=lfs merge=lfs -text
|
| 1238 |
evalkit_tf449/lib/python3.10/site-packages/opencv_python.libs/libQt5Core-e6d3f451.so.5.15.13 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 1236 |
evalkit_cambrian/lib/python3.10/site-packages/scipy/sparse/csgraph/_flow.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 1237 |
evalkit_tf449/lib/python3.10/site-packages/opencv_python.libs/libavformat-3ff1be5b.so.59.27.100 filter=lfs diff=lfs merge=lfs -text
|
| 1238 |
evalkit_tf449/lib/python3.10/site-packages/opencv_python.libs/libQt5Core-e6d3f451.so.5.15.13 filter=lfs diff=lfs merge=lfs -text
|
| 1239 |
+
evalkit_tf449/lib/python3.10/site-packages/datasets/__pycache__/arrow_dataset.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
evalkit_tf437/lib/python3.10/site-packages/diffusers-0.27.2.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://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
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
evalkit_tf437/lib/python3.10/site-packages/open_clip_torch-2.29.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
evalkit_tf437/lib/python3.10/site-packages/open_clip_torch-2.29.0.dist-info/REQUESTED
ADDED
|
File without changes
|
evalkit_tf449/lib/python3.10/site-packages/datasets/__pycache__/arrow_dataset.cpython-310.pyc
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:439abf40c440f1befcdd9f9e2703d5b0bbdc6231b4121b3b503eff9af7305df3
|
| 3 |
+
size 232830
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_generic_alias.cpython-310.pyc
ADDED
|
Binary file (9.06 kB). View file
|
|
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/arithmetic.pyi
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
b_ = np.bool_()
|
| 5 |
+
dt = np.datetime64(0, "D")
|
| 6 |
+
td = np.timedelta64(0, "D")
|
| 7 |
+
|
| 8 |
+
AR_b: np.ndarray[Any, np.dtype[np.bool_]]
|
| 9 |
+
AR_u: np.ndarray[Any, np.dtype[np.uint32]]
|
| 10 |
+
AR_i: np.ndarray[Any, np.dtype[np.int64]]
|
| 11 |
+
AR_f: np.ndarray[Any, np.dtype[np.float64]]
|
| 12 |
+
AR_c: np.ndarray[Any, np.dtype[np.complex128]]
|
| 13 |
+
AR_m: np.ndarray[Any, np.dtype[np.timedelta64]]
|
| 14 |
+
AR_M: np.ndarray[Any, np.dtype[np.datetime64]]
|
| 15 |
+
|
| 16 |
+
ANY: Any
|
| 17 |
+
|
| 18 |
+
AR_LIKE_b: list[bool]
|
| 19 |
+
AR_LIKE_u: list[np.uint32]
|
| 20 |
+
AR_LIKE_i: list[int]
|
| 21 |
+
AR_LIKE_f: list[float]
|
| 22 |
+
AR_LIKE_c: list[complex]
|
| 23 |
+
AR_LIKE_m: list[np.timedelta64]
|
| 24 |
+
AR_LIKE_M: list[np.datetime64]
|
| 25 |
+
|
| 26 |
+
# Array subtraction
|
| 27 |
+
|
| 28 |
+
# NOTE: mypys `NoReturn` errors are, unfortunately, not that great
|
| 29 |
+
_1 = AR_b - AR_LIKE_b # E: Need type annotation
|
| 30 |
+
_2 = AR_LIKE_b - AR_b # E: Need type annotation
|
| 31 |
+
AR_i - bytes() # E: No overload variant
|
| 32 |
+
|
| 33 |
+
AR_f - AR_LIKE_m # E: Unsupported operand types
|
| 34 |
+
AR_f - AR_LIKE_M # E: Unsupported operand types
|
| 35 |
+
AR_c - AR_LIKE_m # E: Unsupported operand types
|
| 36 |
+
AR_c - AR_LIKE_M # E: Unsupported operand types
|
| 37 |
+
|
| 38 |
+
AR_m - AR_LIKE_f # E: Unsupported operand types
|
| 39 |
+
AR_M - AR_LIKE_f # E: Unsupported operand types
|
| 40 |
+
AR_m - AR_LIKE_c # E: Unsupported operand types
|
| 41 |
+
AR_M - AR_LIKE_c # E: Unsupported operand types
|
| 42 |
+
|
| 43 |
+
AR_m - AR_LIKE_M # E: Unsupported operand types
|
| 44 |
+
AR_LIKE_m - AR_M # E: Unsupported operand types
|
| 45 |
+
|
| 46 |
+
# array floor division
|
| 47 |
+
|
| 48 |
+
AR_M // AR_LIKE_b # E: Unsupported operand types
|
| 49 |
+
AR_M // AR_LIKE_u # E: Unsupported operand types
|
| 50 |
+
AR_M // AR_LIKE_i # E: Unsupported operand types
|
| 51 |
+
AR_M // AR_LIKE_f # E: Unsupported operand types
|
| 52 |
+
AR_M // AR_LIKE_c # E: Unsupported operand types
|
| 53 |
+
AR_M // AR_LIKE_m # E: Unsupported operand types
|
| 54 |
+
AR_M // AR_LIKE_M # E: Unsupported operand types
|
| 55 |
+
|
| 56 |
+
AR_b // AR_LIKE_M # E: Unsupported operand types
|
| 57 |
+
AR_u // AR_LIKE_M # E: Unsupported operand types
|
| 58 |
+
AR_i // AR_LIKE_M # E: Unsupported operand types
|
| 59 |
+
AR_f // AR_LIKE_M # E: Unsupported operand types
|
| 60 |
+
AR_c // AR_LIKE_M # E: Unsupported operand types
|
| 61 |
+
AR_m // AR_LIKE_M # E: Unsupported operand types
|
| 62 |
+
AR_M // AR_LIKE_M # E: Unsupported operand types
|
| 63 |
+
|
| 64 |
+
_3 = AR_m // AR_LIKE_b # E: Need type annotation
|
| 65 |
+
AR_m // AR_LIKE_c # E: Unsupported operand types
|
| 66 |
+
|
| 67 |
+
AR_b // AR_LIKE_m # E: Unsupported operand types
|
| 68 |
+
AR_u // AR_LIKE_m # E: Unsupported operand types
|
| 69 |
+
AR_i // AR_LIKE_m # E: Unsupported operand types
|
| 70 |
+
AR_f // AR_LIKE_m # E: Unsupported operand types
|
| 71 |
+
AR_c // AR_LIKE_m # E: Unsupported operand types
|
| 72 |
+
|
| 73 |
+
# Array multiplication
|
| 74 |
+
|
| 75 |
+
AR_b *= AR_LIKE_u # E: incompatible type
|
| 76 |
+
AR_b *= AR_LIKE_i # E: incompatible type
|
| 77 |
+
AR_b *= AR_LIKE_f # E: incompatible type
|
| 78 |
+
AR_b *= AR_LIKE_c # E: incompatible type
|
| 79 |
+
AR_b *= AR_LIKE_m # E: incompatible type
|
| 80 |
+
|
| 81 |
+
AR_u *= AR_LIKE_i # E: incompatible type
|
| 82 |
+
AR_u *= AR_LIKE_f # E: incompatible type
|
| 83 |
+
AR_u *= AR_LIKE_c # E: incompatible type
|
| 84 |
+
AR_u *= AR_LIKE_m # E: incompatible type
|
| 85 |
+
|
| 86 |
+
AR_i *= AR_LIKE_f # E: incompatible type
|
| 87 |
+
AR_i *= AR_LIKE_c # E: incompatible type
|
| 88 |
+
AR_i *= AR_LIKE_m # E: incompatible type
|
| 89 |
+
|
| 90 |
+
AR_f *= AR_LIKE_c # E: incompatible type
|
| 91 |
+
AR_f *= AR_LIKE_m # E: incompatible type
|
| 92 |
+
|
| 93 |
+
# Array power
|
| 94 |
+
|
| 95 |
+
AR_b **= AR_LIKE_b # E: Invalid self argument
|
| 96 |
+
AR_b **= AR_LIKE_u # E: Invalid self argument
|
| 97 |
+
AR_b **= AR_LIKE_i # E: Invalid self argument
|
| 98 |
+
AR_b **= AR_LIKE_f # E: Invalid self argument
|
| 99 |
+
AR_b **= AR_LIKE_c # E: Invalid self argument
|
| 100 |
+
|
| 101 |
+
AR_u **= AR_LIKE_i # E: incompatible type
|
| 102 |
+
AR_u **= AR_LIKE_f # E: incompatible type
|
| 103 |
+
AR_u **= AR_LIKE_c # E: incompatible type
|
| 104 |
+
|
| 105 |
+
AR_i **= AR_LIKE_f # E: incompatible type
|
| 106 |
+
AR_i **= AR_LIKE_c # E: incompatible type
|
| 107 |
+
|
| 108 |
+
AR_f **= AR_LIKE_c # E: incompatible type
|
| 109 |
+
|
| 110 |
+
# Scalars
|
| 111 |
+
|
| 112 |
+
b_ - b_ # E: No overload variant
|
| 113 |
+
|
| 114 |
+
dt + dt # E: Unsupported operand types
|
| 115 |
+
td - dt # E: Unsupported operand types
|
| 116 |
+
td % 1 # E: Unsupported operand types
|
| 117 |
+
td / dt # E: No overload
|
| 118 |
+
td % dt # E: Unsupported operand types
|
| 119 |
+
|
| 120 |
+
-b_ # E: Unsupported operand type
|
| 121 |
+
+b_ # E: Unsupported operand type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_constructors.pyi
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
a: np.ndarray
|
| 4 |
+
generator = (i for i in range(10))
|
| 5 |
+
|
| 6 |
+
np.require(a, requirements=1) # E: No overload variant
|
| 7 |
+
np.require(a, requirements="TEST") # E: incompatible type
|
| 8 |
+
|
| 9 |
+
np.zeros("test") # E: incompatible type
|
| 10 |
+
np.zeros() # E: require at least one argument
|
| 11 |
+
|
| 12 |
+
np.ones("test") # E: incompatible type
|
| 13 |
+
np.ones() # E: require at least one argument
|
| 14 |
+
|
| 15 |
+
np.array(0, float, True) # E: No overload variant
|
| 16 |
+
|
| 17 |
+
np.linspace(None, 'bob') # E: No overload variant
|
| 18 |
+
np.linspace(0, 2, num=10.0) # E: No overload variant
|
| 19 |
+
np.linspace(0, 2, endpoint='True') # E: No overload variant
|
| 20 |
+
np.linspace(0, 2, retstep=b'False') # E: No overload variant
|
| 21 |
+
np.linspace(0, 2, dtype=0) # E: No overload variant
|
| 22 |
+
np.linspace(0, 2, axis=None) # E: No overload variant
|
| 23 |
+
|
| 24 |
+
np.logspace(None, 'bob') # E: No overload variant
|
| 25 |
+
np.logspace(0, 2, base=None) # E: No overload variant
|
| 26 |
+
|
| 27 |
+
np.geomspace(None, 'bob') # E: No overload variant
|
| 28 |
+
|
| 29 |
+
np.stack(generator) # E: No overload variant
|
| 30 |
+
np.hstack({1, 2}) # E: No overload variant
|
| 31 |
+
np.vstack(1) # E: No overload variant
|
| 32 |
+
|
| 33 |
+
np.array([1], like=1) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_like.pyi
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
from numpy._typing import ArrayLike
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class A:
|
| 6 |
+
pass
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
x1: ArrayLike = (i for i in range(10)) # E: Incompatible types in assignment
|
| 10 |
+
x2: ArrayLike = A() # E: Incompatible types in assignment
|
| 11 |
+
x3: ArrayLike = {1: "foo", 2: "bar"} # E: Incompatible types in assignment
|
| 12 |
+
|
| 13 |
+
scalar = np.int64(1)
|
| 14 |
+
scalar.__array__(dtype=np.float64) # E: No overload variant
|
| 15 |
+
array = np.array([1])
|
| 16 |
+
array.__array__(dtype=np.float64) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_pad.pyi
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_i8: npt.NDArray[np.int64]
|
| 5 |
+
|
| 6 |
+
np.pad(AR_i8, 2, mode="bob") # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/arrayprint.pyi
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from collections.abc import Callable
|
| 2 |
+
from typing import Any
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
AR: np.ndarray
|
| 6 |
+
func1: Callable[[Any], str]
|
| 7 |
+
func2: Callable[[np.integer[Any]], str]
|
| 8 |
+
|
| 9 |
+
np.array2string(AR, style=None) # E: Unexpected keyword argument
|
| 10 |
+
np.array2string(AR, legacy="1.14") # E: incompatible type
|
| 11 |
+
np.array2string(AR, sign="*") # E: incompatible type
|
| 12 |
+
np.array2string(AR, floatmode="default") # E: incompatible type
|
| 13 |
+
np.array2string(AR, formatter={"A": func1}) # E: incompatible type
|
| 14 |
+
np.array2string(AR, formatter={"float": func2}) # E: Incompatible types
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/arrayterator.pyi
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
AR_i8: np.ndarray[Any, np.dtype[np.int64]]
|
| 5 |
+
ar_iter = np.lib.Arrayterator(AR_i8)
|
| 6 |
+
|
| 7 |
+
np.lib.Arrayterator(np.int64()) # E: incompatible type
|
| 8 |
+
ar_iter.shape = (10, 5) # E: is read-only
|
| 9 |
+
ar_iter[None] # E: Invalid index type
|
| 10 |
+
ar_iter[None, 1] # E: Invalid index type
|
| 11 |
+
ar_iter[np.intp()] # E: Invalid index type
|
| 12 |
+
ar_iter[np.intp(), ...] # E: Invalid index type
|
| 13 |
+
ar_iter[AR_i8] # E: Invalid index type
|
| 14 |
+
ar_iter[AR_i8, :] # E: Invalid index type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/bitwise_ops.pyi
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
i8 = np.int64()
|
| 4 |
+
i4 = np.int32()
|
| 5 |
+
u8 = np.uint64()
|
| 6 |
+
b_ = np.bool_()
|
| 7 |
+
i = int()
|
| 8 |
+
|
| 9 |
+
f8 = np.float64()
|
| 10 |
+
|
| 11 |
+
b_ >> f8 # E: No overload variant
|
| 12 |
+
i8 << f8 # E: No overload variant
|
| 13 |
+
i | f8 # E: Unsupported operand types
|
| 14 |
+
i8 ^ f8 # E: No overload variant
|
| 15 |
+
u8 & f8 # E: No overload variant
|
| 16 |
+
~f8 # E: Unsupported operand type
|
| 17 |
+
|
| 18 |
+
# mypys' error message for `NoReturn` is unfortunately pretty bad
|
| 19 |
+
# TODO: Re-enable this once we add support for numerical precision for `number`s
|
| 20 |
+
# a = u8 | 0 # E: Need type annotation
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/char.pyi
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_U: npt.NDArray[np.str_]
|
| 5 |
+
AR_S: npt.NDArray[np.bytes_]
|
| 6 |
+
|
| 7 |
+
np.char.equal(AR_U, AR_S) # E: incompatible type
|
| 8 |
+
|
| 9 |
+
np.char.not_equal(AR_U, AR_S) # E: incompatible type
|
| 10 |
+
|
| 11 |
+
np.char.greater_equal(AR_U, AR_S) # E: incompatible type
|
| 12 |
+
|
| 13 |
+
np.char.less_equal(AR_U, AR_S) # E: incompatible type
|
| 14 |
+
|
| 15 |
+
np.char.greater(AR_U, AR_S) # E: incompatible type
|
| 16 |
+
|
| 17 |
+
np.char.less(AR_U, AR_S) # E: incompatible type
|
| 18 |
+
|
| 19 |
+
np.char.encode(AR_S) # E: incompatible type
|
| 20 |
+
np.char.decode(AR_U) # E: incompatible type
|
| 21 |
+
|
| 22 |
+
np.char.join(AR_U, b"_") # E: incompatible type
|
| 23 |
+
np.char.join(AR_S, "_") # E: incompatible type
|
| 24 |
+
|
| 25 |
+
np.char.ljust(AR_U, 5, fillchar=b"a") # E: incompatible type
|
| 26 |
+
np.char.ljust(AR_S, 5, fillchar="a") # E: incompatible type
|
| 27 |
+
np.char.rjust(AR_U, 5, fillchar=b"a") # E: incompatible type
|
| 28 |
+
np.char.rjust(AR_S, 5, fillchar="a") # E: incompatible type
|
| 29 |
+
|
| 30 |
+
np.char.lstrip(AR_U, chars=b"a") # E: incompatible type
|
| 31 |
+
np.char.lstrip(AR_S, chars="a") # E: incompatible type
|
| 32 |
+
np.char.strip(AR_U, chars=b"a") # E: incompatible type
|
| 33 |
+
np.char.strip(AR_S, chars="a") # E: incompatible type
|
| 34 |
+
np.char.rstrip(AR_U, chars=b"a") # E: incompatible type
|
| 35 |
+
np.char.rstrip(AR_S, chars="a") # E: incompatible type
|
| 36 |
+
|
| 37 |
+
np.char.partition(AR_U, b"a") # E: incompatible type
|
| 38 |
+
np.char.partition(AR_S, "a") # E: incompatible type
|
| 39 |
+
np.char.rpartition(AR_U, b"a") # E: incompatible type
|
| 40 |
+
np.char.rpartition(AR_S, "a") # E: incompatible type
|
| 41 |
+
|
| 42 |
+
np.char.replace(AR_U, b"_", b"-") # E: incompatible type
|
| 43 |
+
np.char.replace(AR_S, "_", "-") # E: incompatible type
|
| 44 |
+
|
| 45 |
+
np.char.split(AR_U, b"_") # E: incompatible type
|
| 46 |
+
np.char.split(AR_S, "_") # E: incompatible type
|
| 47 |
+
np.char.rsplit(AR_U, b"_") # E: incompatible type
|
| 48 |
+
np.char.rsplit(AR_S, "_") # E: incompatible type
|
| 49 |
+
|
| 50 |
+
np.char.count(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 51 |
+
np.char.count(AR_S, "a", end=9) # E: incompatible type
|
| 52 |
+
|
| 53 |
+
np.char.endswith(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 54 |
+
np.char.endswith(AR_S, "a", end=9) # E: incompatible type
|
| 55 |
+
np.char.startswith(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 56 |
+
np.char.startswith(AR_S, "a", end=9) # E: incompatible type
|
| 57 |
+
|
| 58 |
+
np.char.find(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 59 |
+
np.char.find(AR_S, "a", end=9) # E: incompatible type
|
| 60 |
+
np.char.rfind(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 61 |
+
np.char.rfind(AR_S, "a", end=9) # E: incompatible type
|
| 62 |
+
|
| 63 |
+
np.char.index(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 64 |
+
np.char.index(AR_S, "a", end=9) # E: incompatible type
|
| 65 |
+
np.char.rindex(AR_U, b"a", start=[1, 2, 3]) # E: incompatible type
|
| 66 |
+
np.char.rindex(AR_S, "a", end=9) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/chararray.pyi
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
from typing import Any
|
| 3 |
+
|
| 4 |
+
AR_U: np.chararray[Any, np.dtype[np.str_]]
|
| 5 |
+
AR_S: np.chararray[Any, np.dtype[np.bytes_]]
|
| 6 |
+
|
| 7 |
+
AR_S.encode() # E: Invalid self argument
|
| 8 |
+
AR_U.decode() # E: Invalid self argument
|
| 9 |
+
|
| 10 |
+
AR_U.join(b"_") # E: incompatible type
|
| 11 |
+
AR_S.join("_") # E: incompatible type
|
| 12 |
+
|
| 13 |
+
AR_U.ljust(5, fillchar=b"a") # E: incompatible type
|
| 14 |
+
AR_S.ljust(5, fillchar="a") # E: incompatible type
|
| 15 |
+
AR_U.rjust(5, fillchar=b"a") # E: incompatible type
|
| 16 |
+
AR_S.rjust(5, fillchar="a") # E: incompatible type
|
| 17 |
+
|
| 18 |
+
AR_U.lstrip(chars=b"a") # E: incompatible type
|
| 19 |
+
AR_S.lstrip(chars="a") # E: incompatible type
|
| 20 |
+
AR_U.strip(chars=b"a") # E: incompatible type
|
| 21 |
+
AR_S.strip(chars="a") # E: incompatible type
|
| 22 |
+
AR_U.rstrip(chars=b"a") # E: incompatible type
|
| 23 |
+
AR_S.rstrip(chars="a") # E: incompatible type
|
| 24 |
+
|
| 25 |
+
AR_U.partition(b"a") # E: incompatible type
|
| 26 |
+
AR_S.partition("a") # E: incompatible type
|
| 27 |
+
AR_U.rpartition(b"a") # E: incompatible type
|
| 28 |
+
AR_S.rpartition("a") # E: incompatible type
|
| 29 |
+
|
| 30 |
+
AR_U.replace(b"_", b"-") # E: incompatible type
|
| 31 |
+
AR_S.replace("_", "-") # E: incompatible type
|
| 32 |
+
|
| 33 |
+
AR_U.split(b"_") # E: incompatible type
|
| 34 |
+
AR_S.split("_") # E: incompatible type
|
| 35 |
+
AR_S.split(1) # E: incompatible type
|
| 36 |
+
AR_U.rsplit(b"_") # E: incompatible type
|
| 37 |
+
AR_S.rsplit("_") # E: incompatible type
|
| 38 |
+
|
| 39 |
+
AR_U.count(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 40 |
+
AR_S.count("a", end=9) # E: incompatible type
|
| 41 |
+
|
| 42 |
+
AR_U.endswith(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 43 |
+
AR_S.endswith("a", end=9) # E: incompatible type
|
| 44 |
+
AR_U.startswith(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 45 |
+
AR_S.startswith("a", end=9) # E: incompatible type
|
| 46 |
+
|
| 47 |
+
AR_U.find(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 48 |
+
AR_S.find("a", end=9) # E: incompatible type
|
| 49 |
+
AR_U.rfind(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 50 |
+
AR_S.rfind("a", end=9) # E: incompatible type
|
| 51 |
+
|
| 52 |
+
AR_U.index(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 53 |
+
AR_S.index("a", end=9) # E: incompatible type
|
| 54 |
+
AR_U.rindex(b"a", start=[1, 2, 3]) # E: incompatible type
|
| 55 |
+
AR_S.rindex("a", end=9) # E: incompatible type
|
| 56 |
+
|
| 57 |
+
AR_U == AR_S # E: Unsupported operand types
|
| 58 |
+
AR_U != AR_S # E: Unsupported operand types
|
| 59 |
+
AR_U >= AR_S # E: Unsupported operand types
|
| 60 |
+
AR_U <= AR_S # E: Unsupported operand types
|
| 61 |
+
AR_U > AR_S # E: Unsupported operand types
|
| 62 |
+
AR_U < AR_S # E: Unsupported operand types
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/comparisons.pyi
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
AR_i: np.ndarray[Any, np.dtype[np.int64]]
|
| 5 |
+
AR_f: np.ndarray[Any, np.dtype[np.float64]]
|
| 6 |
+
AR_c: np.ndarray[Any, np.dtype[np.complex128]]
|
| 7 |
+
AR_m: np.ndarray[Any, np.dtype[np.timedelta64]]
|
| 8 |
+
AR_M: np.ndarray[Any, np.dtype[np.datetime64]]
|
| 9 |
+
|
| 10 |
+
AR_f > AR_m # E: Unsupported operand types
|
| 11 |
+
AR_c > AR_m # E: Unsupported operand types
|
| 12 |
+
|
| 13 |
+
AR_m > AR_f # E: Unsupported operand types
|
| 14 |
+
AR_m > AR_c # E: Unsupported operand types
|
| 15 |
+
|
| 16 |
+
AR_i > AR_M # E: Unsupported operand types
|
| 17 |
+
AR_f > AR_M # E: Unsupported operand types
|
| 18 |
+
AR_m > AR_M # E: Unsupported operand types
|
| 19 |
+
|
| 20 |
+
AR_M > AR_i # E: Unsupported operand types
|
| 21 |
+
AR_M > AR_f # E: Unsupported operand types
|
| 22 |
+
AR_M > AR_m # E: Unsupported operand types
|
| 23 |
+
|
| 24 |
+
AR_i > str() # E: No overload variant
|
| 25 |
+
AR_i > bytes() # E: No overload variant
|
| 26 |
+
str() > AR_M # E: Unsupported operand types
|
| 27 |
+
bytes() > AR_M # E: Unsupported operand types
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/constants.pyi
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
np.Inf = np.Inf # E: Cannot assign to final
|
| 4 |
+
np.ALLOW_THREADS = np.ALLOW_THREADS # E: Cannot assign to final
|
| 5 |
+
np.little_endian = np.little_endian # E: Cannot assign to final
|
| 6 |
+
np.UFUNC_PYVALS_NAME = "bob" # E: Incompatible types
|
| 7 |
+
np.CLIP = 2 # E: Incompatible types
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/datasource.pyi
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
path: Path
|
| 5 |
+
d1: np.DataSource
|
| 6 |
+
|
| 7 |
+
d1.abspath(path) # E: incompatible type
|
| 8 |
+
d1.abspath(b"...") # E: incompatible type
|
| 9 |
+
|
| 10 |
+
d1.exists(path) # E: incompatible type
|
| 11 |
+
d1.exists(b"...") # E: incompatible type
|
| 12 |
+
|
| 13 |
+
d1.open(path, "r") # E: incompatible type
|
| 14 |
+
d1.open(b"...", encoding="utf8") # E: incompatible type
|
| 15 |
+
d1.open(None, newline="/n") # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/dtype.pyi
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class Test1:
|
| 5 |
+
not_dtype = np.dtype(float)
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class Test2:
|
| 9 |
+
dtype = float
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
np.dtype(Test1()) # E: No overload variant of "dtype" matches
|
| 13 |
+
np.dtype(Test2()) # E: incompatible type
|
| 14 |
+
|
| 15 |
+
np.dtype( # E: No overload variant of "dtype" matches
|
| 16 |
+
{
|
| 17 |
+
"field1": (float, 1),
|
| 18 |
+
"field2": (int, 3),
|
| 19 |
+
}
|
| 20 |
+
)
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/einsumfunc.pyi
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
AR_i: np.ndarray[Any, np.dtype[np.int64]]
|
| 5 |
+
AR_f: np.ndarray[Any, np.dtype[np.float64]]
|
| 6 |
+
AR_m: np.ndarray[Any, np.dtype[np.timedelta64]]
|
| 7 |
+
AR_O: np.ndarray[Any, np.dtype[np.object_]]
|
| 8 |
+
AR_U: np.ndarray[Any, np.dtype[np.str_]]
|
| 9 |
+
|
| 10 |
+
np.einsum("i,i->i", AR_i, AR_m) # E: incompatible type
|
| 11 |
+
np.einsum("i,i->i", AR_O, AR_O) # E: incompatible type
|
| 12 |
+
np.einsum("i,i->i", AR_f, AR_f, dtype=np.int32) # E: incompatible type
|
| 13 |
+
np.einsum("i,i->i", AR_i, AR_i, dtype=np.timedelta64, casting="unsafe") # E: No overload variant
|
| 14 |
+
np.einsum("i,i->i", AR_i, AR_i, out=AR_U) # E: Value of type variable "_ArrayType" of "einsum" cannot be
|
| 15 |
+
np.einsum("i,i->i", AR_i, AR_i, out=AR_U, casting="unsafe") # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/false_positives.pyi
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_f8: npt.NDArray[np.float64]
|
| 5 |
+
|
| 6 |
+
# NOTE: Mypy bug presumably due to the special-casing of heterogeneous tuples;
|
| 7 |
+
# xref numpy/numpy#20901
|
| 8 |
+
#
|
| 9 |
+
# The expected output should be no different than, e.g., when using a
|
| 10 |
+
# list instead of a tuple
|
| 11 |
+
np.concatenate(([1], AR_f8)) # E: Argument 1 to "concatenate" has incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/flatiter.pyi
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
from numpy._typing import _SupportsArray
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class Index:
|
| 8 |
+
def __index__(self) -> int:
|
| 9 |
+
...
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
a: "np.flatiter[np.ndarray]"
|
| 13 |
+
supports_array: _SupportsArray
|
| 14 |
+
|
| 15 |
+
a.base = Any # E: Property "base" defined in "flatiter" is read-only
|
| 16 |
+
a.coords = Any # E: Property "coords" defined in "flatiter" is read-only
|
| 17 |
+
a.index = Any # E: Property "index" defined in "flatiter" is read-only
|
| 18 |
+
a.copy(order='C') # E: Unexpected keyword argument
|
| 19 |
+
|
| 20 |
+
# NOTE: Contrary to `ndarray.__getitem__` its counterpart in `flatiter`
|
| 21 |
+
# does not accept objects with the `__array__` or `__index__` protocols;
|
| 22 |
+
# boolean indexing is just plain broken (gh-17175)
|
| 23 |
+
a[np.bool_()] # E: No overload variant of "__getitem__"
|
| 24 |
+
a[Index()] # E: No overload variant of "__getitem__"
|
| 25 |
+
a[supports_array] # E: No overload variant of "__getitem__"
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/fromnumeric.pyi
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for :mod:`numpy.core.fromnumeric`."""
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
import numpy.typing as npt
|
| 5 |
+
|
| 6 |
+
A = np.array(True, ndmin=2, dtype=bool)
|
| 7 |
+
A.setflags(write=False)
|
| 8 |
+
AR_U: npt.NDArray[np.str_]
|
| 9 |
+
|
| 10 |
+
a = np.bool_(True)
|
| 11 |
+
|
| 12 |
+
np.take(a, None) # E: No overload variant
|
| 13 |
+
np.take(a, axis=1.0) # E: No overload variant
|
| 14 |
+
np.take(A, out=1) # E: No overload variant
|
| 15 |
+
np.take(A, mode="bob") # E: No overload variant
|
| 16 |
+
|
| 17 |
+
np.reshape(a, None) # E: No overload variant
|
| 18 |
+
np.reshape(A, 1, order="bob") # E: No overload variant
|
| 19 |
+
|
| 20 |
+
np.choose(a, None) # E: No overload variant
|
| 21 |
+
np.choose(a, out=1.0) # E: No overload variant
|
| 22 |
+
np.choose(A, mode="bob") # E: No overload variant
|
| 23 |
+
|
| 24 |
+
np.repeat(a, None) # E: No overload variant
|
| 25 |
+
np.repeat(A, 1, axis=1.0) # E: No overload variant
|
| 26 |
+
|
| 27 |
+
np.swapaxes(A, None, 1) # E: No overload variant
|
| 28 |
+
np.swapaxes(A, 1, [0]) # E: No overload variant
|
| 29 |
+
|
| 30 |
+
np.transpose(A, axes=1.0) # E: No overload variant
|
| 31 |
+
|
| 32 |
+
np.partition(a, None) # E: No overload variant
|
| 33 |
+
np.partition( # E: No overload variant
|
| 34 |
+
a, 0, axis="bob"
|
| 35 |
+
)
|
| 36 |
+
np.partition( # E: No overload variant
|
| 37 |
+
A, 0, kind="bob"
|
| 38 |
+
)
|
| 39 |
+
np.partition(
|
| 40 |
+
A, 0, order=range(5) # E: Argument "order" to "partition" has incompatible type
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
np.argpartition(
|
| 44 |
+
a, None # E: incompatible type
|
| 45 |
+
)
|
| 46 |
+
np.argpartition(
|
| 47 |
+
a, 0, axis="bob" # E: incompatible type
|
| 48 |
+
)
|
| 49 |
+
np.argpartition(
|
| 50 |
+
A, 0, kind="bob" # E: incompatible type
|
| 51 |
+
)
|
| 52 |
+
np.argpartition(
|
| 53 |
+
A, 0, order=range(5) # E: Argument "order" to "argpartition" has incompatible type
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
np.sort(A, axis="bob") # E: No overload variant
|
| 57 |
+
np.sort(A, kind="bob") # E: No overload variant
|
| 58 |
+
np.sort(A, order=range(5)) # E: Argument "order" to "sort" has incompatible type
|
| 59 |
+
|
| 60 |
+
np.argsort(A, axis="bob") # E: Argument "axis" to "argsort" has incompatible type
|
| 61 |
+
np.argsort(A, kind="bob") # E: Argument "kind" to "argsort" has incompatible type
|
| 62 |
+
np.argsort(A, order=range(5)) # E: Argument "order" to "argsort" has incompatible type
|
| 63 |
+
|
| 64 |
+
np.argmax(A, axis="bob") # E: No overload variant of "argmax" matches argument type
|
| 65 |
+
np.argmax(A, kind="bob") # E: No overload variant of "argmax" matches argument type
|
| 66 |
+
|
| 67 |
+
np.argmin(A, axis="bob") # E: No overload variant of "argmin" matches argument type
|
| 68 |
+
np.argmin(A, kind="bob") # E: No overload variant of "argmin" matches argument type
|
| 69 |
+
|
| 70 |
+
np.searchsorted( # E: No overload variant of "searchsorted" matches argument type
|
| 71 |
+
A[0], 0, side="bob"
|
| 72 |
+
)
|
| 73 |
+
np.searchsorted( # E: No overload variant of "searchsorted" matches argument type
|
| 74 |
+
A[0], 0, sorter=1.0
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
np.resize(A, 1.0) # E: No overload variant
|
| 78 |
+
|
| 79 |
+
np.squeeze(A, 1.0) # E: No overload variant of "squeeze" matches argument type
|
| 80 |
+
|
| 81 |
+
np.diagonal(A, offset=None) # E: No overload variant
|
| 82 |
+
np.diagonal(A, axis1="bob") # E: No overload variant
|
| 83 |
+
np.diagonal(A, axis2=[]) # E: No overload variant
|
| 84 |
+
|
| 85 |
+
np.trace(A, offset=None) # E: No overload variant
|
| 86 |
+
np.trace(A, axis1="bob") # E: No overload variant
|
| 87 |
+
np.trace(A, axis2=[]) # E: No overload variant
|
| 88 |
+
|
| 89 |
+
np.ravel(a, order="bob") # E: No overload variant
|
| 90 |
+
|
| 91 |
+
np.compress( # E: No overload variant
|
| 92 |
+
[True], A, axis=1.0
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
np.clip(a, 1, 2, out=1) # E: No overload variant of "clip" matches argument type
|
| 96 |
+
|
| 97 |
+
np.sum(a, axis=1.0) # E: No overload variant
|
| 98 |
+
np.sum(a, keepdims=1.0) # E: No overload variant
|
| 99 |
+
np.sum(a, initial=[1]) # E: No overload variant
|
| 100 |
+
|
| 101 |
+
np.all(a, axis=1.0) # E: No overload variant
|
| 102 |
+
np.all(a, keepdims=1.0) # E: No overload variant
|
| 103 |
+
np.all(a, out=1.0) # E: No overload variant
|
| 104 |
+
|
| 105 |
+
np.any(a, axis=1.0) # E: No overload variant
|
| 106 |
+
np.any(a, keepdims=1.0) # E: No overload variant
|
| 107 |
+
np.any(a, out=1.0) # E: No overload variant
|
| 108 |
+
|
| 109 |
+
np.cumsum(a, axis=1.0) # E: No overload variant
|
| 110 |
+
np.cumsum(a, dtype=1.0) # E: No overload variant
|
| 111 |
+
np.cumsum(a, out=1.0) # E: No overload variant
|
| 112 |
+
|
| 113 |
+
np.ptp(a, axis=1.0) # E: No overload variant
|
| 114 |
+
np.ptp(a, keepdims=1.0) # E: No overload variant
|
| 115 |
+
np.ptp(a, out=1.0) # E: No overload variant
|
| 116 |
+
|
| 117 |
+
np.amax(a, axis=1.0) # E: No overload variant
|
| 118 |
+
np.amax(a, keepdims=1.0) # E: No overload variant
|
| 119 |
+
np.amax(a, out=1.0) # E: No overload variant
|
| 120 |
+
np.amax(a, initial=[1.0]) # E: No overload variant
|
| 121 |
+
np.amax(a, where=[1.0]) # E: incompatible type
|
| 122 |
+
|
| 123 |
+
np.amin(a, axis=1.0) # E: No overload variant
|
| 124 |
+
np.amin(a, keepdims=1.0) # E: No overload variant
|
| 125 |
+
np.amin(a, out=1.0) # E: No overload variant
|
| 126 |
+
np.amin(a, initial=[1.0]) # E: No overload variant
|
| 127 |
+
np.amin(a, where=[1.0]) # E: incompatible type
|
| 128 |
+
|
| 129 |
+
np.prod(a, axis=1.0) # E: No overload variant
|
| 130 |
+
np.prod(a, out=False) # E: No overload variant
|
| 131 |
+
np.prod(a, keepdims=1.0) # E: No overload variant
|
| 132 |
+
np.prod(a, initial=int) # E: No overload variant
|
| 133 |
+
np.prod(a, where=1.0) # E: No overload variant
|
| 134 |
+
np.prod(AR_U) # E: incompatible type
|
| 135 |
+
|
| 136 |
+
np.cumprod(a, axis=1.0) # E: No overload variant
|
| 137 |
+
np.cumprod(a, out=False) # E: No overload variant
|
| 138 |
+
np.cumprod(AR_U) # E: incompatible type
|
| 139 |
+
|
| 140 |
+
np.size(a, axis=1.0) # E: Argument "axis" to "size" has incompatible type
|
| 141 |
+
|
| 142 |
+
np.around(a, decimals=1.0) # E: No overload variant
|
| 143 |
+
np.around(a, out=type) # E: No overload variant
|
| 144 |
+
np.around(AR_U) # E: incompatible type
|
| 145 |
+
|
| 146 |
+
np.mean(a, axis=1.0) # E: No overload variant
|
| 147 |
+
np.mean(a, out=False) # E: No overload variant
|
| 148 |
+
np.mean(a, keepdims=1.0) # E: No overload variant
|
| 149 |
+
np.mean(AR_U) # E: incompatible type
|
| 150 |
+
|
| 151 |
+
np.std(a, axis=1.0) # E: No overload variant
|
| 152 |
+
np.std(a, out=False) # E: No overload variant
|
| 153 |
+
np.std(a, ddof='test') # E: No overload variant
|
| 154 |
+
np.std(a, keepdims=1.0) # E: No overload variant
|
| 155 |
+
np.std(AR_U) # E: incompatible type
|
| 156 |
+
|
| 157 |
+
np.var(a, axis=1.0) # E: No overload variant
|
| 158 |
+
np.var(a, out=False) # E: No overload variant
|
| 159 |
+
np.var(a, ddof='test') # E: No overload variant
|
| 160 |
+
np.var(a, keepdims=1.0) # E: No overload variant
|
| 161 |
+
np.var(AR_U) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/histograms.pyi
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_i8: npt.NDArray[np.int64]
|
| 5 |
+
AR_f8: npt.NDArray[np.float64]
|
| 6 |
+
|
| 7 |
+
np.histogram_bin_edges(AR_i8, range=(0, 1, 2)) # E: incompatible type
|
| 8 |
+
|
| 9 |
+
np.histogram(AR_i8, range=(0, 1, 2)) # E: incompatible type
|
| 10 |
+
|
| 11 |
+
np.histogramdd(AR_i8, range=(0, 1)) # E: incompatible type
|
| 12 |
+
np.histogramdd(AR_i8, range=[(0, 1, 2)]) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/index_tricks.pyi
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
AR_LIKE_i: list[int]
|
| 4 |
+
AR_LIKE_f: list[float]
|
| 5 |
+
|
| 6 |
+
np.ndindex([1, 2, 3]) # E: No overload variant
|
| 7 |
+
np.unravel_index(AR_LIKE_f, (1, 2, 3)) # E: incompatible type
|
| 8 |
+
np.ravel_multi_index(AR_LIKE_i, (1, 2, 3), mode="bob") # E: No overload variant
|
| 9 |
+
np.mgrid[1] # E: Invalid index type
|
| 10 |
+
np.mgrid[...] # E: Invalid index type
|
| 11 |
+
np.ogrid[1] # E: Invalid index type
|
| 12 |
+
np.ogrid[...] # E: Invalid index type
|
| 13 |
+
np.fill_diagonal(AR_LIKE_f, 2) # E: incompatible type
|
| 14 |
+
np.diag_indices(1.0) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_function_base.pyi
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
import numpy.typing as npt
|
| 5 |
+
|
| 6 |
+
AR_f8: npt.NDArray[np.float64]
|
| 7 |
+
AR_c16: npt.NDArray[np.complex128]
|
| 8 |
+
AR_m: npt.NDArray[np.timedelta64]
|
| 9 |
+
AR_M: npt.NDArray[np.datetime64]
|
| 10 |
+
AR_O: npt.NDArray[np.object_]
|
| 11 |
+
|
| 12 |
+
def func(a: int) -> None: ...
|
| 13 |
+
|
| 14 |
+
np.average(AR_m) # E: incompatible type
|
| 15 |
+
np.select(1, [AR_f8]) # E: incompatible type
|
| 16 |
+
np.angle(AR_m) # E: incompatible type
|
| 17 |
+
np.unwrap(AR_m) # E: incompatible type
|
| 18 |
+
np.unwrap(AR_c16) # E: incompatible type
|
| 19 |
+
np.trim_zeros(1) # E: incompatible type
|
| 20 |
+
np.place(1, [True], 1.5) # E: incompatible type
|
| 21 |
+
np.vectorize(1) # E: incompatible type
|
| 22 |
+
np.add_newdoc("__main__", 1.5, "docstring") # E: incompatible type
|
| 23 |
+
np.place(AR_f8, slice(None), 5) # E: incompatible type
|
| 24 |
+
|
| 25 |
+
np.interp(AR_f8, AR_c16, AR_f8) # E: incompatible type
|
| 26 |
+
np.interp(AR_c16, AR_f8, AR_f8) # E: incompatible type
|
| 27 |
+
np.interp(AR_f8, AR_f8, AR_f8, period=AR_c16) # E: No overload variant
|
| 28 |
+
np.interp(AR_f8, AR_f8, AR_O) # E: incompatible type
|
| 29 |
+
|
| 30 |
+
np.cov(AR_m) # E: incompatible type
|
| 31 |
+
np.cov(AR_O) # E: incompatible type
|
| 32 |
+
np.corrcoef(AR_m) # E: incompatible type
|
| 33 |
+
np.corrcoef(AR_O) # E: incompatible type
|
| 34 |
+
np.corrcoef(AR_f8, bias=True) # E: No overload variant
|
| 35 |
+
np.corrcoef(AR_f8, ddof=2) # E: No overload variant
|
| 36 |
+
np.blackman(1j) # E: incompatible type
|
| 37 |
+
np.bartlett(1j) # E: incompatible type
|
| 38 |
+
np.hanning(1j) # E: incompatible type
|
| 39 |
+
np.hamming(1j) # E: incompatible type
|
| 40 |
+
np.hamming(AR_c16) # E: incompatible type
|
| 41 |
+
np.kaiser(1j, 1) # E: incompatible type
|
| 42 |
+
np.sinc(AR_O) # E: incompatible type
|
| 43 |
+
np.median(AR_M) # E: incompatible type
|
| 44 |
+
|
| 45 |
+
np.add_newdoc_ufunc(func, "docstring") # E: incompatible type
|
| 46 |
+
np.percentile(AR_f8, 50j) # E: No overload variant
|
| 47 |
+
np.percentile(AR_f8, 50, interpolation="bob") # E: No overload variant
|
| 48 |
+
np.quantile(AR_f8, 0.5j) # E: No overload variant
|
| 49 |
+
np.quantile(AR_f8, 0.5, interpolation="bob") # E: No overload variant
|
| 50 |
+
np.meshgrid(AR_f8, AR_f8, indexing="bob") # E: incompatible type
|
| 51 |
+
np.delete(AR_f8, AR_f8) # E: incompatible type
|
| 52 |
+
np.insert(AR_f8, AR_f8, 1.5) # E: incompatible type
|
| 53 |
+
np.digitize(AR_f8, 1j) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_polynomial.pyi
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_f8: npt.NDArray[np.float64]
|
| 5 |
+
AR_c16: npt.NDArray[np.complex128]
|
| 6 |
+
AR_O: npt.NDArray[np.object_]
|
| 7 |
+
AR_U: npt.NDArray[np.str_]
|
| 8 |
+
|
| 9 |
+
poly_obj: np.poly1d
|
| 10 |
+
|
| 11 |
+
np.polyint(AR_U) # E: incompatible type
|
| 12 |
+
np.polyint(AR_f8, m=1j) # E: No overload variant
|
| 13 |
+
|
| 14 |
+
np.polyder(AR_U) # E: incompatible type
|
| 15 |
+
np.polyder(AR_f8, m=1j) # E: No overload variant
|
| 16 |
+
|
| 17 |
+
np.polyfit(AR_O, AR_f8, 1) # E: incompatible type
|
| 18 |
+
np.polyfit(AR_f8, AR_f8, 1, rcond=1j) # E: No overload variant
|
| 19 |
+
np.polyfit(AR_f8, AR_f8, 1, w=AR_c16) # E: incompatible type
|
| 20 |
+
np.polyfit(AR_f8, AR_f8, 1, cov="bob") # E: No overload variant
|
| 21 |
+
|
| 22 |
+
np.polyval(AR_f8, AR_U) # E: incompatible type
|
| 23 |
+
np.polyadd(AR_f8, AR_U) # E: incompatible type
|
| 24 |
+
np.polysub(AR_f8, AR_U) # E: incompatible type
|
| 25 |
+
np.polymul(AR_f8, AR_U) # E: incompatible type
|
| 26 |
+
np.polydiv(AR_f8, AR_U) # E: incompatible type
|
| 27 |
+
|
| 28 |
+
5**poly_obj # E: No overload variant
|
| 29 |
+
hash(poly_obj)
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_utils.pyi
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
np.deprecate(1) # E: No overload variant
|
| 4 |
+
|
| 5 |
+
np.deprecate_with_doc(1) # E: incompatible type
|
| 6 |
+
|
| 7 |
+
np.byte_bounds(1) # E: incompatible type
|
| 8 |
+
|
| 9 |
+
np.who(1) # E: incompatible type
|
| 10 |
+
|
| 11 |
+
np.lookfor(None) # E: incompatible type
|
| 12 |
+
|
| 13 |
+
np.safe_eval(None) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/lib_version.pyi
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from numpy.lib import NumpyVersion
|
| 2 |
+
|
| 3 |
+
version: NumpyVersion
|
| 4 |
+
|
| 5 |
+
NumpyVersion(b"1.8.0") # E: incompatible type
|
| 6 |
+
version >= b"1.8.0" # E: Unsupported operand types
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/linalg.pyi
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_f8: npt.NDArray[np.float64]
|
| 5 |
+
AR_O: npt.NDArray[np.object_]
|
| 6 |
+
AR_M: npt.NDArray[np.datetime64]
|
| 7 |
+
|
| 8 |
+
np.linalg.tensorsolve(AR_O, AR_O) # E: incompatible type
|
| 9 |
+
|
| 10 |
+
np.linalg.solve(AR_O, AR_O) # E: incompatible type
|
| 11 |
+
|
| 12 |
+
np.linalg.tensorinv(AR_O) # E: incompatible type
|
| 13 |
+
|
| 14 |
+
np.linalg.inv(AR_O) # E: incompatible type
|
| 15 |
+
|
| 16 |
+
np.linalg.matrix_power(AR_M, 5) # E: incompatible type
|
| 17 |
+
|
| 18 |
+
np.linalg.cholesky(AR_O) # E: incompatible type
|
| 19 |
+
|
| 20 |
+
np.linalg.qr(AR_O) # E: incompatible type
|
| 21 |
+
np.linalg.qr(AR_f8, mode="bob") # E: No overload variant
|
| 22 |
+
|
| 23 |
+
np.linalg.eigvals(AR_O) # E: incompatible type
|
| 24 |
+
|
| 25 |
+
np.linalg.eigvalsh(AR_O) # E: incompatible type
|
| 26 |
+
np.linalg.eigvalsh(AR_O, UPLO="bob") # E: No overload variant
|
| 27 |
+
|
| 28 |
+
np.linalg.eig(AR_O) # E: incompatible type
|
| 29 |
+
|
| 30 |
+
np.linalg.eigh(AR_O) # E: incompatible type
|
| 31 |
+
np.linalg.eigh(AR_O, UPLO="bob") # E: No overload variant
|
| 32 |
+
|
| 33 |
+
np.linalg.svd(AR_O) # E: incompatible type
|
| 34 |
+
|
| 35 |
+
np.linalg.cond(AR_O) # E: incompatible type
|
| 36 |
+
np.linalg.cond(AR_f8, p="bob") # E: incompatible type
|
| 37 |
+
|
| 38 |
+
np.linalg.matrix_rank(AR_O) # E: incompatible type
|
| 39 |
+
|
| 40 |
+
np.linalg.pinv(AR_O) # E: incompatible type
|
| 41 |
+
|
| 42 |
+
np.linalg.slogdet(AR_O) # E: incompatible type
|
| 43 |
+
|
| 44 |
+
np.linalg.det(AR_O) # E: incompatible type
|
| 45 |
+
|
| 46 |
+
np.linalg.norm(AR_f8, ord="bob") # E: No overload variant
|
| 47 |
+
|
| 48 |
+
np.linalg.multi_dot([AR_M]) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/memmap.pyi
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
with open("file.txt", "r") as f:
|
| 4 |
+
np.memmap(f) # E: No overload variant
|
| 5 |
+
np.memmap("test.txt", shape=[10, 5]) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/modules.pyi
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
np.testing.bob # E: Module has no attribute
|
| 4 |
+
np.bob # E: Module has no attribute
|
| 5 |
+
|
| 6 |
+
# Stdlib modules in the namespace by accident
|
| 7 |
+
np.warnings # E: Module has no attribute
|
| 8 |
+
np.sys # E: Module has no attribute
|
| 9 |
+
np.os # E: Module has no attribute
|
| 10 |
+
np.math # E: Module has no attribute
|
| 11 |
+
|
| 12 |
+
# Public sub-modules that are not imported to their parent module by default;
|
| 13 |
+
# e.g. one must first execute `import numpy.lib.recfunctions`
|
| 14 |
+
np.lib.recfunctions # E: Module has no attribute
|
| 15 |
+
|
| 16 |
+
np.__NUMPY_SETUP__ # E: Module has no attribute
|
| 17 |
+
np.__deprecated_attrs__ # E: Module has no attribute
|
| 18 |
+
np.__expired_functions__ # E: Module has no attribute
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/multiarray.pyi
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
i8: np.int64
|
| 5 |
+
|
| 6 |
+
AR_b: npt.NDArray[np.bool_]
|
| 7 |
+
AR_u1: npt.NDArray[np.uint8]
|
| 8 |
+
AR_i8: npt.NDArray[np.int64]
|
| 9 |
+
AR_f8: npt.NDArray[np.float64]
|
| 10 |
+
AR_M: npt.NDArray[np.datetime64]
|
| 11 |
+
|
| 12 |
+
M: np.datetime64
|
| 13 |
+
|
| 14 |
+
AR_LIKE_f: list[float]
|
| 15 |
+
|
| 16 |
+
def func(a: int) -> None: ...
|
| 17 |
+
|
| 18 |
+
np.where(AR_b, 1) # E: No overload variant
|
| 19 |
+
|
| 20 |
+
np.can_cast(AR_f8, 1) # E: incompatible type
|
| 21 |
+
|
| 22 |
+
np.vdot(AR_M, AR_M) # E: incompatible type
|
| 23 |
+
|
| 24 |
+
np.copyto(AR_LIKE_f, AR_f8) # E: incompatible type
|
| 25 |
+
|
| 26 |
+
np.putmask(AR_LIKE_f, [True, True, False], 1.5) # E: incompatible type
|
| 27 |
+
|
| 28 |
+
np.packbits(AR_f8) # E: incompatible type
|
| 29 |
+
np.packbits(AR_u1, bitorder=">") # E: incompatible type
|
| 30 |
+
|
| 31 |
+
np.unpackbits(AR_i8) # E: incompatible type
|
| 32 |
+
np.unpackbits(AR_u1, bitorder=">") # E: incompatible type
|
| 33 |
+
|
| 34 |
+
np.shares_memory(1, 1, max_work=i8) # E: incompatible type
|
| 35 |
+
np.may_share_memory(1, 1, max_work=i8) # E: incompatible type
|
| 36 |
+
|
| 37 |
+
np.arange(M) # E: No overload variant
|
| 38 |
+
np.arange(stop=10) # E: No overload variant
|
| 39 |
+
|
| 40 |
+
np.datetime_data(int) # E: incompatible type
|
| 41 |
+
|
| 42 |
+
np.busday_offset("2012", 10) # E: No overload variant
|
| 43 |
+
|
| 44 |
+
np.datetime_as_string("2012") # E: No overload variant
|
| 45 |
+
|
| 46 |
+
np.compare_chararrays("a", b"a", "==", False) # E: No overload variant
|
| 47 |
+
|
| 48 |
+
np.add_docstring(func, None) # E: incompatible type
|
| 49 |
+
|
| 50 |
+
np.nested_iters([AR_i8, AR_i8]) # E: Missing positional argument
|
| 51 |
+
np.nested_iters([AR_i8, AR_i8], 0) # E: incompatible type
|
| 52 |
+
np.nested_iters([AR_i8, AR_i8], [0]) # E: incompatible type
|
| 53 |
+
np.nested_iters([AR_i8, AR_i8], [[0], [1]], flags=["test"]) # E: incompatible type
|
| 54 |
+
np.nested_iters([AR_i8, AR_i8], [[0], [1]], op_flags=[["test"]]) # E: incompatible type
|
| 55 |
+
np.nested_iters([AR_i8, AR_i8], [[0], [1]], buffersize=1.0) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ndarray.pyi
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
# Ban setting dtype since mutating the type of the array in place
|
| 4 |
+
# makes having ndarray be generic over dtype impossible. Generally
|
| 5 |
+
# users should use `ndarray.view` in this situation anyway. See
|
| 6 |
+
#
|
| 7 |
+
# https://github.com/numpy/numpy-stubs/issues/7
|
| 8 |
+
#
|
| 9 |
+
# for more context.
|
| 10 |
+
float_array = np.array([1.0])
|
| 11 |
+
float_array.dtype = np.bool_ # E: Property "dtype" defined in "ndarray" is read-only
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ndarray_misc.pyi
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Tests for miscellaneous (non-magic) ``np.ndarray``/``np.generic`` methods.
|
| 3 |
+
|
| 4 |
+
More extensive tests are performed for the methods'
|
| 5 |
+
function-based counterpart in `../from_numeric.py`.
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from typing import Any
|
| 10 |
+
import numpy as np
|
| 11 |
+
|
| 12 |
+
f8: np.float64
|
| 13 |
+
AR_f8: np.ndarray[Any, np.dtype[np.float64]]
|
| 14 |
+
AR_M: np.ndarray[Any, np.dtype[np.datetime64]]
|
| 15 |
+
AR_b: np.ndarray[Any, np.dtype[np.bool_]]
|
| 16 |
+
|
| 17 |
+
ctypes_obj = AR_f8.ctypes
|
| 18 |
+
|
| 19 |
+
reveal_type(ctypes_obj.get_data()) # E: has no attribute
|
| 20 |
+
reveal_type(ctypes_obj.get_shape()) # E: has no attribute
|
| 21 |
+
reveal_type(ctypes_obj.get_strides()) # E: has no attribute
|
| 22 |
+
reveal_type(ctypes_obj.get_as_parameter()) # E: has no attribute
|
| 23 |
+
|
| 24 |
+
f8.argpartition(0) # E: has no attribute
|
| 25 |
+
f8.diagonal() # E: has no attribute
|
| 26 |
+
f8.dot(1) # E: has no attribute
|
| 27 |
+
f8.nonzero() # E: has no attribute
|
| 28 |
+
f8.partition(0) # E: has no attribute
|
| 29 |
+
f8.put(0, 2) # E: has no attribute
|
| 30 |
+
f8.setfield(2, np.float64) # E: has no attribute
|
| 31 |
+
f8.sort() # E: has no attribute
|
| 32 |
+
f8.trace() # E: has no attribute
|
| 33 |
+
|
| 34 |
+
AR_M.__int__() # E: Invalid self argument
|
| 35 |
+
AR_M.__float__() # E: Invalid self argument
|
| 36 |
+
AR_M.__complex__() # E: Invalid self argument
|
| 37 |
+
AR_b.__index__() # E: Invalid self argument
|
| 38 |
+
|
| 39 |
+
AR_f8[1.5] # E: No overload variant
|
| 40 |
+
AR_f8["field_a"] # E: No overload variant
|
| 41 |
+
AR_f8[["field_a", "field_b"]] # E: Invalid index type
|
| 42 |
+
|
| 43 |
+
AR_f8.__array_finalize__(object()) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/nditer.pyi
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
class Test(np.nditer): ... # E: Cannot inherit from final class
|
| 4 |
+
|
| 5 |
+
np.nditer([0, 1], flags=["test"]) # E: incompatible type
|
| 6 |
+
np.nditer([0, 1], op_flags=[["test"]]) # E: incompatible type
|
| 7 |
+
np.nditer([0, 1], itershape=(1.0,)) # E: incompatible type
|
| 8 |
+
np.nditer([0, 1], buffersize=1.0) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/nested_sequence.pyi
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from collections.abc import Sequence
|
| 2 |
+
from numpy._typing import _NestedSequence
|
| 3 |
+
|
| 4 |
+
a: Sequence[float]
|
| 5 |
+
b: list[complex]
|
| 6 |
+
c: tuple[str, ...]
|
| 7 |
+
d: int
|
| 8 |
+
e: str
|
| 9 |
+
|
| 10 |
+
def func(a: _NestedSequence[int]) -> None:
|
| 11 |
+
...
|
| 12 |
+
|
| 13 |
+
reveal_type(func(a)) # E: incompatible type
|
| 14 |
+
reveal_type(func(b)) # E: incompatible type
|
| 15 |
+
reveal_type(func(c)) # E: incompatible type
|
| 16 |
+
reveal_type(func(d)) # E: incompatible type
|
| 17 |
+
reveal_type(func(e)) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/npyio.pyi
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pathlib
|
| 2 |
+
from typing import IO
|
| 3 |
+
|
| 4 |
+
import numpy.typing as npt
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
str_path: str
|
| 8 |
+
bytes_path: bytes
|
| 9 |
+
pathlib_path: pathlib.Path
|
| 10 |
+
str_file: IO[str]
|
| 11 |
+
AR_i8: npt.NDArray[np.int64]
|
| 12 |
+
|
| 13 |
+
np.load(str_file) # E: incompatible type
|
| 14 |
+
|
| 15 |
+
np.save(bytes_path, AR_i8) # E: incompatible type
|
| 16 |
+
np.save(str_file, AR_i8) # E: incompatible type
|
| 17 |
+
|
| 18 |
+
np.savez(bytes_path, AR_i8) # E: incompatible type
|
| 19 |
+
np.savez(str_file, AR_i8) # E: incompatible type
|
| 20 |
+
|
| 21 |
+
np.savez_compressed(bytes_path, AR_i8) # E: incompatible type
|
| 22 |
+
np.savez_compressed(str_file, AR_i8) # E: incompatible type
|
| 23 |
+
|
| 24 |
+
np.loadtxt(bytes_path) # E: incompatible type
|
| 25 |
+
|
| 26 |
+
np.fromregex(bytes_path, ".", np.int64) # E: No overload variant
|
| 27 |
+
|
| 28 |
+
np.recfromtxt(bytes_path) # E: incompatible type
|
| 29 |
+
|
| 30 |
+
np.recfromcsv(bytes_path) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/numerictypes.pyi
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
# Technically this works, but probably shouldn't. See
|
| 4 |
+
#
|
| 5 |
+
# https://github.com/numpy/numpy/issues/16366
|
| 6 |
+
#
|
| 7 |
+
np.maximum_sctype(1) # E: No overload variant
|
| 8 |
+
|
| 9 |
+
np.issubsctype(1, np.int64) # E: incompatible type
|
| 10 |
+
|
| 11 |
+
np.issubdtype(1, np.int64) # E: incompatible type
|
| 12 |
+
|
| 13 |
+
np.find_common_type(np.int64, np.int64) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/random.pyi
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
from typing import Any
|
| 3 |
+
|
| 4 |
+
SEED_FLOAT: float = 457.3
|
| 5 |
+
SEED_ARR_FLOAT: np.ndarray[Any, np.dtype[np.float64]] = np.array([1.0, 2, 3, 4])
|
| 6 |
+
SEED_ARRLIKE_FLOAT: list[float] = [1.0, 2.0, 3.0, 4.0]
|
| 7 |
+
SEED_SEED_SEQ: np.random.SeedSequence = np.random.SeedSequence(0)
|
| 8 |
+
SEED_STR: str = "String seeding not allowed"
|
| 9 |
+
# default rng
|
| 10 |
+
np.random.default_rng(SEED_FLOAT) # E: incompatible type
|
| 11 |
+
np.random.default_rng(SEED_ARR_FLOAT) # E: incompatible type
|
| 12 |
+
np.random.default_rng(SEED_ARRLIKE_FLOAT) # E: incompatible type
|
| 13 |
+
np.random.default_rng(SEED_STR) # E: incompatible type
|
| 14 |
+
|
| 15 |
+
# Seed Sequence
|
| 16 |
+
np.random.SeedSequence(SEED_FLOAT) # E: incompatible type
|
| 17 |
+
np.random.SeedSequence(SEED_ARR_FLOAT) # E: incompatible type
|
| 18 |
+
np.random.SeedSequence(SEED_ARRLIKE_FLOAT) # E: incompatible type
|
| 19 |
+
np.random.SeedSequence(SEED_SEED_SEQ) # E: incompatible type
|
| 20 |
+
np.random.SeedSequence(SEED_STR) # E: incompatible type
|
| 21 |
+
|
| 22 |
+
seed_seq: np.random.bit_generator.SeedSequence = np.random.SeedSequence()
|
| 23 |
+
seed_seq.spawn(11.5) # E: incompatible type
|
| 24 |
+
seed_seq.generate_state(3.14) # E: incompatible type
|
| 25 |
+
seed_seq.generate_state(3, np.uint8) # E: incompatible type
|
| 26 |
+
seed_seq.generate_state(3, "uint8") # E: incompatible type
|
| 27 |
+
seed_seq.generate_state(3, "u1") # E: incompatible type
|
| 28 |
+
seed_seq.generate_state(3, np.uint16) # E: incompatible type
|
| 29 |
+
seed_seq.generate_state(3, "uint16") # E: incompatible type
|
| 30 |
+
seed_seq.generate_state(3, "u2") # E: incompatible type
|
| 31 |
+
seed_seq.generate_state(3, np.int32) # E: incompatible type
|
| 32 |
+
seed_seq.generate_state(3, "int32") # E: incompatible type
|
| 33 |
+
seed_seq.generate_state(3, "i4") # E: incompatible type
|
| 34 |
+
|
| 35 |
+
# Bit Generators
|
| 36 |
+
np.random.MT19937(SEED_FLOAT) # E: incompatible type
|
| 37 |
+
np.random.MT19937(SEED_ARR_FLOAT) # E: incompatible type
|
| 38 |
+
np.random.MT19937(SEED_ARRLIKE_FLOAT) # E: incompatible type
|
| 39 |
+
np.random.MT19937(SEED_STR) # E: incompatible type
|
| 40 |
+
|
| 41 |
+
np.random.PCG64(SEED_FLOAT) # E: incompatible type
|
| 42 |
+
np.random.PCG64(SEED_ARR_FLOAT) # E: incompatible type
|
| 43 |
+
np.random.PCG64(SEED_ARRLIKE_FLOAT) # E: incompatible type
|
| 44 |
+
np.random.PCG64(SEED_STR) # E: incompatible type
|
| 45 |
+
|
| 46 |
+
np.random.Philox(SEED_FLOAT) # E: incompatible type
|
| 47 |
+
np.random.Philox(SEED_ARR_FLOAT) # E: incompatible type
|
| 48 |
+
np.random.Philox(SEED_ARRLIKE_FLOAT) # E: incompatible type
|
| 49 |
+
np.random.Philox(SEED_STR) # E: incompatible type
|
| 50 |
+
|
| 51 |
+
np.random.SFC64(SEED_FLOAT) # E: incompatible type
|
| 52 |
+
np.random.SFC64(SEED_ARR_FLOAT) # E: incompatible type
|
| 53 |
+
np.random.SFC64(SEED_ARRLIKE_FLOAT) # E: incompatible type
|
| 54 |
+
np.random.SFC64(SEED_STR) # E: incompatible type
|
| 55 |
+
|
| 56 |
+
# Generator
|
| 57 |
+
np.random.Generator(None) # E: incompatible type
|
| 58 |
+
np.random.Generator(12333283902830213) # E: incompatible type
|
| 59 |
+
np.random.Generator("OxFEEDF00D") # E: incompatible type
|
| 60 |
+
np.random.Generator([123, 234]) # E: incompatible type
|
| 61 |
+
np.random.Generator(np.array([123, 234], dtype="u4")) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/rec.pyi
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_i8: npt.NDArray[np.int64]
|
| 5 |
+
|
| 6 |
+
np.rec.fromarrays(1) # E: No overload variant
|
| 7 |
+
np.rec.fromarrays([1, 2, 3], dtype=[("f8", "f8")], formats=["f8", "f8"]) # E: No overload variant
|
| 8 |
+
|
| 9 |
+
np.rec.fromrecords(AR_i8) # E: incompatible type
|
| 10 |
+
np.rec.fromrecords([(1.5,)], dtype=[("f8", "f8")], formats=["f8", "f8"]) # E: No overload variant
|
| 11 |
+
|
| 12 |
+
np.rec.fromstring("string", dtype=[("f8", "f8")]) # E: No overload variant
|
| 13 |
+
np.rec.fromstring(b"bytes") # E: No overload variant
|
| 14 |
+
np.rec.fromstring(b"(1.5,)", dtype=[("f8", "f8")], formats=["f8", "f8"]) # E: No overload variant
|
| 15 |
+
|
| 16 |
+
with open("test", "r") as f:
|
| 17 |
+
np.rec.fromfile(f, dtype=[("f8", "f8")]) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/scalars.pyi
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
f2: np.float16
|
| 5 |
+
f8: np.float64
|
| 6 |
+
c8: np.complex64
|
| 7 |
+
|
| 8 |
+
# Construction
|
| 9 |
+
|
| 10 |
+
np.float32(3j) # E: incompatible type
|
| 11 |
+
|
| 12 |
+
# Technically the following examples are valid NumPy code. But they
|
| 13 |
+
# are not considered a best practice, and people who wish to use the
|
| 14 |
+
# stubs should instead do
|
| 15 |
+
#
|
| 16 |
+
# np.array([1.0, 0.0, 0.0], dtype=np.float32)
|
| 17 |
+
# np.array([], dtype=np.complex64)
|
| 18 |
+
#
|
| 19 |
+
# See e.g. the discussion on the mailing list
|
| 20 |
+
#
|
| 21 |
+
# https://mail.python.org/pipermail/numpy-discussion/2020-April/080566.html
|
| 22 |
+
#
|
| 23 |
+
# and the issue
|
| 24 |
+
#
|
| 25 |
+
# https://github.com/numpy/numpy-stubs/issues/41
|
| 26 |
+
#
|
| 27 |
+
# for more context.
|
| 28 |
+
np.float32([1.0, 0.0, 0.0]) # E: incompatible type
|
| 29 |
+
np.complex64([]) # E: incompatible type
|
| 30 |
+
|
| 31 |
+
np.complex64(1, 2) # E: Too many arguments
|
| 32 |
+
# TODO: protocols (can't check for non-existent protocols w/ __getattr__)
|
| 33 |
+
|
| 34 |
+
np.datetime64(0) # E: No overload variant
|
| 35 |
+
|
| 36 |
+
class A:
|
| 37 |
+
def __float__(self):
|
| 38 |
+
return 1.0
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
np.int8(A()) # E: incompatible type
|
| 42 |
+
np.int16(A()) # E: incompatible type
|
| 43 |
+
np.int32(A()) # E: incompatible type
|
| 44 |
+
np.int64(A()) # E: incompatible type
|
| 45 |
+
np.uint8(A()) # E: incompatible type
|
| 46 |
+
np.uint16(A()) # E: incompatible type
|
| 47 |
+
np.uint32(A()) # E: incompatible type
|
| 48 |
+
np.uint64(A()) # E: incompatible type
|
| 49 |
+
|
| 50 |
+
np.void("test") # E: No overload variant
|
| 51 |
+
np.void("test", dtype=None) # E: No overload variant
|
| 52 |
+
|
| 53 |
+
np.generic(1) # E: Cannot instantiate abstract class
|
| 54 |
+
np.number(1) # E: Cannot instantiate abstract class
|
| 55 |
+
np.integer(1) # E: Cannot instantiate abstract class
|
| 56 |
+
np.inexact(1) # E: Cannot instantiate abstract class
|
| 57 |
+
np.character("test") # E: Cannot instantiate abstract class
|
| 58 |
+
np.flexible(b"test") # E: Cannot instantiate abstract class
|
| 59 |
+
|
| 60 |
+
np.float64(value=0.0) # E: Unexpected keyword argument
|
| 61 |
+
np.int64(value=0) # E: Unexpected keyword argument
|
| 62 |
+
np.uint64(value=0) # E: Unexpected keyword argument
|
| 63 |
+
np.complex128(value=0.0j) # E: Unexpected keyword argument
|
| 64 |
+
np.str_(value='bob') # E: No overload variant
|
| 65 |
+
np.bytes_(value=b'test') # E: No overload variant
|
| 66 |
+
np.void(value=b'test') # E: No overload variant
|
| 67 |
+
np.bool_(value=True) # E: Unexpected keyword argument
|
| 68 |
+
np.datetime64(value="2019") # E: No overload variant
|
| 69 |
+
np.timedelta64(value=0) # E: Unexpected keyword argument
|
| 70 |
+
|
| 71 |
+
np.bytes_(b"hello", encoding='utf-8') # E: No overload variant
|
| 72 |
+
np.str_("hello", encoding='utf-8') # E: No overload variant
|
| 73 |
+
|
| 74 |
+
f8.item(1) # E: incompatible type
|
| 75 |
+
f8.item((0, 1)) # E: incompatible type
|
| 76 |
+
f8.squeeze(axis=1) # E: incompatible type
|
| 77 |
+
f8.squeeze(axis=(0, 1)) # E: incompatible type
|
| 78 |
+
f8.transpose(1) # E: incompatible type
|
| 79 |
+
|
| 80 |
+
def func(a: np.float32) -> None: ...
|
| 81 |
+
|
| 82 |
+
func(f2) # E: incompatible type
|
| 83 |
+
func(f8) # E: incompatible type
|
| 84 |
+
|
| 85 |
+
round(c8) # E: No overload variant
|
| 86 |
+
|
| 87 |
+
c8.__getnewargs__() # E: Invalid self argument
|
| 88 |
+
f2.__getnewargs__() # E: Invalid self argument
|
| 89 |
+
f2.hex() # E: Invalid self argument
|
| 90 |
+
np.float16.fromhex("0x0.0p+0") # E: Invalid self argument
|
| 91 |
+
f2.__trunc__() # E: Invalid self argument
|
| 92 |
+
f2.__getformat__("float") # E: Invalid self argument
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/shape_base.pyi
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
class DTypeLike:
|
| 4 |
+
dtype: np.dtype[np.int_]
|
| 5 |
+
|
| 6 |
+
dtype_like: DTypeLike
|
| 7 |
+
|
| 8 |
+
np.expand_dims(dtype_like, (5, 10)) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/stride_tricks.pyi
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_f8: npt.NDArray[np.float64]
|
| 5 |
+
|
| 6 |
+
np.lib.stride_tricks.as_strided(AR_f8, shape=8) # E: No overload variant
|
| 7 |
+
np.lib.stride_tricks.as_strided(AR_f8, strides=8) # E: No overload variant
|
| 8 |
+
|
| 9 |
+
np.lib.stride_tricks.sliding_window_view(AR_f8, axis=(1,)) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/testing.pyi
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_U: npt.NDArray[np.str_]
|
| 5 |
+
|
| 6 |
+
def func() -> bool: ...
|
| 7 |
+
|
| 8 |
+
np.testing.assert_(True, msg=1) # E: incompatible type
|
| 9 |
+
np.testing.build_err_msg(1, "test") # E: incompatible type
|
| 10 |
+
np.testing.assert_almost_equal(AR_U, AR_U) # E: incompatible type
|
| 11 |
+
np.testing.assert_approx_equal([1, 2, 3], [1, 2, 3]) # E: incompatible type
|
| 12 |
+
np.testing.assert_array_almost_equal(AR_U, AR_U) # E: incompatible type
|
| 13 |
+
np.testing.assert_array_less(AR_U, AR_U) # E: incompatible type
|
| 14 |
+
np.testing.assert_string_equal(b"a", b"a") # E: incompatible type
|
| 15 |
+
|
| 16 |
+
np.testing.assert_raises(expected_exception=TypeError, callable=func) # E: No overload variant
|
| 17 |
+
np.testing.assert_raises_regex(expected_exception=TypeError, expected_regex="T", callable=func) # E: No overload variant
|
| 18 |
+
|
| 19 |
+
np.testing.assert_allclose(AR_U, AR_U) # E: incompatible type
|
| 20 |
+
np.testing.assert_array_almost_equal_nulp(AR_U, AR_U) # E: incompatible type
|
| 21 |
+
np.testing.assert_array_max_ulp(AR_U, AR_U) # E: incompatible type
|
| 22 |
+
|
| 23 |
+
np.testing.assert_warns(warning_class=RuntimeWarning, func=func) # E: No overload variant
|
| 24 |
+
np.testing.assert_no_warnings(func=func) # E: No overload variant
|
| 25 |
+
np.testing.assert_no_warnings(func, None) # E: Too many arguments
|
| 26 |
+
np.testing.assert_no_warnings(func, test=None) # E: Unexpected keyword argument
|
| 27 |
+
|
| 28 |
+
np.testing.assert_no_gc_cycles(func=func) # E: No overload variant
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/twodim_base.pyi
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, TypeVar
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
import numpy.typing as npt
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def func1(ar: npt.NDArray[Any], a: int) -> npt.NDArray[np.str_]:
|
| 8 |
+
pass
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def func2(ar: npt.NDArray[Any], a: float) -> float:
|
| 12 |
+
pass
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
AR_b: npt.NDArray[np.bool_]
|
| 16 |
+
AR_m: npt.NDArray[np.timedelta64]
|
| 17 |
+
|
| 18 |
+
AR_LIKE_b: list[bool]
|
| 19 |
+
|
| 20 |
+
np.eye(10, M=20.0) # E: No overload variant
|
| 21 |
+
np.eye(10, k=2.5, dtype=int) # E: No overload variant
|
| 22 |
+
|
| 23 |
+
np.diag(AR_b, k=0.5) # E: No overload variant
|
| 24 |
+
np.diagflat(AR_b, k=0.5) # E: No overload variant
|
| 25 |
+
|
| 26 |
+
np.tri(10, M=20.0) # E: No overload variant
|
| 27 |
+
np.tri(10, k=2.5, dtype=int) # E: No overload variant
|
| 28 |
+
|
| 29 |
+
np.tril(AR_b, k=0.5) # E: No overload variant
|
| 30 |
+
np.triu(AR_b, k=0.5) # E: No overload variant
|
| 31 |
+
|
| 32 |
+
np.vander(AR_m) # E: incompatible type
|
| 33 |
+
|
| 34 |
+
np.histogram2d(AR_m) # E: No overload variant
|
| 35 |
+
|
| 36 |
+
np.mask_indices(10, func1) # E: incompatible type
|
| 37 |
+
np.mask_indices(10, func2, 10.5) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/type_check.pyi
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
DTYPE_i8: np.dtype[np.int64]
|
| 5 |
+
|
| 6 |
+
np.mintypecode(DTYPE_i8) # E: incompatible type
|
| 7 |
+
np.iscomplexobj(DTYPE_i8) # E: incompatible type
|
| 8 |
+
np.isrealobj(DTYPE_i8) # E: incompatible type
|
| 9 |
+
|
| 10 |
+
np.typename(DTYPE_i8) # E: No overload variant
|
| 11 |
+
np.typename("invalid") # E: No overload variant
|
| 12 |
+
|
| 13 |
+
np.common_type(np.timedelta64()) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ufunc_config.pyi
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Typing tests for `numpy.core._ufunc_config`."""
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
def func1(a: str, b: int, c: float) -> None: ...
|
| 6 |
+
def func2(a: str, *, b: int) -> None: ...
|
| 7 |
+
|
| 8 |
+
class Write1:
|
| 9 |
+
def write1(self, a: str) -> None: ...
|
| 10 |
+
|
| 11 |
+
class Write2:
|
| 12 |
+
def write(self, a: str, b: str) -> None: ...
|
| 13 |
+
|
| 14 |
+
class Write3:
|
| 15 |
+
def write(self, *, a: str) -> None: ...
|
| 16 |
+
|
| 17 |
+
np.seterrcall(func1) # E: Argument 1 to "seterrcall" has incompatible type
|
| 18 |
+
np.seterrcall(func2) # E: Argument 1 to "seterrcall" has incompatible type
|
| 19 |
+
np.seterrcall(Write1()) # E: Argument 1 to "seterrcall" has incompatible type
|
| 20 |
+
np.seterrcall(Write2()) # E: Argument 1 to "seterrcall" has incompatible type
|
| 21 |
+
np.seterrcall(Write3()) # E: Argument 1 to "seterrcall" has incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ufunclike.pyi
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
AR_c: np.ndarray[Any, np.dtype[np.complex128]]
|
| 5 |
+
AR_m: np.ndarray[Any, np.dtype[np.timedelta64]]
|
| 6 |
+
AR_M: np.ndarray[Any, np.dtype[np.datetime64]]
|
| 7 |
+
AR_O: np.ndarray[Any, np.dtype[np.object_]]
|
| 8 |
+
|
| 9 |
+
np.fix(AR_c) # E: incompatible type
|
| 10 |
+
np.fix(AR_m) # E: incompatible type
|
| 11 |
+
np.fix(AR_M) # E: incompatible type
|
| 12 |
+
|
| 13 |
+
np.isposinf(AR_c) # E: incompatible type
|
| 14 |
+
np.isposinf(AR_m) # E: incompatible type
|
| 15 |
+
np.isposinf(AR_M) # E: incompatible type
|
| 16 |
+
np.isposinf(AR_O) # E: incompatible type
|
| 17 |
+
|
| 18 |
+
np.isneginf(AR_c) # E: incompatible type
|
| 19 |
+
np.isneginf(AR_m) # E: incompatible type
|
| 20 |
+
np.isneginf(AR_M) # E: incompatible type
|
| 21 |
+
np.isneginf(AR_O) # E: incompatible type
|
evalkit_tf449/lib/python3.10/site-packages/numpy/typing/tests/data/fail/ufuncs.pyi
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_f8: npt.NDArray[np.float64]
|
| 5 |
+
|
| 6 |
+
np.sin.nin + "foo" # E: Unsupported operand types
|
| 7 |
+
np.sin(1, foo="bar") # E: No overload variant
|
| 8 |
+
|
| 9 |
+
np.abs(None) # E: No overload variant
|
| 10 |
+
|
| 11 |
+
np.add(1, 1, 1) # E: No overload variant
|
| 12 |
+
np.add(1, 1, axis=0) # E: No overload variant
|
| 13 |
+
|
| 14 |
+
np.matmul(AR_f8, AR_f8, where=True) # E: No overload variant
|
| 15 |
+
|
| 16 |
+
np.frexp(AR_f8, out=None) # E: No overload variant
|
| 17 |
+
np.frexp(AR_f8, out=AR_f8) # E: No overload variant
|
| 18 |
+
|
| 19 |
+
np.absolute.outer() # E: "None" not callable
|
| 20 |
+
np.frexp.outer() # E: "None" not callable
|
| 21 |
+
np.divmod.outer() # E: "None" not callable
|
| 22 |
+
np.matmul.outer() # E: "None" not callable
|
| 23 |
+
|
| 24 |
+
np.absolute.reduceat() # E: "None" not callable
|
| 25 |
+
np.frexp.reduceat() # E: "None" not callable
|
| 26 |
+
np.divmod.reduceat() # E: "None" not callable
|
| 27 |
+
np.matmul.reduceat() # E: "None" not callable
|
| 28 |
+
|
| 29 |
+
np.absolute.reduce() # E: "None" not callable
|
| 30 |
+
np.frexp.reduce() # E: "None" not callable
|
| 31 |
+
np.divmod.reduce() # E: "None" not callable
|
| 32 |
+
np.matmul.reduce() # E: "None" not callable
|
| 33 |
+
|
| 34 |
+
np.absolute.accumulate() # E: "None" not callable
|
| 35 |
+
np.frexp.accumulate() # E: "None" not callable
|
| 36 |
+
np.divmod.accumulate() # E: "None" not callable
|
| 37 |
+
np.matmul.accumulate() # E: "None" not callable
|
| 38 |
+
|
| 39 |
+
np.frexp.at() # E: "None" not callable
|
| 40 |
+
np.divmod.at() # E: "None" not callable
|
| 41 |
+
np.matmul.at() # E: "None" not callable
|