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 +2 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/__pycache__/__init__.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/__main__.py +5 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/compat/__pycache__/__init__.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/compat/__pycache__/py38.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/compat/py38.py +24 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/INSTALLER +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/LICENSE +17 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/METADATA +64 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/RECORD +10 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/WHEEL +5 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/top_level.txt +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/INSTALLER +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/LICENSE +17 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/METADATA +95 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/top_level.txt +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/INSTALLER +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/LICENSE +19 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/METADATA +266 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/RECORD +16 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/REQUESTED +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/WHEEL +4 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.py +6 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.pyi +2 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__pycache__/more.cpython-310.pyc +3 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.pyi +709 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/py.typed +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/recipes.py +1046 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/_elffile.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/_parser.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/markers.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/metadata.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/tags.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-310.pyc +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/INSTALLER +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/LICENSE +21 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/METADATA +206 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/RECORD +15 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/REQUESTED +0 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/WHEEL +4 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/INSTALLER +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/LICENSE +19 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/METADATA +81 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/RECORD +34 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/WHEEL +5 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/top_level.txt +1 -0
- falcon/lib/python3.10/site-packages/setuptools/_vendor/wheel/__main__.py +23 -0
.gitattributes
CHANGED
|
@@ -1276,3 +1276,5 @@ falcon/lib/python3.10/site-packages/torch/sparse/__pycache__/_triton_ops_meta.cp
|
|
| 1276 |
evalkit_tf437/lib/python3.10/site-packages/transformers/utils/__pycache__/dummy_tf_objects.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1277 |
evalkit_tf437/lib/python3.10/site-packages/transformers/__pycache__/training_args.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1278 |
evalkit_tf437/lib/python3.10/site-packages/transformers/__pycache__/modeling_outputs.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 1276 |
evalkit_tf437/lib/python3.10/site-packages/transformers/utils/__pycache__/dummy_tf_objects.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1277 |
evalkit_tf437/lib/python3.10/site-packages/transformers/__pycache__/training_args.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1278 |
evalkit_tf437/lib/python3.10/site-packages/transformers/__pycache__/modeling_outputs.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 1279 |
+
infer_4_33_0/lib/python3.10/site-packages/nvidia/cuda_nvrtc/lib/libnvrtc.so.11.2 filter=lfs diff=lfs merge=lfs -text
|
| 1280 |
+
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__pycache__/more.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (229 Bytes). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/__main__.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from . import main
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
if __name__ == '__main__':
|
| 5 |
+
main()
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/compat/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (177 Bytes). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/compat/__pycache__/py38.cpython-310.pyc
ADDED
|
Binary file (759 Bytes). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/backports/tarfile/compat/py38.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
if sys.version_info < (3, 9):
|
| 5 |
+
|
| 6 |
+
def removesuffix(self, suffix):
|
| 7 |
+
# suffix='' should not call self[:-0].
|
| 8 |
+
if suffix and self.endswith(suffix):
|
| 9 |
+
return self[: -len(suffix)]
|
| 10 |
+
else:
|
| 11 |
+
return self[:]
|
| 12 |
+
|
| 13 |
+
def removeprefix(self, prefix):
|
| 14 |
+
if self.startswith(prefix):
|
| 15 |
+
return self[len(prefix) :]
|
| 16 |
+
else:
|
| 17 |
+
return self[:]
|
| 18 |
+
else:
|
| 19 |
+
|
| 20 |
+
def removesuffix(self, suffix):
|
| 21 |
+
return self.removesuffix(suffix)
|
| 22 |
+
|
| 23 |
+
def removeprefix(self, prefix):
|
| 24 |
+
return self.removeprefix(prefix)
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 2 |
+
of this software and associated documentation files (the "Software"), to
|
| 3 |
+
deal in the Software without restriction, including without limitation the
|
| 4 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 5 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
| 6 |
+
furnished to do so, subject to the following conditions:
|
| 7 |
+
|
| 8 |
+
The above copyright notice and this permission notice shall be included in
|
| 9 |
+
all copies or substantial portions of the Software.
|
| 10 |
+
|
| 11 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 12 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 13 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 14 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 15 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 16 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| 17 |
+
IN THE SOFTWARE.
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/METADATA
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: jaraco.functools
|
| 3 |
+
Version: 4.0.1
|
| 4 |
+
Summary: Functools like those found in stdlib
|
| 5 |
+
Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
|
| 6 |
+
Project-URL: Homepage, https://github.com/jaraco/jaraco.functools
|
| 7 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 8 |
+
Classifier: Intended Audience :: Developers
|
| 9 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 10 |
+
Classifier: Programming Language :: Python :: 3
|
| 11 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 12 |
+
Requires-Python: >=3.8
|
| 13 |
+
Description-Content-Type: text/x-rst
|
| 14 |
+
License-File: LICENSE
|
| 15 |
+
Requires-Dist: more-itertools
|
| 16 |
+
Provides-Extra: docs
|
| 17 |
+
Requires-Dist: sphinx >=3.5 ; extra == 'docs'
|
| 18 |
+
Requires-Dist: sphinx <7.2.5 ; extra == 'docs'
|
| 19 |
+
Requires-Dist: jaraco.packaging >=9.3 ; extra == 'docs'
|
| 20 |
+
Requires-Dist: rst.linker >=1.9 ; extra == 'docs'
|
| 21 |
+
Requires-Dist: furo ; extra == 'docs'
|
| 22 |
+
Requires-Dist: sphinx-lint ; extra == 'docs'
|
| 23 |
+
Requires-Dist: jaraco.tidelift >=1.4 ; extra == 'docs'
|
| 24 |
+
Provides-Extra: testing
|
| 25 |
+
Requires-Dist: pytest >=6 ; extra == 'testing'
|
| 26 |
+
Requires-Dist: pytest-checkdocs >=2.4 ; extra == 'testing'
|
| 27 |
+
Requires-Dist: pytest-cov ; extra == 'testing'
|
| 28 |
+
Requires-Dist: pytest-enabler >=2.2 ; extra == 'testing'
|
| 29 |
+
Requires-Dist: pytest-ruff >=0.2.1 ; extra == 'testing'
|
| 30 |
+
Requires-Dist: jaraco.classes ; extra == 'testing'
|
| 31 |
+
Requires-Dist: pytest-mypy ; (platform_python_implementation != "PyPy") and extra == 'testing'
|
| 32 |
+
|
| 33 |
+
.. image:: https://img.shields.io/pypi/v/jaraco.functools.svg
|
| 34 |
+
:target: https://pypi.org/project/jaraco.functools
|
| 35 |
+
|
| 36 |
+
.. image:: https://img.shields.io/pypi/pyversions/jaraco.functools.svg
|
| 37 |
+
|
| 38 |
+
.. image:: https://github.com/jaraco/jaraco.functools/actions/workflows/main.yml/badge.svg
|
| 39 |
+
:target: https://github.com/jaraco/jaraco.functools/actions?query=workflow%3A%22tests%22
|
| 40 |
+
:alt: tests
|
| 41 |
+
|
| 42 |
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
|
| 43 |
+
:target: https://github.com/astral-sh/ruff
|
| 44 |
+
:alt: Ruff
|
| 45 |
+
|
| 46 |
+
.. image:: https://readthedocs.org/projects/jaracofunctools/badge/?version=latest
|
| 47 |
+
:target: https://jaracofunctools.readthedocs.io/en/latest/?badge=latest
|
| 48 |
+
|
| 49 |
+
.. image:: https://img.shields.io/badge/skeleton-2024-informational
|
| 50 |
+
:target: https://blog.jaraco.com/skeleton
|
| 51 |
+
|
| 52 |
+
.. image:: https://tidelift.com/badges/package/pypi/jaraco.functools
|
| 53 |
+
:target: https://tidelift.com/subscription/pkg/pypi-jaraco.functools?utm_source=pypi-jaraco.functools&utm_medium=readme
|
| 54 |
+
|
| 55 |
+
Additional functools in the spirit of stdlib's functools.
|
| 56 |
+
|
| 57 |
+
For Enterprise
|
| 58 |
+
==============
|
| 59 |
+
|
| 60 |
+
Available as part of the Tidelift Subscription.
|
| 61 |
+
|
| 62 |
+
This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
|
| 63 |
+
|
| 64 |
+
`Learn more <https://tidelift.com/subscription/pkg/pypi-jaraco.functools?utm_source=pypi-jaraco.functools&utm_medium=referral&utm_campaign=github>`_.
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/RECORD
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
jaraco.functools-4.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
jaraco.functools-4.0.1.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 3 |
+
jaraco.functools-4.0.1.dist-info/METADATA,sha256=i4aUaQDX-jjdEQK5wevhegyx8JyLfin2HyvaSk3FHso,2891
|
| 4 |
+
jaraco.functools-4.0.1.dist-info/RECORD,,
|
| 5 |
+
jaraco.functools-4.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 6 |
+
jaraco.functools-4.0.1.dist-info/top_level.txt,sha256=0JnN3LfXH4LIRfXL-QFOGCJzQWZO3ELx4R1d_louoQM,7
|
| 7 |
+
jaraco/functools/__init__.py,sha256=hEAJaS2uSZRuF_JY4CxCHIYh79ZpxaPp9OiHyr9EJ1w,16642
|
| 8 |
+
jaraco/functools/__init__.pyi,sha256=gk3dsgHzo5F_U74HzAvpNivFAPCkPJ1b2-yCd62dfnw,3878
|
| 9 |
+
jaraco/functools/__pycache__/__init__.cpython-312.pyc,,
|
| 10 |
+
jaraco/functools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.43.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
jaraco
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 2 |
+
of this software and associated documentation files (the "Software"), to
|
| 3 |
+
deal in the Software without restriction, including without limitation the
|
| 4 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 5 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
| 6 |
+
furnished to do so, subject to the following conditions:
|
| 7 |
+
|
| 8 |
+
The above copyright notice and this permission notice shall be included in
|
| 9 |
+
all copies or substantial portions of the Software.
|
| 10 |
+
|
| 11 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 12 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 13 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 14 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 15 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 16 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| 17 |
+
IN THE SOFTWARE.
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/METADATA
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: jaraco.text
|
| 3 |
+
Version: 3.12.1
|
| 4 |
+
Summary: Module for text manipulation
|
| 5 |
+
Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
|
| 6 |
+
Project-URL: Homepage, https://github.com/jaraco/jaraco.text
|
| 7 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 8 |
+
Classifier: Intended Audience :: Developers
|
| 9 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 10 |
+
Classifier: Programming Language :: Python :: 3
|
| 11 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 12 |
+
Requires-Python: >=3.8
|
| 13 |
+
Description-Content-Type: text/x-rst
|
| 14 |
+
License-File: LICENSE
|
| 15 |
+
Requires-Dist: jaraco.functools
|
| 16 |
+
Requires-Dist: jaraco.context >=4.1
|
| 17 |
+
Requires-Dist: autocommand
|
| 18 |
+
Requires-Dist: inflect
|
| 19 |
+
Requires-Dist: more-itertools
|
| 20 |
+
Requires-Dist: importlib-resources ; python_version < "3.9"
|
| 21 |
+
Provides-Extra: doc
|
| 22 |
+
Requires-Dist: sphinx >=3.5 ; extra == 'doc'
|
| 23 |
+
Requires-Dist: jaraco.packaging >=9.3 ; extra == 'doc'
|
| 24 |
+
Requires-Dist: rst.linker >=1.9 ; extra == 'doc'
|
| 25 |
+
Requires-Dist: furo ; extra == 'doc'
|
| 26 |
+
Requires-Dist: sphinx-lint ; extra == 'doc'
|
| 27 |
+
Requires-Dist: jaraco.tidelift >=1.4 ; extra == 'doc'
|
| 28 |
+
Provides-Extra: test
|
| 29 |
+
Requires-Dist: pytest !=8.1.*,>=6 ; extra == 'test'
|
| 30 |
+
Requires-Dist: pytest-checkdocs >=2.4 ; extra == 'test'
|
| 31 |
+
Requires-Dist: pytest-cov ; extra == 'test'
|
| 32 |
+
Requires-Dist: pytest-mypy ; extra == 'test'
|
| 33 |
+
Requires-Dist: pytest-enabler >=2.2 ; extra == 'test'
|
| 34 |
+
Requires-Dist: pytest-ruff >=0.2.1 ; extra == 'test'
|
| 35 |
+
Requires-Dist: pathlib2 ; (python_version < "3.10") and extra == 'test'
|
| 36 |
+
|
| 37 |
+
.. image:: https://img.shields.io/pypi/v/jaraco.text.svg
|
| 38 |
+
:target: https://pypi.org/project/jaraco.text
|
| 39 |
+
|
| 40 |
+
.. image:: https://img.shields.io/pypi/pyversions/jaraco.text.svg
|
| 41 |
+
|
| 42 |
+
.. image:: https://github.com/jaraco/jaraco.text/actions/workflows/main.yml/badge.svg
|
| 43 |
+
:target: https://github.com/jaraco/jaraco.text/actions?query=workflow%3A%22tests%22
|
| 44 |
+
:alt: tests
|
| 45 |
+
|
| 46 |
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
|
| 47 |
+
:target: https://github.com/astral-sh/ruff
|
| 48 |
+
:alt: Ruff
|
| 49 |
+
|
| 50 |
+
.. image:: https://readthedocs.org/projects/jaracotext/badge/?version=latest
|
| 51 |
+
:target: https://jaracotext.readthedocs.io/en/latest/?badge=latest
|
| 52 |
+
|
| 53 |
+
.. image:: https://img.shields.io/badge/skeleton-2024-informational
|
| 54 |
+
:target: https://blog.jaraco.com/skeleton
|
| 55 |
+
|
| 56 |
+
.. image:: https://tidelift.com/badges/package/pypi/jaraco.text
|
| 57 |
+
:target: https://tidelift.com/subscription/pkg/pypi-jaraco.text?utm_source=pypi-jaraco.text&utm_medium=readme
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
This package provides handy routines for dealing with text, such as
|
| 61 |
+
wrapping, substitution, trimming, stripping, prefix and suffix removal,
|
| 62 |
+
line continuation, indentation, comment processing, identifier processing,
|
| 63 |
+
values parsing, case insensitive comparison, and more. See the docs
|
| 64 |
+
(linked in the badge above) for the detailed documentation and examples.
|
| 65 |
+
|
| 66 |
+
Layouts
|
| 67 |
+
=======
|
| 68 |
+
|
| 69 |
+
One of the features of this package is the layouts module, which
|
| 70 |
+
provides a simple example of translating keystrokes from one keyboard
|
| 71 |
+
layout to another::
|
| 72 |
+
|
| 73 |
+
echo qwerty | python -m jaraco.text.to-dvorak
|
| 74 |
+
',.pyf
|
| 75 |
+
echo "',.pyf" | python -m jaraco.text.to-qwerty
|
| 76 |
+
qwerty
|
| 77 |
+
|
| 78 |
+
Newline Reporting
|
| 79 |
+
=================
|
| 80 |
+
|
| 81 |
+
Need to know what newlines appear in a file?
|
| 82 |
+
|
| 83 |
+
::
|
| 84 |
+
|
| 85 |
+
$ python -m jaraco.text.show-newlines README.rst
|
| 86 |
+
newline is '\n'
|
| 87 |
+
|
| 88 |
+
For Enterprise
|
| 89 |
+
==============
|
| 90 |
+
|
| 91 |
+
Available as part of the Tidelift Subscription.
|
| 92 |
+
|
| 93 |
+
This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
|
| 94 |
+
|
| 95 |
+
`Learn more <https://tidelift.com/subscription/pkg/pypi-jaraco.text?utm_source=pypi-jaraco.text&utm_medium=referral&utm_campaign=github>`_.
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
jaraco
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2012 Erik Rose
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
| 4 |
+
this software and associated documentation files (the "Software"), to deal in
|
| 5 |
+
the Software without restriction, including without limitation the rights to
|
| 6 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
| 7 |
+
of the Software, and to permit persons to whom the Software is furnished to do
|
| 8 |
+
so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in all
|
| 11 |
+
copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECT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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: more-itertools
|
| 3 |
+
Version: 10.3.0
|
| 4 |
+
Summary: More routines for operating on iterables, beyond itertools
|
| 5 |
+
Keywords: itertools,iterator,iteration,filter,peek,peekable,chunk,chunked
|
| 6 |
+
Author-email: Erik Rose <erikrose@grinchcentral.com>
|
| 7 |
+
Requires-Python: >=3.8
|
| 8 |
+
Description-Content-Type: text/x-rst
|
| 9 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 10 |
+
Classifier: Intended Audience :: Developers
|
| 11 |
+
Classifier: Natural Language :: English
|
| 12 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 13 |
+
Classifier: Programming Language :: Python :: 3
|
| 14 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 15 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 19 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 20 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 21 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 22 |
+
Classifier: Topic :: Software Development :: Libraries
|
| 23 |
+
Project-URL: Homepage, https://github.com/more-itertools/more-itertools
|
| 24 |
+
|
| 25 |
+
==============
|
| 26 |
+
More Itertools
|
| 27 |
+
==============
|
| 28 |
+
|
| 29 |
+
.. image:: https://readthedocs.org/projects/more-itertools/badge/?version=latest
|
| 30 |
+
:target: https://more-itertools.readthedocs.io/en/stable/
|
| 31 |
+
|
| 32 |
+
Python's ``itertools`` library is a gem - you can compose elegant solutions
|
| 33 |
+
for a variety of problems with the functions it provides. In ``more-itertools``
|
| 34 |
+
we collect additional building blocks, recipes, and routines for working with
|
| 35 |
+
Python iterables.
|
| 36 |
+
|
| 37 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 38 |
+
| Grouping | `chunked <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chunked>`_, |
|
| 39 |
+
| | `ichunked <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ichunked>`_, |
|
| 40 |
+
| | `chunked_even <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chunked_even>`_, |
|
| 41 |
+
| | `sliced <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sliced>`_, |
|
| 42 |
+
| | `constrained_batches <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.constrained_batches>`_, |
|
| 43 |
+
| | `distribute <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.distribute>`_, |
|
| 44 |
+
| | `divide <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.divide>`_, |
|
| 45 |
+
| | `split_at <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_at>`_, |
|
| 46 |
+
| | `split_before <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_before>`_, |
|
| 47 |
+
| | `split_after <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_after>`_, |
|
| 48 |
+
| | `split_into <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_into>`_, |
|
| 49 |
+
| | `split_when <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.split_when>`_, |
|
| 50 |
+
| | `bucket <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.bucket>`_, |
|
| 51 |
+
| | `unzip <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unzip>`_, |
|
| 52 |
+
| | `batched <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.batched>`_, |
|
| 53 |
+
| | `grouper <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.grouper>`_, |
|
| 54 |
+
| | `partition <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.partition>`_, |
|
| 55 |
+
| | `transpose <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.transpose>`_ |
|
| 56 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 57 |
+
| Lookahead and lookback | `spy <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.spy>`_, |
|
| 58 |
+
| | `peekable <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.peekable>`_, |
|
| 59 |
+
| | `seekable <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.seekable>`_ |
|
| 60 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 61 |
+
| Windowing | `windowed <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.windowed>`_, |
|
| 62 |
+
| | `substrings <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.substrings>`_, |
|
| 63 |
+
| | `substrings_indexes <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.substrings_indexes>`_, |
|
| 64 |
+
| | `stagger <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.stagger>`_, |
|
| 65 |
+
| | `windowed_complete <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.windowed_complete>`_, |
|
| 66 |
+
| | `pairwise <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pairwise>`_, |
|
| 67 |
+
| | `triplewise <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.triplewise>`_, |
|
| 68 |
+
| | `sliding_window <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sliding_window>`_, |
|
| 69 |
+
| | `subslices <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.subslices>`_ |
|
| 70 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 71 |
+
| Augmenting | `count_cycle <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.count_cycle>`_, |
|
| 72 |
+
| | `intersperse <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.intersperse>`_, |
|
| 73 |
+
| | `padded <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.padded>`_, |
|
| 74 |
+
| | `repeat_each <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.repeat_each>`_, |
|
| 75 |
+
| | `mark_ends <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.mark_ends>`_, |
|
| 76 |
+
| | `repeat_last <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.repeat_last>`_, |
|
| 77 |
+
| | `adjacent <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.adjacent>`_, |
|
| 78 |
+
| | `groupby_transform <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.groupby_transform>`_, |
|
| 79 |
+
| | `pad_none <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pad_none>`_, |
|
| 80 |
+
| | `ncycles <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ncycles>`_ |
|
| 81 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 82 |
+
| Combining | `collapse <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.collapse>`_, |
|
| 83 |
+
| | `sort_together <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sort_together>`_, |
|
| 84 |
+
| | `interleave <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave>`_, |
|
| 85 |
+
| | `interleave_longest <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave_longest>`_, |
|
| 86 |
+
| | `interleave_evenly <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.interleave_evenly>`_, |
|
| 87 |
+
| | `zip_offset <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.zip_offset>`_, |
|
| 88 |
+
| | `zip_equal <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.zip_equal>`_, |
|
| 89 |
+
| | `zip_broadcast <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.zip_broadcast>`_, |
|
| 90 |
+
| | `flatten <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.flatten>`_, |
|
| 91 |
+
| | `roundrobin <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.roundrobin>`_, |
|
| 92 |
+
| | `prepend <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.prepend>`_, |
|
| 93 |
+
| | `value_chain <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.value_chain>`_, |
|
| 94 |
+
| | `partial_product <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.partial_product>`_ |
|
| 95 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 96 |
+
| Summarizing | `ilen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ilen>`_, |
|
| 97 |
+
| | `unique_to_each <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_to_each>`_, |
|
| 98 |
+
| | `sample <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sample>`_, |
|
| 99 |
+
| | `consecutive_groups <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.consecutive_groups>`_, |
|
| 100 |
+
| | `run_length <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.run_length>`_, |
|
| 101 |
+
| | `map_reduce <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.map_reduce>`_, |
|
| 102 |
+
| | `join_mappings <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.join_mappings>`_, |
|
| 103 |
+
| | `exactly_n <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.exactly_n>`_, |
|
| 104 |
+
| | `is_sorted <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.is_sorted>`_, |
|
| 105 |
+
| | `all_equal <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.all_equal>`_, |
|
| 106 |
+
| | `all_unique <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.all_unique>`_, |
|
| 107 |
+
| | `minmax <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.minmax>`_, |
|
| 108 |
+
| | `first_true <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.first_true>`_, |
|
| 109 |
+
| | `quantify <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.quantify>`_, |
|
| 110 |
+
| | `iequals <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iequals>`_ |
|
| 111 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 112 |
+
| Selecting | `islice_extended <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.islice_extended>`_, |
|
| 113 |
+
| | `first <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.first>`_, |
|
| 114 |
+
| | `last <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.last>`_, |
|
| 115 |
+
| | `one <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.one>`_, |
|
| 116 |
+
| | `only <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.only>`_, |
|
| 117 |
+
| | `strictly_n <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.strictly_n>`_, |
|
| 118 |
+
| | `strip <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.strip>`_, |
|
| 119 |
+
| | `lstrip <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.lstrip>`_, |
|
| 120 |
+
| | `rstrip <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.rstrip>`_, |
|
| 121 |
+
| | `filter_except <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.filter_except>`_, |
|
| 122 |
+
| | `map_except <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.map_except>`_, |
|
| 123 |
+
| | `filter_map <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.filter_map>`_, |
|
| 124 |
+
| | `iter_suppress <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iter_suppress>`_, |
|
| 125 |
+
| | `nth_or_last <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_or_last>`_, |
|
| 126 |
+
| | `unique_in_window <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_in_window>`_, |
|
| 127 |
+
| | `before_and_after <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.before_and_after>`_, |
|
| 128 |
+
| | `nth <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth>`_, |
|
| 129 |
+
| | `take <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.take>`_, |
|
| 130 |
+
| | `tail <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tail>`_, |
|
| 131 |
+
| | `unique_everseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_everseen>`_, |
|
| 132 |
+
| | `unique_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique_justseen>`_, |
|
| 133 |
+
| | `unique <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unique>`_, |
|
| 134 |
+
| | `duplicates_everseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.duplicates_everseen>`_, |
|
| 135 |
+
| | `duplicates_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.duplicates_justseen>`_, |
|
| 136 |
+
| | `classify_unique <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.classify_unique>`_, |
|
| 137 |
+
| | `longest_common_prefix <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.longest_common_prefix>`_, |
|
| 138 |
+
| | `takewhile_inclusive <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.takewhile_inclusive>`_ |
|
| 139 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 140 |
+
| Math | `dft <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dft>`_, |
|
| 141 |
+
| | `idft <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.idft>`_, |
|
| 142 |
+
| | `convolve <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.convolve>`_, |
|
| 143 |
+
| | `dotproduct <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dotproduct>`_, |
|
| 144 |
+
| | `factor <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.factor>`_, |
|
| 145 |
+
| | `matmul <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.matmul>`_, |
|
| 146 |
+
| | `polynomial_from_roots <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.polynomial_from_roots>`_, |
|
| 147 |
+
| | `polynomial_derivative <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.polynomial_derivative>`_, |
|
| 148 |
+
| | `polynomial_eval <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.polynomial_eval>`_, |
|
| 149 |
+
| | `sieve <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sieve>`_, |
|
| 150 |
+
| | `sum_of_squares <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sum_of_squares>`_, |
|
| 151 |
+
| | `totient <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.totient>`_ |
|
| 152 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 153 |
+
| Combinatorics | `distinct_permutations <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.distinct_permutations>`_, |
|
| 154 |
+
| | `distinct_combinations <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.distinct_combinations>`_, |
|
| 155 |
+
| | `circular_shifts <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.circular_shifts>`_, |
|
| 156 |
+
| | `partitions <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.partitions>`_, |
|
| 157 |
+
| | `set_partitions <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.set_partitions>`_, |
|
| 158 |
+
| | `product_index <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.product_index>`_, |
|
| 159 |
+
| | `combination_index <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.combination_index>`_, |
|
| 160 |
+
| | `permutation_index <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.permutation_index>`_, |
|
| 161 |
+
| | `combination_with_replacement_index <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.combination_with_replacement_index>`_, |
|
| 162 |
+
| | `gray_product <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.gray_product>`_, |
|
| 163 |
+
| | `outer_product <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.outer_product>`_, |
|
| 164 |
+
| | `powerset <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.powerset>`_, |
|
| 165 |
+
| | `powerset_of_sets <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.powerset_of_sets>`_, |
|
| 166 |
+
| | `random_product <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_product>`_, |
|
| 167 |
+
| | `random_permutation <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_permutation>`_, |
|
| 168 |
+
| | `random_combination <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_combination>`_, |
|
| 169 |
+
| | `random_combination_with_replacement <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.random_combination_with_replacement>`_, |
|
| 170 |
+
| | `nth_product <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_product>`_, |
|
| 171 |
+
| | `nth_permutation <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_permutation>`_, |
|
| 172 |
+
| | `nth_combination <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_combination>`_, |
|
| 173 |
+
| | `nth_combination_with_replacement <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.nth_combination_with_replacement>`_ |
|
| 174 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 175 |
+
| Wrapping | `always_iterable <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.always_iterable>`_, |
|
| 176 |
+
| | `always_reversible <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.always_reversible>`_, |
|
| 177 |
+
| | `countable <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.countable>`_, |
|
| 178 |
+
| | `consumer <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.consumer>`_, |
|
| 179 |
+
| | `with_iter <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.with_iter>`_, |
|
| 180 |
+
| | `iter_except <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iter_except>`_ |
|
| 181 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 182 |
+
| Others | `locate <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.locate>`_, |
|
| 183 |
+
| | `rlocate <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.rlocate>`_, |
|
| 184 |
+
| | `replace <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.replace>`_, |
|
| 185 |
+
| | `numeric_range <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.numeric_range>`_, |
|
| 186 |
+
| | `side_effect <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.side_effect>`_, |
|
| 187 |
+
| | `iterate <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iterate>`_, |
|
| 188 |
+
| | `difference <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.difference>`_, |
|
| 189 |
+
| | `make_decorator <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.make_decorator>`_, |
|
| 190 |
+
| | `SequenceView <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.SequenceView>`_, |
|
| 191 |
+
| | `time_limited <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.time_limited>`_, |
|
| 192 |
+
| | `map_if <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.map_if>`_, |
|
| 193 |
+
| | `iter_index <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.iter_index>`_, |
|
| 194 |
+
| | `consume <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.consume>`_, |
|
| 195 |
+
| | `tabulate <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tabulate>`_, |
|
| 196 |
+
| | `repeatfunc <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.repeatfunc>`_, |
|
| 197 |
+
| | `reshape <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.reshape>`_ |
|
| 198 |
+
| | `doublestarmap <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.doublestarmap>`_ |
|
| 199 |
+
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
Getting started
|
| 203 |
+
===============
|
| 204 |
+
|
| 205 |
+
To get started, install the library with `pip <https://pip.pypa.io/en/stable/>`_:
|
| 206 |
+
|
| 207 |
+
.. code-block:: shell
|
| 208 |
+
|
| 209 |
+
pip install more-itertools
|
| 210 |
+
|
| 211 |
+
The recipes from the `itertools docs <https://docs.python.org/3/library/itertools.html#itertools-recipes>`_
|
| 212 |
+
are included in the top-level package:
|
| 213 |
+
|
| 214 |
+
.. code-block:: python
|
| 215 |
+
|
| 216 |
+
>>> from more_itertools import flatten
|
| 217 |
+
>>> iterable = [(0, 1), (2, 3)]
|
| 218 |
+
>>> list(flatten(iterable))
|
| 219 |
+
[0, 1, 2, 3]
|
| 220 |
+
|
| 221 |
+
Several new recipes are available as well:
|
| 222 |
+
|
| 223 |
+
.. code-block:: python
|
| 224 |
+
|
| 225 |
+
>>> from more_itertools import chunked
|
| 226 |
+
>>> iterable = [0, 1, 2, 3, 4, 5, 6, 7, 8]
|
| 227 |
+
>>> list(chunked(iterable, 3))
|
| 228 |
+
[[0, 1, 2], [3, 4, 5], [6, 7, 8]]
|
| 229 |
+
|
| 230 |
+
>>> from more_itertools import spy
|
| 231 |
+
>>> iterable = (x * x for x in range(1, 6))
|
| 232 |
+
>>> head, iterable = spy(iterable, n=3)
|
| 233 |
+
>>> list(head)
|
| 234 |
+
[1, 4, 9]
|
| 235 |
+
>>> list(iterable)
|
| 236 |
+
[1, 4, 9, 16, 25]
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
For the full listing of functions, see the `API documentation <https://more-itertools.readthedocs.io/en/stable/api.html>`_.
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
Links elsewhere
|
| 244 |
+
===============
|
| 245 |
+
|
| 246 |
+
Blog posts about ``more-itertools``:
|
| 247 |
+
|
| 248 |
+
* `Yo, I heard you like decorators <https://www.bbayles.com/index/decorator_factory>`__
|
| 249 |
+
* `Tour of Python Itertools <https://martinheinz.dev/blog/16>`__ (`Alternate <https://dev.to/martinheinz/tour-of-python-itertools-4122>`__)
|
| 250 |
+
* `Real-World Python More Itertools <https://www.gidware.com/real-world-more-itertools/>`_
|
| 251 |
+
|
| 252 |
+
|
| 253 |
+
Development
|
| 254 |
+
===========
|
| 255 |
+
|
| 256 |
+
``more-itertools`` is maintained by `@erikrose <https://github.com/erikrose>`_
|
| 257 |
+
and `@bbayles <https://github.com/bbayles>`_, with help from `many others <https://github.com/more-itertools/more-itertools/graphs/contributors>`_.
|
| 258 |
+
If you have a problem or suggestion, please file a bug or pull request in this
|
| 259 |
+
repository. Thanks for contributing!
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
Version History
|
| 263 |
+
===============
|
| 264 |
+
|
| 265 |
+
The version history can be found in `documentation <https://more-itertools.readthedocs.io/en/stable/versions.html>`_.
|
| 266 |
+
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
more_itertools-10.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
more_itertools-10.3.0.dist-info/LICENSE,sha256=CfHIyelBrz5YTVlkHqm4fYPAyw_QB-te85Gn4mQ8GkY,1053
|
| 3 |
+
more_itertools-10.3.0.dist-info/METADATA,sha256=BFO90O-fLNiVQMpj7oIS5ztzgJUUQZ3TA32P5HH3N-A,36293
|
| 4 |
+
more_itertools-10.3.0.dist-info/RECORD,,
|
| 5 |
+
more_itertools-10.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
more_itertools-10.3.0.dist-info/WHEEL,sha256=rSgq_JpHF9fHR1lx53qwg_1-2LypZE_qmcuXbVUq948,81
|
| 7 |
+
more_itertools/__init__.py,sha256=dtAbGjTDmn_ghiU5YXfhyDy0phAlXVdt5klZA5fUa-Q,149
|
| 8 |
+
more_itertools/__init__.pyi,sha256=5B3eTzON1BBuOLob1vCflyEb2lSd6usXQQ-Cv-hXkeA,43
|
| 9 |
+
more_itertools/__pycache__/__init__.cpython-312.pyc,,
|
| 10 |
+
more_itertools/__pycache__/more.cpython-312.pyc,,
|
| 11 |
+
more_itertools/__pycache__/recipes.cpython-312.pyc,,
|
| 12 |
+
more_itertools/more.py,sha256=1E5kzFncRKTDw0cYv1yRXMgDdunstLQd1QStcnL6U90,148370
|
| 13 |
+
more_itertools/more.pyi,sha256=iXXeqt48Nxe8VGmIWpkVXuKpR2FYNuu2DU8nQLWCCu0,21484
|
| 14 |
+
more_itertools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 15 |
+
more_itertools/recipes.py,sha256=WedhhfhGVgr6zii8fIbGJVmRTw0ZKRiLKnYBDGJv4nY,28591
|
| 16 |
+
more_itertools/recipes.pyi,sha256=T_mdGpcFdfrP3JSWbwzYP9JyNV-Go-7RPfpxfftAWlA,4617
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/REQUESTED
ADDED
|
File without changes
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: flit 3.8.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""More routines for operating on iterables, beyond itertools"""
|
| 2 |
+
|
| 3 |
+
from .more import * # noqa
|
| 4 |
+
from .recipes import * # noqa
|
| 5 |
+
|
| 6 |
+
__version__ = '10.3.0'
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.pyi
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .more import *
|
| 2 |
+
from .recipes import *
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__pycache__/more.cpython-310.pyc
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a29978deee94c64619445fc042926f0fe515aafecb26d5e071b5df8adfcaa49d
|
| 3 |
+
size 138269
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.pyi
ADDED
|
@@ -0,0 +1,709 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stubs for more_itertools.more"""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from types import TracebackType
|
| 6 |
+
from typing import (
|
| 7 |
+
Any,
|
| 8 |
+
Callable,
|
| 9 |
+
Container,
|
| 10 |
+
ContextManager,
|
| 11 |
+
Generic,
|
| 12 |
+
Hashable,
|
| 13 |
+
Mapping,
|
| 14 |
+
Iterable,
|
| 15 |
+
Iterator,
|
| 16 |
+
Mapping,
|
| 17 |
+
overload,
|
| 18 |
+
Reversible,
|
| 19 |
+
Sequence,
|
| 20 |
+
Sized,
|
| 21 |
+
Type,
|
| 22 |
+
TypeVar,
|
| 23 |
+
type_check_only,
|
| 24 |
+
)
|
| 25 |
+
from typing_extensions import Protocol
|
| 26 |
+
|
| 27 |
+
# Type and type variable definitions
|
| 28 |
+
_T = TypeVar('_T')
|
| 29 |
+
_T1 = TypeVar('_T1')
|
| 30 |
+
_T2 = TypeVar('_T2')
|
| 31 |
+
_U = TypeVar('_U')
|
| 32 |
+
_V = TypeVar('_V')
|
| 33 |
+
_W = TypeVar('_W')
|
| 34 |
+
_T_co = TypeVar('_T_co', covariant=True)
|
| 35 |
+
_GenFn = TypeVar('_GenFn', bound=Callable[..., Iterator[Any]])
|
| 36 |
+
_Raisable = BaseException | Type[BaseException]
|
| 37 |
+
|
| 38 |
+
@type_check_only
|
| 39 |
+
class _SizedIterable(Protocol[_T_co], Sized, Iterable[_T_co]): ...
|
| 40 |
+
|
| 41 |
+
@type_check_only
|
| 42 |
+
class _SizedReversible(Protocol[_T_co], Sized, Reversible[_T_co]): ...
|
| 43 |
+
|
| 44 |
+
@type_check_only
|
| 45 |
+
class _SupportsSlicing(Protocol[_T_co]):
|
| 46 |
+
def __getitem__(self, __k: slice) -> _T_co: ...
|
| 47 |
+
|
| 48 |
+
def chunked(
|
| 49 |
+
iterable: Iterable[_T], n: int | None, strict: bool = ...
|
| 50 |
+
) -> Iterator[list[_T]]: ...
|
| 51 |
+
@overload
|
| 52 |
+
def first(iterable: Iterable[_T]) -> _T: ...
|
| 53 |
+
@overload
|
| 54 |
+
def first(iterable: Iterable[_T], default: _U) -> _T | _U: ...
|
| 55 |
+
@overload
|
| 56 |
+
def last(iterable: Iterable[_T]) -> _T: ...
|
| 57 |
+
@overload
|
| 58 |
+
def last(iterable: Iterable[_T], default: _U) -> _T | _U: ...
|
| 59 |
+
@overload
|
| 60 |
+
def nth_or_last(iterable: Iterable[_T], n: int) -> _T: ...
|
| 61 |
+
@overload
|
| 62 |
+
def nth_or_last(iterable: Iterable[_T], n: int, default: _U) -> _T | _U: ...
|
| 63 |
+
|
| 64 |
+
class peekable(Generic[_T], Iterator[_T]):
|
| 65 |
+
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
| 66 |
+
def __iter__(self) -> peekable[_T]: ...
|
| 67 |
+
def __bool__(self) -> bool: ...
|
| 68 |
+
@overload
|
| 69 |
+
def peek(self) -> _T: ...
|
| 70 |
+
@overload
|
| 71 |
+
def peek(self, default: _U) -> _T | _U: ...
|
| 72 |
+
def prepend(self, *items: _T) -> None: ...
|
| 73 |
+
def __next__(self) -> _T: ...
|
| 74 |
+
@overload
|
| 75 |
+
def __getitem__(self, index: int) -> _T: ...
|
| 76 |
+
@overload
|
| 77 |
+
def __getitem__(self, index: slice) -> list[_T]: ...
|
| 78 |
+
|
| 79 |
+
def consumer(func: _GenFn) -> _GenFn: ...
|
| 80 |
+
def ilen(iterable: Iterable[_T]) -> int: ...
|
| 81 |
+
def iterate(func: Callable[[_T], _T], start: _T) -> Iterator[_T]: ...
|
| 82 |
+
def with_iter(
|
| 83 |
+
context_manager: ContextManager[Iterable[_T]],
|
| 84 |
+
) -> Iterator[_T]: ...
|
| 85 |
+
def one(
|
| 86 |
+
iterable: Iterable[_T],
|
| 87 |
+
too_short: _Raisable | None = ...,
|
| 88 |
+
too_long: _Raisable | None = ...,
|
| 89 |
+
) -> _T: ...
|
| 90 |
+
def raise_(exception: _Raisable, *args: Any) -> None: ...
|
| 91 |
+
def strictly_n(
|
| 92 |
+
iterable: Iterable[_T],
|
| 93 |
+
n: int,
|
| 94 |
+
too_short: _GenFn | None = ...,
|
| 95 |
+
too_long: _GenFn | None = ...,
|
| 96 |
+
) -> list[_T]: ...
|
| 97 |
+
def distinct_permutations(
|
| 98 |
+
iterable: Iterable[_T], r: int | None = ...
|
| 99 |
+
) -> Iterator[tuple[_T, ...]]: ...
|
| 100 |
+
def intersperse(
|
| 101 |
+
e: _U, iterable: Iterable[_T], n: int = ...
|
| 102 |
+
) -> Iterator[_T | _U]: ...
|
| 103 |
+
def unique_to_each(*iterables: Iterable[_T]) -> list[list[_T]]: ...
|
| 104 |
+
@overload
|
| 105 |
+
def windowed(
|
| 106 |
+
seq: Iterable[_T], n: int, *, step: int = ...
|
| 107 |
+
) -> Iterator[tuple[_T | None, ...]]: ...
|
| 108 |
+
@overload
|
| 109 |
+
def windowed(
|
| 110 |
+
seq: Iterable[_T], n: int, fillvalue: _U, step: int = ...
|
| 111 |
+
) -> Iterator[tuple[_T | _U, ...]]: ...
|
| 112 |
+
def substrings(iterable: Iterable[_T]) -> Iterator[tuple[_T, ...]]: ...
|
| 113 |
+
def substrings_indexes(
|
| 114 |
+
seq: Sequence[_T], reverse: bool = ...
|
| 115 |
+
) -> Iterator[tuple[Sequence[_T], int, int]]: ...
|
| 116 |
+
|
| 117 |
+
class bucket(Generic[_T, _U], Container[_U]):
|
| 118 |
+
def __init__(
|
| 119 |
+
self,
|
| 120 |
+
iterable: Iterable[_T],
|
| 121 |
+
key: Callable[[_T], _U],
|
| 122 |
+
validator: Callable[[_U], object] | None = ...,
|
| 123 |
+
) -> None: ...
|
| 124 |
+
def __contains__(self, value: object) -> bool: ...
|
| 125 |
+
def __iter__(self) -> Iterator[_U]: ...
|
| 126 |
+
def __getitem__(self, value: object) -> Iterator[_T]: ...
|
| 127 |
+
|
| 128 |
+
def spy(
|
| 129 |
+
iterable: Iterable[_T], n: int = ...
|
| 130 |
+
) -> tuple[list[_T], Iterator[_T]]: ...
|
| 131 |
+
def interleave(*iterables: Iterable[_T]) -> Iterator[_T]: ...
|
| 132 |
+
def interleave_longest(*iterables: Iterable[_T]) -> Iterator[_T]: ...
|
| 133 |
+
def interleave_evenly(
|
| 134 |
+
iterables: list[Iterable[_T]], lengths: list[int] | None = ...
|
| 135 |
+
) -> Iterator[_T]: ...
|
| 136 |
+
def collapse(
|
| 137 |
+
iterable: Iterable[Any],
|
| 138 |
+
base_type: type | None = ...,
|
| 139 |
+
levels: int | None = ...,
|
| 140 |
+
) -> Iterator[Any]: ...
|
| 141 |
+
@overload
|
| 142 |
+
def side_effect(
|
| 143 |
+
func: Callable[[_T], object],
|
| 144 |
+
iterable: Iterable[_T],
|
| 145 |
+
chunk_size: None = ...,
|
| 146 |
+
before: Callable[[], object] | None = ...,
|
| 147 |
+
after: Callable[[], object] | None = ...,
|
| 148 |
+
) -> Iterator[_T]: ...
|
| 149 |
+
@overload
|
| 150 |
+
def side_effect(
|
| 151 |
+
func: Callable[[list[_T]], object],
|
| 152 |
+
iterable: Iterable[_T],
|
| 153 |
+
chunk_size: int,
|
| 154 |
+
before: Callable[[], object] | None = ...,
|
| 155 |
+
after: Callable[[], object] | None = ...,
|
| 156 |
+
) -> Iterator[_T]: ...
|
| 157 |
+
def sliced(
|
| 158 |
+
seq: _SupportsSlicing[_T], n: int, strict: bool = ...
|
| 159 |
+
) -> Iterator[_T]: ...
|
| 160 |
+
def split_at(
|
| 161 |
+
iterable: Iterable[_T],
|
| 162 |
+
pred: Callable[[_T], object],
|
| 163 |
+
maxsplit: int = ...,
|
| 164 |
+
keep_separator: bool = ...,
|
| 165 |
+
) -> Iterator[list[_T]]: ...
|
| 166 |
+
def split_before(
|
| 167 |
+
iterable: Iterable[_T], pred: Callable[[_T], object], maxsplit: int = ...
|
| 168 |
+
) -> Iterator[list[_T]]: ...
|
| 169 |
+
def split_after(
|
| 170 |
+
iterable: Iterable[_T], pred: Callable[[_T], object], maxsplit: int = ...
|
| 171 |
+
) -> Iterator[list[_T]]: ...
|
| 172 |
+
def split_when(
|
| 173 |
+
iterable: Iterable[_T],
|
| 174 |
+
pred: Callable[[_T, _T], object],
|
| 175 |
+
maxsplit: int = ...,
|
| 176 |
+
) -> Iterator[list[_T]]: ...
|
| 177 |
+
def split_into(
|
| 178 |
+
iterable: Iterable[_T], sizes: Iterable[int | None]
|
| 179 |
+
) -> Iterator[list[_T]]: ...
|
| 180 |
+
@overload
|
| 181 |
+
def padded(
|
| 182 |
+
iterable: Iterable[_T],
|
| 183 |
+
*,
|
| 184 |
+
n: int | None = ...,
|
| 185 |
+
next_multiple: bool = ...,
|
| 186 |
+
) -> Iterator[_T | None]: ...
|
| 187 |
+
@overload
|
| 188 |
+
def padded(
|
| 189 |
+
iterable: Iterable[_T],
|
| 190 |
+
fillvalue: _U,
|
| 191 |
+
n: int | None = ...,
|
| 192 |
+
next_multiple: bool = ...,
|
| 193 |
+
) -> Iterator[_T | _U]: ...
|
| 194 |
+
@overload
|
| 195 |
+
def repeat_last(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
| 196 |
+
@overload
|
| 197 |
+
def repeat_last(iterable: Iterable[_T], default: _U) -> Iterator[_T | _U]: ...
|
| 198 |
+
def distribute(n: int, iterable: Iterable[_T]) -> list[Iterator[_T]]: ...
|
| 199 |
+
@overload
|
| 200 |
+
def stagger(
|
| 201 |
+
iterable: Iterable[_T],
|
| 202 |
+
offsets: _SizedIterable[int] = ...,
|
| 203 |
+
longest: bool = ...,
|
| 204 |
+
) -> Iterator[tuple[_T | None, ...]]: ...
|
| 205 |
+
@overload
|
| 206 |
+
def stagger(
|
| 207 |
+
iterable: Iterable[_T],
|
| 208 |
+
offsets: _SizedIterable[int] = ...,
|
| 209 |
+
longest: bool = ...,
|
| 210 |
+
fillvalue: _U = ...,
|
| 211 |
+
) -> Iterator[tuple[_T | _U, ...]]: ...
|
| 212 |
+
|
| 213 |
+
class UnequalIterablesError(ValueError):
|
| 214 |
+
def __init__(self, details: tuple[int, int, int] | None = ...) -> None: ...
|
| 215 |
+
|
| 216 |
+
@overload
|
| 217 |
+
def zip_equal(__iter1: Iterable[_T1]) -> Iterator[tuple[_T1]]: ...
|
| 218 |
+
@overload
|
| 219 |
+
def zip_equal(
|
| 220 |
+
__iter1: Iterable[_T1], __iter2: Iterable[_T2]
|
| 221 |
+
) -> Iterator[tuple[_T1, _T2]]: ...
|
| 222 |
+
@overload
|
| 223 |
+
def zip_equal(
|
| 224 |
+
__iter1: Iterable[_T],
|
| 225 |
+
__iter2: Iterable[_T],
|
| 226 |
+
__iter3: Iterable[_T],
|
| 227 |
+
*iterables: Iterable[_T],
|
| 228 |
+
) -> Iterator[tuple[_T, ...]]: ...
|
| 229 |
+
@overload
|
| 230 |
+
def zip_offset(
|
| 231 |
+
__iter1: Iterable[_T1],
|
| 232 |
+
*,
|
| 233 |
+
offsets: _SizedIterable[int],
|
| 234 |
+
longest: bool = ...,
|
| 235 |
+
fillvalue: None = None,
|
| 236 |
+
) -> Iterator[tuple[_T1 | None]]: ...
|
| 237 |
+
@overload
|
| 238 |
+
def zip_offset(
|
| 239 |
+
__iter1: Iterable[_T1],
|
| 240 |
+
__iter2: Iterable[_T2],
|
| 241 |
+
*,
|
| 242 |
+
offsets: _SizedIterable[int],
|
| 243 |
+
longest: bool = ...,
|
| 244 |
+
fillvalue: None = None,
|
| 245 |
+
) -> Iterator[tuple[_T1 | None, _T2 | None]]: ...
|
| 246 |
+
@overload
|
| 247 |
+
def zip_offset(
|
| 248 |
+
__iter1: Iterable[_T],
|
| 249 |
+
__iter2: Iterable[_T],
|
| 250 |
+
__iter3: Iterable[_T],
|
| 251 |
+
*iterables: Iterable[_T],
|
| 252 |
+
offsets: _SizedIterable[int],
|
| 253 |
+
longest: bool = ...,
|
| 254 |
+
fillvalue: None = None,
|
| 255 |
+
) -> Iterator[tuple[_T | None, ...]]: ...
|
| 256 |
+
@overload
|
| 257 |
+
def zip_offset(
|
| 258 |
+
__iter1: Iterable[_T1],
|
| 259 |
+
*,
|
| 260 |
+
offsets: _SizedIterable[int],
|
| 261 |
+
longest: bool = ...,
|
| 262 |
+
fillvalue: _U,
|
| 263 |
+
) -> Iterator[tuple[_T1 | _U]]: ...
|
| 264 |
+
@overload
|
| 265 |
+
def zip_offset(
|
| 266 |
+
__iter1: Iterable[_T1],
|
| 267 |
+
__iter2: Iterable[_T2],
|
| 268 |
+
*,
|
| 269 |
+
offsets: _SizedIterable[int],
|
| 270 |
+
longest: bool = ...,
|
| 271 |
+
fillvalue: _U,
|
| 272 |
+
) -> Iterator[tuple[_T1 | _U, _T2 | _U]]: ...
|
| 273 |
+
@overload
|
| 274 |
+
def zip_offset(
|
| 275 |
+
__iter1: Iterable[_T],
|
| 276 |
+
__iter2: Iterable[_T],
|
| 277 |
+
__iter3: Iterable[_T],
|
| 278 |
+
*iterables: Iterable[_T],
|
| 279 |
+
offsets: _SizedIterable[int],
|
| 280 |
+
longest: bool = ...,
|
| 281 |
+
fillvalue: _U,
|
| 282 |
+
) -> Iterator[tuple[_T | _U, ...]]: ...
|
| 283 |
+
def sort_together(
|
| 284 |
+
iterables: Iterable[Iterable[_T]],
|
| 285 |
+
key_list: Iterable[int] = ...,
|
| 286 |
+
key: Callable[..., Any] | None = ...,
|
| 287 |
+
reverse: bool = ...,
|
| 288 |
+
) -> list[tuple[_T, ...]]: ...
|
| 289 |
+
def unzip(iterable: Iterable[Sequence[_T]]) -> tuple[Iterator[_T], ...]: ...
|
| 290 |
+
def divide(n: int, iterable: Iterable[_T]) -> list[Iterator[_T]]: ...
|
| 291 |
+
def always_iterable(
|
| 292 |
+
obj: object,
|
| 293 |
+
base_type: type | tuple[type | tuple[Any, ...], ...] | None = ...,
|
| 294 |
+
) -> Iterator[Any]: ...
|
| 295 |
+
def adjacent(
|
| 296 |
+
predicate: Callable[[_T], bool],
|
| 297 |
+
iterable: Iterable[_T],
|
| 298 |
+
distance: int = ...,
|
| 299 |
+
) -> Iterator[tuple[bool, _T]]: ...
|
| 300 |
+
@overload
|
| 301 |
+
def groupby_transform(
|
| 302 |
+
iterable: Iterable[_T],
|
| 303 |
+
keyfunc: None = None,
|
| 304 |
+
valuefunc: None = None,
|
| 305 |
+
reducefunc: None = None,
|
| 306 |
+
) -> Iterator[tuple[_T, Iterator[_T]]]: ...
|
| 307 |
+
@overload
|
| 308 |
+
def groupby_transform(
|
| 309 |
+
iterable: Iterable[_T],
|
| 310 |
+
keyfunc: Callable[[_T], _U],
|
| 311 |
+
valuefunc: None,
|
| 312 |
+
reducefunc: None,
|
| 313 |
+
) -> Iterator[tuple[_U, Iterator[_T]]]: ...
|
| 314 |
+
@overload
|
| 315 |
+
def groupby_transform(
|
| 316 |
+
iterable: Iterable[_T],
|
| 317 |
+
keyfunc: None,
|
| 318 |
+
valuefunc: Callable[[_T], _V],
|
| 319 |
+
reducefunc: None,
|
| 320 |
+
) -> Iterable[tuple[_T, Iterable[_V]]]: ...
|
| 321 |
+
@overload
|
| 322 |
+
def groupby_transform(
|
| 323 |
+
iterable: Iterable[_T],
|
| 324 |
+
keyfunc: Callable[[_T], _U],
|
| 325 |
+
valuefunc: Callable[[_T], _V],
|
| 326 |
+
reducefunc: None,
|
| 327 |
+
) -> Iterable[tuple[_U, Iterator[_V]]]: ...
|
| 328 |
+
@overload
|
| 329 |
+
def groupby_transform(
|
| 330 |
+
iterable: Iterable[_T],
|
| 331 |
+
keyfunc: None,
|
| 332 |
+
valuefunc: None,
|
| 333 |
+
reducefunc: Callable[[Iterator[_T]], _W],
|
| 334 |
+
) -> Iterable[tuple[_T, _W]]: ...
|
| 335 |
+
@overload
|
| 336 |
+
def groupby_transform(
|
| 337 |
+
iterable: Iterable[_T],
|
| 338 |
+
keyfunc: Callable[[_T], _U],
|
| 339 |
+
valuefunc: None,
|
| 340 |
+
reducefunc: Callable[[Iterator[_T]], _W],
|
| 341 |
+
) -> Iterable[tuple[_U, _W]]: ...
|
| 342 |
+
@overload
|
| 343 |
+
def groupby_transform(
|
| 344 |
+
iterable: Iterable[_T],
|
| 345 |
+
keyfunc: None,
|
| 346 |
+
valuefunc: Callable[[_T], _V],
|
| 347 |
+
reducefunc: Callable[[Iterable[_V]], _W],
|
| 348 |
+
) -> Iterable[tuple[_T, _W]]: ...
|
| 349 |
+
@overload
|
| 350 |
+
def groupby_transform(
|
| 351 |
+
iterable: Iterable[_T],
|
| 352 |
+
keyfunc: Callable[[_T], _U],
|
| 353 |
+
valuefunc: Callable[[_T], _V],
|
| 354 |
+
reducefunc: Callable[[Iterable[_V]], _W],
|
| 355 |
+
) -> Iterable[tuple[_U, _W]]: ...
|
| 356 |
+
|
| 357 |
+
class numeric_range(Generic[_T, _U], Sequence[_T], Hashable, Reversible[_T]):
|
| 358 |
+
@overload
|
| 359 |
+
def __init__(self, __stop: _T) -> None: ...
|
| 360 |
+
@overload
|
| 361 |
+
def __init__(self, __start: _T, __stop: _T) -> None: ...
|
| 362 |
+
@overload
|
| 363 |
+
def __init__(self, __start: _T, __stop: _T, __step: _U) -> None: ...
|
| 364 |
+
def __bool__(self) -> bool: ...
|
| 365 |
+
def __contains__(self, elem: object) -> bool: ...
|
| 366 |
+
def __eq__(self, other: object) -> bool: ...
|
| 367 |
+
@overload
|
| 368 |
+
def __getitem__(self, key: int) -> _T: ...
|
| 369 |
+
@overload
|
| 370 |
+
def __getitem__(self, key: slice) -> numeric_range[_T, _U]: ...
|
| 371 |
+
def __hash__(self) -> int: ...
|
| 372 |
+
def __iter__(self) -> Iterator[_T]: ...
|
| 373 |
+
def __len__(self) -> int: ...
|
| 374 |
+
def __reduce__(
|
| 375 |
+
self,
|
| 376 |
+
) -> tuple[Type[numeric_range[_T, _U]], tuple[_T, _T, _U]]: ...
|
| 377 |
+
def __repr__(self) -> str: ...
|
| 378 |
+
def __reversed__(self) -> Iterator[_T]: ...
|
| 379 |
+
def count(self, value: _T) -> int: ...
|
| 380 |
+
def index(self, value: _T) -> int: ... # type: ignore
|
| 381 |
+
|
| 382 |
+
def count_cycle(
|
| 383 |
+
iterable: Iterable[_T], n: int | None = ...
|
| 384 |
+
) -> Iterable[tuple[int, _T]]: ...
|
| 385 |
+
def mark_ends(
|
| 386 |
+
iterable: Iterable[_T],
|
| 387 |
+
) -> Iterable[tuple[bool, bool, _T]]: ...
|
| 388 |
+
def locate(
|
| 389 |
+
iterable: Iterable[_T],
|
| 390 |
+
pred: Callable[..., Any] = ...,
|
| 391 |
+
window_size: int | None = ...,
|
| 392 |
+
) -> Iterator[int]: ...
|
| 393 |
+
def lstrip(
|
| 394 |
+
iterable: Iterable[_T], pred: Callable[[_T], object]
|
| 395 |
+
) -> Iterator[_T]: ...
|
| 396 |
+
def rstrip(
|
| 397 |
+
iterable: Iterable[_T], pred: Callable[[_T], object]
|
| 398 |
+
) -> Iterator[_T]: ...
|
| 399 |
+
def strip(
|
| 400 |
+
iterable: Iterable[_T], pred: Callable[[_T], object]
|
| 401 |
+
) -> Iterator[_T]: ...
|
| 402 |
+
|
| 403 |
+
class islice_extended(Generic[_T], Iterator[_T]):
|
| 404 |
+
def __init__(self, iterable: Iterable[_T], *args: int | None) -> None: ...
|
| 405 |
+
def __iter__(self) -> islice_extended[_T]: ...
|
| 406 |
+
def __next__(self) -> _T: ...
|
| 407 |
+
def __getitem__(self, index: slice) -> islice_extended[_T]: ...
|
| 408 |
+
|
| 409 |
+
def always_reversible(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
| 410 |
+
def consecutive_groups(
|
| 411 |
+
iterable: Iterable[_T], ordering: Callable[[_T], int] = ...
|
| 412 |
+
) -> Iterator[Iterator[_T]]: ...
|
| 413 |
+
@overload
|
| 414 |
+
def difference(
|
| 415 |
+
iterable: Iterable[_T],
|
| 416 |
+
func: Callable[[_T, _T], _U] = ...,
|
| 417 |
+
*,
|
| 418 |
+
initial: None = ...,
|
| 419 |
+
) -> Iterator[_T | _U]: ...
|
| 420 |
+
@overload
|
| 421 |
+
def difference(
|
| 422 |
+
iterable: Iterable[_T], func: Callable[[_T, _T], _U] = ..., *, initial: _U
|
| 423 |
+
) -> Iterator[_U]: ...
|
| 424 |
+
|
| 425 |
+
class SequenceView(Generic[_T], Sequence[_T]):
|
| 426 |
+
def __init__(self, target: Sequence[_T]) -> None: ...
|
| 427 |
+
@overload
|
| 428 |
+
def __getitem__(self, index: int) -> _T: ...
|
| 429 |
+
@overload
|
| 430 |
+
def __getitem__(self, index: slice) -> Sequence[_T]: ...
|
| 431 |
+
def __len__(self) -> int: ...
|
| 432 |
+
|
| 433 |
+
class seekable(Generic[_T], Iterator[_T]):
|
| 434 |
+
def __init__(
|
| 435 |
+
self, iterable: Iterable[_T], maxlen: int | None = ...
|
| 436 |
+
) -> None: ...
|
| 437 |
+
def __iter__(self) -> seekable[_T]: ...
|
| 438 |
+
def __next__(self) -> _T: ...
|
| 439 |
+
def __bool__(self) -> bool: ...
|
| 440 |
+
@overload
|
| 441 |
+
def peek(self) -> _T: ...
|
| 442 |
+
@overload
|
| 443 |
+
def peek(self, default: _U) -> _T | _U: ...
|
| 444 |
+
def elements(self) -> SequenceView[_T]: ...
|
| 445 |
+
def seek(self, index: int) -> None: ...
|
| 446 |
+
def relative_seek(self, count: int) -> None: ...
|
| 447 |
+
|
| 448 |
+
class run_length:
|
| 449 |
+
@staticmethod
|
| 450 |
+
def encode(iterable: Iterable[_T]) -> Iterator[tuple[_T, int]]: ...
|
| 451 |
+
@staticmethod
|
| 452 |
+
def decode(iterable: Iterable[tuple[_T, int]]) -> Iterator[_T]: ...
|
| 453 |
+
|
| 454 |
+
def exactly_n(
|
| 455 |
+
iterable: Iterable[_T], n: int, predicate: Callable[[_T], object] = ...
|
| 456 |
+
) -> bool: ...
|
| 457 |
+
def circular_shifts(iterable: Iterable[_T]) -> list[tuple[_T, ...]]: ...
|
| 458 |
+
def make_decorator(
|
| 459 |
+
wrapping_func: Callable[..., _U], result_index: int = ...
|
| 460 |
+
) -> Callable[..., Callable[[Callable[..., Any]], Callable[..., _U]]]: ...
|
| 461 |
+
@overload
|
| 462 |
+
def map_reduce(
|
| 463 |
+
iterable: Iterable[_T],
|
| 464 |
+
keyfunc: Callable[[_T], _U],
|
| 465 |
+
valuefunc: None = ...,
|
| 466 |
+
reducefunc: None = ...,
|
| 467 |
+
) -> dict[_U, list[_T]]: ...
|
| 468 |
+
@overload
|
| 469 |
+
def map_reduce(
|
| 470 |
+
iterable: Iterable[_T],
|
| 471 |
+
keyfunc: Callable[[_T], _U],
|
| 472 |
+
valuefunc: Callable[[_T], _V],
|
| 473 |
+
reducefunc: None = ...,
|
| 474 |
+
) -> dict[_U, list[_V]]: ...
|
| 475 |
+
@overload
|
| 476 |
+
def map_reduce(
|
| 477 |
+
iterable: Iterable[_T],
|
| 478 |
+
keyfunc: Callable[[_T], _U],
|
| 479 |
+
valuefunc: None = ...,
|
| 480 |
+
reducefunc: Callable[[list[_T]], _W] = ...,
|
| 481 |
+
) -> dict[_U, _W]: ...
|
| 482 |
+
@overload
|
| 483 |
+
def map_reduce(
|
| 484 |
+
iterable: Iterable[_T],
|
| 485 |
+
keyfunc: Callable[[_T], _U],
|
| 486 |
+
valuefunc: Callable[[_T], _V],
|
| 487 |
+
reducefunc: Callable[[list[_V]], _W],
|
| 488 |
+
) -> dict[_U, _W]: ...
|
| 489 |
+
def rlocate(
|
| 490 |
+
iterable: Iterable[_T],
|
| 491 |
+
pred: Callable[..., object] = ...,
|
| 492 |
+
window_size: int | None = ...,
|
| 493 |
+
) -> Iterator[int]: ...
|
| 494 |
+
def replace(
|
| 495 |
+
iterable: Iterable[_T],
|
| 496 |
+
pred: Callable[..., object],
|
| 497 |
+
substitutes: Iterable[_U],
|
| 498 |
+
count: int | None = ...,
|
| 499 |
+
window_size: int = ...,
|
| 500 |
+
) -> Iterator[_T | _U]: ...
|
| 501 |
+
def partitions(iterable: Iterable[_T]) -> Iterator[list[list[_T]]]: ...
|
| 502 |
+
def set_partitions(
|
| 503 |
+
iterable: Iterable[_T], k: int | None = ...
|
| 504 |
+
) -> Iterator[list[list[_T]]]: ...
|
| 505 |
+
|
| 506 |
+
class time_limited(Generic[_T], Iterator[_T]):
|
| 507 |
+
def __init__(
|
| 508 |
+
self, limit_seconds: float, iterable: Iterable[_T]
|
| 509 |
+
) -> None: ...
|
| 510 |
+
def __iter__(self) -> islice_extended[_T]: ...
|
| 511 |
+
def __next__(self) -> _T: ...
|
| 512 |
+
|
| 513 |
+
@overload
|
| 514 |
+
def only(
|
| 515 |
+
iterable: Iterable[_T], *, too_long: _Raisable | None = ...
|
| 516 |
+
) -> _T | None: ...
|
| 517 |
+
@overload
|
| 518 |
+
def only(
|
| 519 |
+
iterable: Iterable[_T], default: _U, too_long: _Raisable | None = ...
|
| 520 |
+
) -> _T | _U: ...
|
| 521 |
+
def ichunked(iterable: Iterable[_T], n: int) -> Iterator[Iterator[_T]]: ...
|
| 522 |
+
def distinct_combinations(
|
| 523 |
+
iterable: Iterable[_T], r: int
|
| 524 |
+
) -> Iterator[tuple[_T, ...]]: ...
|
| 525 |
+
def filter_except(
|
| 526 |
+
validator: Callable[[Any], object],
|
| 527 |
+
iterable: Iterable[_T],
|
| 528 |
+
*exceptions: Type[BaseException],
|
| 529 |
+
) -> Iterator[_T]: ...
|
| 530 |
+
def map_except(
|
| 531 |
+
function: Callable[[Any], _U],
|
| 532 |
+
iterable: Iterable[_T],
|
| 533 |
+
*exceptions: Type[BaseException],
|
| 534 |
+
) -> Iterator[_U]: ...
|
| 535 |
+
def map_if(
|
| 536 |
+
iterable: Iterable[Any],
|
| 537 |
+
pred: Callable[[Any], bool],
|
| 538 |
+
func: Callable[[Any], Any],
|
| 539 |
+
func_else: Callable[[Any], Any] | None = ...,
|
| 540 |
+
) -> Iterator[Any]: ...
|
| 541 |
+
def sample(
|
| 542 |
+
iterable: Iterable[_T],
|
| 543 |
+
k: int,
|
| 544 |
+
weights: Iterable[float] | None = ...,
|
| 545 |
+
) -> list[_T]: ...
|
| 546 |
+
def is_sorted(
|
| 547 |
+
iterable: Iterable[_T],
|
| 548 |
+
key: Callable[[_T], _U] | None = ...,
|
| 549 |
+
reverse: bool = False,
|
| 550 |
+
strict: bool = False,
|
| 551 |
+
) -> bool: ...
|
| 552 |
+
|
| 553 |
+
class AbortThread(BaseException):
|
| 554 |
+
pass
|
| 555 |
+
|
| 556 |
+
class callback_iter(Generic[_T], Iterator[_T]):
|
| 557 |
+
def __init__(
|
| 558 |
+
self,
|
| 559 |
+
func: Callable[..., Any],
|
| 560 |
+
callback_kwd: str = ...,
|
| 561 |
+
wait_seconds: float = ...,
|
| 562 |
+
) -> None: ...
|
| 563 |
+
def __enter__(self) -> callback_iter[_T]: ...
|
| 564 |
+
def __exit__(
|
| 565 |
+
self,
|
| 566 |
+
exc_type: Type[BaseException] | None,
|
| 567 |
+
exc_value: BaseException | None,
|
| 568 |
+
traceback: TracebackType | None,
|
| 569 |
+
) -> bool | None: ...
|
| 570 |
+
def __iter__(self) -> callback_iter[_T]: ...
|
| 571 |
+
def __next__(self) -> _T: ...
|
| 572 |
+
def _reader(self) -> Iterator[_T]: ...
|
| 573 |
+
@property
|
| 574 |
+
def done(self) -> bool: ...
|
| 575 |
+
@property
|
| 576 |
+
def result(self) -> Any: ...
|
| 577 |
+
|
| 578 |
+
def windowed_complete(
|
| 579 |
+
iterable: Iterable[_T], n: int
|
| 580 |
+
) -> Iterator[tuple[_T, ...]]: ...
|
| 581 |
+
def all_unique(
|
| 582 |
+
iterable: Iterable[_T], key: Callable[[_T], _U] | None = ...
|
| 583 |
+
) -> bool: ...
|
| 584 |
+
def nth_product(index: int, *args: Iterable[_T]) -> tuple[_T, ...]: ...
|
| 585 |
+
def nth_combination_with_replacement(
|
| 586 |
+
iterable: Iterable[_T], r: int, index: int
|
| 587 |
+
) -> tuple[_T, ...]: ...
|
| 588 |
+
def nth_permutation(
|
| 589 |
+
iterable: Iterable[_T], r: int, index: int
|
| 590 |
+
) -> tuple[_T, ...]: ...
|
| 591 |
+
def value_chain(*args: _T | Iterable[_T]) -> Iterable[_T]: ...
|
| 592 |
+
def product_index(element: Iterable[_T], *args: Iterable[_T]) -> int: ...
|
| 593 |
+
def combination_index(
|
| 594 |
+
element: Iterable[_T], iterable: Iterable[_T]
|
| 595 |
+
) -> int: ...
|
| 596 |
+
def combination_with_replacement_index(
|
| 597 |
+
element: Iterable[_T], iterable: Iterable[_T]
|
| 598 |
+
) -> int: ...
|
| 599 |
+
def permutation_index(
|
| 600 |
+
element: Iterable[_T], iterable: Iterable[_T]
|
| 601 |
+
) -> int: ...
|
| 602 |
+
def repeat_each(iterable: Iterable[_T], n: int = ...) -> Iterator[_T]: ...
|
| 603 |
+
|
| 604 |
+
class countable(Generic[_T], Iterator[_T]):
|
| 605 |
+
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
| 606 |
+
def __iter__(self) -> countable[_T]: ...
|
| 607 |
+
def __next__(self) -> _T: ...
|
| 608 |
+
items_seen: int
|
| 609 |
+
|
| 610 |
+
def chunked_even(iterable: Iterable[_T], n: int) -> Iterator[list[_T]]: ...
|
| 611 |
+
def zip_broadcast(
|
| 612 |
+
*objects: _T | Iterable[_T],
|
| 613 |
+
scalar_types: type | tuple[type | tuple[Any, ...], ...] | None = ...,
|
| 614 |
+
strict: bool = ...,
|
| 615 |
+
) -> Iterable[tuple[_T, ...]]: ...
|
| 616 |
+
def unique_in_window(
|
| 617 |
+
iterable: Iterable[_T], n: int, key: Callable[[_T], _U] | None = ...
|
| 618 |
+
) -> Iterator[_T]: ...
|
| 619 |
+
def duplicates_everseen(
|
| 620 |
+
iterable: Iterable[_T], key: Callable[[_T], _U] | None = ...
|
| 621 |
+
) -> Iterator[_T]: ...
|
| 622 |
+
def duplicates_justseen(
|
| 623 |
+
iterable: Iterable[_T], key: Callable[[_T], _U] | None = ...
|
| 624 |
+
) -> Iterator[_T]: ...
|
| 625 |
+
def classify_unique(
|
| 626 |
+
iterable: Iterable[_T], key: Callable[[_T], _U] | None = ...
|
| 627 |
+
) -> Iterator[tuple[_T, bool, bool]]: ...
|
| 628 |
+
|
| 629 |
+
class _SupportsLessThan(Protocol):
|
| 630 |
+
def __lt__(self, __other: Any) -> bool: ...
|
| 631 |
+
|
| 632 |
+
_SupportsLessThanT = TypeVar("_SupportsLessThanT", bound=_SupportsLessThan)
|
| 633 |
+
|
| 634 |
+
@overload
|
| 635 |
+
def minmax(
|
| 636 |
+
iterable_or_value: Iterable[_SupportsLessThanT], *, key: None = None
|
| 637 |
+
) -> tuple[_SupportsLessThanT, _SupportsLessThanT]: ...
|
| 638 |
+
@overload
|
| 639 |
+
def minmax(
|
| 640 |
+
iterable_or_value: Iterable[_T], *, key: Callable[[_T], _SupportsLessThan]
|
| 641 |
+
) -> tuple[_T, _T]: ...
|
| 642 |
+
@overload
|
| 643 |
+
def minmax(
|
| 644 |
+
iterable_or_value: Iterable[_SupportsLessThanT],
|
| 645 |
+
*,
|
| 646 |
+
key: None = None,
|
| 647 |
+
default: _U,
|
| 648 |
+
) -> _U | tuple[_SupportsLessThanT, _SupportsLessThanT]: ...
|
| 649 |
+
@overload
|
| 650 |
+
def minmax(
|
| 651 |
+
iterable_or_value: Iterable[_T],
|
| 652 |
+
*,
|
| 653 |
+
key: Callable[[_T], _SupportsLessThan],
|
| 654 |
+
default: _U,
|
| 655 |
+
) -> _U | tuple[_T, _T]: ...
|
| 656 |
+
@overload
|
| 657 |
+
def minmax(
|
| 658 |
+
iterable_or_value: _SupportsLessThanT,
|
| 659 |
+
__other: _SupportsLessThanT,
|
| 660 |
+
*others: _SupportsLessThanT,
|
| 661 |
+
) -> tuple[_SupportsLessThanT, _SupportsLessThanT]: ...
|
| 662 |
+
@overload
|
| 663 |
+
def minmax(
|
| 664 |
+
iterable_or_value: _T,
|
| 665 |
+
__other: _T,
|
| 666 |
+
*others: _T,
|
| 667 |
+
key: Callable[[_T], _SupportsLessThan],
|
| 668 |
+
) -> tuple[_T, _T]: ...
|
| 669 |
+
def longest_common_prefix(
|
| 670 |
+
iterables: Iterable[Iterable[_T]],
|
| 671 |
+
) -> Iterator[_T]: ...
|
| 672 |
+
def iequals(*iterables: Iterable[Any]) -> bool: ...
|
| 673 |
+
def constrained_batches(
|
| 674 |
+
iterable: Iterable[_T],
|
| 675 |
+
max_size: int,
|
| 676 |
+
max_count: int | None = ...,
|
| 677 |
+
get_len: Callable[[_T], object] = ...,
|
| 678 |
+
strict: bool = ...,
|
| 679 |
+
) -> Iterator[tuple[_T]]: ...
|
| 680 |
+
def gray_product(*iterables: Iterable[_T]) -> Iterator[tuple[_T, ...]]: ...
|
| 681 |
+
def partial_product(*iterables: Iterable[_T]) -> Iterator[tuple[_T, ...]]: ...
|
| 682 |
+
def takewhile_inclusive(
|
| 683 |
+
predicate: Callable[[_T], bool], iterable: Iterable[_T]
|
| 684 |
+
) -> Iterator[_T]: ...
|
| 685 |
+
def outer_product(
|
| 686 |
+
func: Callable[[_T, _U], _V],
|
| 687 |
+
xs: Iterable[_T],
|
| 688 |
+
ys: Iterable[_U],
|
| 689 |
+
*args: Any,
|
| 690 |
+
**kwargs: Any,
|
| 691 |
+
) -> Iterator[tuple[_V, ...]]: ...
|
| 692 |
+
def iter_suppress(
|
| 693 |
+
iterable: Iterable[_T],
|
| 694 |
+
*exceptions: Type[BaseException],
|
| 695 |
+
) -> Iterator[_T]: ...
|
| 696 |
+
def filter_map(
|
| 697 |
+
func: Callable[[_T], _V | None],
|
| 698 |
+
iterable: Iterable[_T],
|
| 699 |
+
) -> Iterator[_V]: ...
|
| 700 |
+
def powerset_of_sets(iterable: Iterable[_T]) -> Iterator[set[_T]]: ...
|
| 701 |
+
def join_mappings(
|
| 702 |
+
**field_to_map: Mapping[_T, _V]
|
| 703 |
+
) -> dict[_T, dict[str, _V]]: ...
|
| 704 |
+
def doublestarmap(
|
| 705 |
+
func: Callable[..., _T],
|
| 706 |
+
iterable: Iterable[Mapping[str, Any]],
|
| 707 |
+
) -> Iterator[_T]: ...
|
| 708 |
+
def dft(xarr: Sequence[complex]) -> Iterator[complex]: ...
|
| 709 |
+
def idft(Xarr: Sequence[complex]) -> Iterator[complex]: ...
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/py.typed
ADDED
|
File without changes
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/recipes.py
ADDED
|
@@ -0,0 +1,1046 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Imported from the recipes section of the itertools documentation.
|
| 2 |
+
|
| 3 |
+
All functions taken from the recipes section of the itertools library docs
|
| 4 |
+
[1]_.
|
| 5 |
+
Some backward-compatible usability improvements have been made.
|
| 6 |
+
|
| 7 |
+
.. [1] http://docs.python.org/library/itertools.html#recipes
|
| 8 |
+
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import math
|
| 12 |
+
import operator
|
| 13 |
+
|
| 14 |
+
from collections import deque
|
| 15 |
+
from collections.abc import Sized
|
| 16 |
+
from functools import partial, reduce
|
| 17 |
+
from itertools import (
|
| 18 |
+
chain,
|
| 19 |
+
combinations,
|
| 20 |
+
compress,
|
| 21 |
+
count,
|
| 22 |
+
cycle,
|
| 23 |
+
groupby,
|
| 24 |
+
islice,
|
| 25 |
+
product,
|
| 26 |
+
repeat,
|
| 27 |
+
starmap,
|
| 28 |
+
tee,
|
| 29 |
+
zip_longest,
|
| 30 |
+
)
|
| 31 |
+
from random import randrange, sample, choice
|
| 32 |
+
from sys import hexversion
|
| 33 |
+
|
| 34 |
+
__all__ = [
|
| 35 |
+
'all_equal',
|
| 36 |
+
'batched',
|
| 37 |
+
'before_and_after',
|
| 38 |
+
'consume',
|
| 39 |
+
'convolve',
|
| 40 |
+
'dotproduct',
|
| 41 |
+
'first_true',
|
| 42 |
+
'factor',
|
| 43 |
+
'flatten',
|
| 44 |
+
'grouper',
|
| 45 |
+
'iter_except',
|
| 46 |
+
'iter_index',
|
| 47 |
+
'matmul',
|
| 48 |
+
'ncycles',
|
| 49 |
+
'nth',
|
| 50 |
+
'nth_combination',
|
| 51 |
+
'padnone',
|
| 52 |
+
'pad_none',
|
| 53 |
+
'pairwise',
|
| 54 |
+
'partition',
|
| 55 |
+
'polynomial_eval',
|
| 56 |
+
'polynomial_from_roots',
|
| 57 |
+
'polynomial_derivative',
|
| 58 |
+
'powerset',
|
| 59 |
+
'prepend',
|
| 60 |
+
'quantify',
|
| 61 |
+
'reshape',
|
| 62 |
+
'random_combination_with_replacement',
|
| 63 |
+
'random_combination',
|
| 64 |
+
'random_permutation',
|
| 65 |
+
'random_product',
|
| 66 |
+
'repeatfunc',
|
| 67 |
+
'roundrobin',
|
| 68 |
+
'sieve',
|
| 69 |
+
'sliding_window',
|
| 70 |
+
'subslices',
|
| 71 |
+
'sum_of_squares',
|
| 72 |
+
'tabulate',
|
| 73 |
+
'tail',
|
| 74 |
+
'take',
|
| 75 |
+
'totient',
|
| 76 |
+
'transpose',
|
| 77 |
+
'triplewise',
|
| 78 |
+
'unique',
|
| 79 |
+
'unique_everseen',
|
| 80 |
+
'unique_justseen',
|
| 81 |
+
]
|
| 82 |
+
|
| 83 |
+
_marker = object()
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
# zip with strict is available for Python 3.10+
|
| 87 |
+
try:
|
| 88 |
+
zip(strict=True)
|
| 89 |
+
except TypeError:
|
| 90 |
+
_zip_strict = zip
|
| 91 |
+
else:
|
| 92 |
+
_zip_strict = partial(zip, strict=True)
|
| 93 |
+
|
| 94 |
+
# math.sumprod is available for Python 3.12+
|
| 95 |
+
_sumprod = getattr(math, 'sumprod', lambda x, y: dotproduct(x, y))
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def take(n, iterable):
|
| 99 |
+
"""Return first *n* items of the iterable as a list.
|
| 100 |
+
|
| 101 |
+
>>> take(3, range(10))
|
| 102 |
+
[0, 1, 2]
|
| 103 |
+
|
| 104 |
+
If there are fewer than *n* items in the iterable, all of them are
|
| 105 |
+
returned.
|
| 106 |
+
|
| 107 |
+
>>> take(10, range(3))
|
| 108 |
+
[0, 1, 2]
|
| 109 |
+
|
| 110 |
+
"""
|
| 111 |
+
return list(islice(iterable, n))
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def tabulate(function, start=0):
|
| 115 |
+
"""Return an iterator over the results of ``func(start)``,
|
| 116 |
+
``func(start + 1)``, ``func(start + 2)``...
|
| 117 |
+
|
| 118 |
+
*func* should be a function that accepts one integer argument.
|
| 119 |
+
|
| 120 |
+
If *start* is not specified it defaults to 0. It will be incremented each
|
| 121 |
+
time the iterator is advanced.
|
| 122 |
+
|
| 123 |
+
>>> square = lambda x: x ** 2
|
| 124 |
+
>>> iterator = tabulate(square, -3)
|
| 125 |
+
>>> take(4, iterator)
|
| 126 |
+
[9, 4, 1, 0]
|
| 127 |
+
|
| 128 |
+
"""
|
| 129 |
+
return map(function, count(start))
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
def tail(n, iterable):
|
| 133 |
+
"""Return an iterator over the last *n* items of *iterable*.
|
| 134 |
+
|
| 135 |
+
>>> t = tail(3, 'ABCDEFG')
|
| 136 |
+
>>> list(t)
|
| 137 |
+
['E', 'F', 'G']
|
| 138 |
+
|
| 139 |
+
"""
|
| 140 |
+
# If the given iterable has a length, then we can use islice to get its
|
| 141 |
+
# final elements. Note that if the iterable is not actually Iterable,
|
| 142 |
+
# either islice or deque will throw a TypeError. This is why we don't
|
| 143 |
+
# check if it is Iterable.
|
| 144 |
+
if isinstance(iterable, Sized):
|
| 145 |
+
yield from islice(iterable, max(0, len(iterable) - n), None)
|
| 146 |
+
else:
|
| 147 |
+
yield from iter(deque(iterable, maxlen=n))
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def consume(iterator, n=None):
|
| 151 |
+
"""Advance *iterable* by *n* steps. If *n* is ``None``, consume it
|
| 152 |
+
entirely.
|
| 153 |
+
|
| 154 |
+
Efficiently exhausts an iterator without returning values. Defaults to
|
| 155 |
+
consuming the whole iterator, but an optional second argument may be
|
| 156 |
+
provided to limit consumption.
|
| 157 |
+
|
| 158 |
+
>>> i = (x for x in range(10))
|
| 159 |
+
>>> next(i)
|
| 160 |
+
0
|
| 161 |
+
>>> consume(i, 3)
|
| 162 |
+
>>> next(i)
|
| 163 |
+
4
|
| 164 |
+
>>> consume(i)
|
| 165 |
+
>>> next(i)
|
| 166 |
+
Traceback (most recent call last):
|
| 167 |
+
File "<stdin>", line 1, in <module>
|
| 168 |
+
StopIteration
|
| 169 |
+
|
| 170 |
+
If the iterator has fewer items remaining than the provided limit, the
|
| 171 |
+
whole iterator will be consumed.
|
| 172 |
+
|
| 173 |
+
>>> i = (x for x in range(3))
|
| 174 |
+
>>> consume(i, 5)
|
| 175 |
+
>>> next(i)
|
| 176 |
+
Traceback (most recent call last):
|
| 177 |
+
File "<stdin>", line 1, in <module>
|
| 178 |
+
StopIteration
|
| 179 |
+
|
| 180 |
+
"""
|
| 181 |
+
# Use functions that consume iterators at C speed.
|
| 182 |
+
if n is None:
|
| 183 |
+
# feed the entire iterator into a zero-length deque
|
| 184 |
+
deque(iterator, maxlen=0)
|
| 185 |
+
else:
|
| 186 |
+
# advance to the empty slice starting at position n
|
| 187 |
+
next(islice(iterator, n, n), None)
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
def nth(iterable, n, default=None):
|
| 191 |
+
"""Returns the nth item or a default value.
|
| 192 |
+
|
| 193 |
+
>>> l = range(10)
|
| 194 |
+
>>> nth(l, 3)
|
| 195 |
+
3
|
| 196 |
+
>>> nth(l, 20, "zebra")
|
| 197 |
+
'zebra'
|
| 198 |
+
|
| 199 |
+
"""
|
| 200 |
+
return next(islice(iterable, n, None), default)
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
def all_equal(iterable, key=None):
|
| 204 |
+
"""
|
| 205 |
+
Returns ``True`` if all the elements are equal to each other.
|
| 206 |
+
|
| 207 |
+
>>> all_equal('aaaa')
|
| 208 |
+
True
|
| 209 |
+
>>> all_equal('aaab')
|
| 210 |
+
False
|
| 211 |
+
|
| 212 |
+
A function that accepts a single argument and returns a transformed version
|
| 213 |
+
of each input item can be specified with *key*:
|
| 214 |
+
|
| 215 |
+
>>> all_equal('AaaA', key=str.casefold)
|
| 216 |
+
True
|
| 217 |
+
>>> all_equal([1, 2, 3], key=lambda x: x < 10)
|
| 218 |
+
True
|
| 219 |
+
|
| 220 |
+
"""
|
| 221 |
+
return len(list(islice(groupby(iterable, key), 2))) <= 1
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
def quantify(iterable, pred=bool):
|
| 225 |
+
"""Return the how many times the predicate is true.
|
| 226 |
+
|
| 227 |
+
>>> quantify([True, False, True])
|
| 228 |
+
2
|
| 229 |
+
|
| 230 |
+
"""
|
| 231 |
+
return sum(map(pred, iterable))
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
def pad_none(iterable):
|
| 235 |
+
"""Returns the sequence of elements and then returns ``None`` indefinitely.
|
| 236 |
+
|
| 237 |
+
>>> take(5, pad_none(range(3)))
|
| 238 |
+
[0, 1, 2, None, None]
|
| 239 |
+
|
| 240 |
+
Useful for emulating the behavior of the built-in :func:`map` function.
|
| 241 |
+
|
| 242 |
+
See also :func:`padded`.
|
| 243 |
+
|
| 244 |
+
"""
|
| 245 |
+
return chain(iterable, repeat(None))
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
padnone = pad_none
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
def ncycles(iterable, n):
|
| 252 |
+
"""Returns the sequence elements *n* times
|
| 253 |
+
|
| 254 |
+
>>> list(ncycles(["a", "b"], 3))
|
| 255 |
+
['a', 'b', 'a', 'b', 'a', 'b']
|
| 256 |
+
|
| 257 |
+
"""
|
| 258 |
+
return chain.from_iterable(repeat(tuple(iterable), n))
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
def dotproduct(vec1, vec2):
|
| 262 |
+
"""Returns the dot product of the two iterables.
|
| 263 |
+
|
| 264 |
+
>>> dotproduct([10, 10], [20, 20])
|
| 265 |
+
400
|
| 266 |
+
|
| 267 |
+
"""
|
| 268 |
+
return sum(map(operator.mul, vec1, vec2))
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
def flatten(listOfLists):
|
| 272 |
+
"""Return an iterator flattening one level of nesting in a list of lists.
|
| 273 |
+
|
| 274 |
+
>>> list(flatten([[0, 1], [2, 3]]))
|
| 275 |
+
[0, 1, 2, 3]
|
| 276 |
+
|
| 277 |
+
See also :func:`collapse`, which can flatten multiple levels of nesting.
|
| 278 |
+
|
| 279 |
+
"""
|
| 280 |
+
return chain.from_iterable(listOfLists)
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
def repeatfunc(func, times=None, *args):
|
| 284 |
+
"""Call *func* with *args* repeatedly, returning an iterable over the
|
| 285 |
+
results.
|
| 286 |
+
|
| 287 |
+
If *times* is specified, the iterable will terminate after that many
|
| 288 |
+
repetitions:
|
| 289 |
+
|
| 290 |
+
>>> from operator import add
|
| 291 |
+
>>> times = 4
|
| 292 |
+
>>> args = 3, 5
|
| 293 |
+
>>> list(repeatfunc(add, times, *args))
|
| 294 |
+
[8, 8, 8, 8]
|
| 295 |
+
|
| 296 |
+
If *times* is ``None`` the iterable will not terminate:
|
| 297 |
+
|
| 298 |
+
>>> from random import randrange
|
| 299 |
+
>>> times = None
|
| 300 |
+
>>> args = 1, 11
|
| 301 |
+
>>> take(6, repeatfunc(randrange, times, *args)) # doctest:+SKIP
|
| 302 |
+
[2, 4, 8, 1, 8, 4]
|
| 303 |
+
|
| 304 |
+
"""
|
| 305 |
+
if times is None:
|
| 306 |
+
return starmap(func, repeat(args))
|
| 307 |
+
return starmap(func, repeat(args, times))
|
| 308 |
+
|
| 309 |
+
|
| 310 |
+
def _pairwise(iterable):
|
| 311 |
+
"""Returns an iterator of paired items, overlapping, from the original
|
| 312 |
+
|
| 313 |
+
>>> take(4, pairwise(count()))
|
| 314 |
+
[(0, 1), (1, 2), (2, 3), (3, 4)]
|
| 315 |
+
|
| 316 |
+
On Python 3.10 and above, this is an alias for :func:`itertools.pairwise`.
|
| 317 |
+
|
| 318 |
+
"""
|
| 319 |
+
a, b = tee(iterable)
|
| 320 |
+
next(b, None)
|
| 321 |
+
return zip(a, b)
|
| 322 |
+
|
| 323 |
+
|
| 324 |
+
try:
|
| 325 |
+
from itertools import pairwise as itertools_pairwise
|
| 326 |
+
except ImportError:
|
| 327 |
+
pairwise = _pairwise
|
| 328 |
+
else:
|
| 329 |
+
|
| 330 |
+
def pairwise(iterable):
|
| 331 |
+
return itertools_pairwise(iterable)
|
| 332 |
+
|
| 333 |
+
pairwise.__doc__ = _pairwise.__doc__
|
| 334 |
+
|
| 335 |
+
|
| 336 |
+
class UnequalIterablesError(ValueError):
|
| 337 |
+
def __init__(self, details=None):
|
| 338 |
+
msg = 'Iterables have different lengths'
|
| 339 |
+
if details is not None:
|
| 340 |
+
msg += (': index 0 has length {}; index {} has length {}').format(
|
| 341 |
+
*details
|
| 342 |
+
)
|
| 343 |
+
|
| 344 |
+
super().__init__(msg)
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
def _zip_equal_generator(iterables):
|
| 348 |
+
for combo in zip_longest(*iterables, fillvalue=_marker):
|
| 349 |
+
for val in combo:
|
| 350 |
+
if val is _marker:
|
| 351 |
+
raise UnequalIterablesError()
|
| 352 |
+
yield combo
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def _zip_equal(*iterables):
|
| 356 |
+
# Check whether the iterables are all the same size.
|
| 357 |
+
try:
|
| 358 |
+
first_size = len(iterables[0])
|
| 359 |
+
for i, it in enumerate(iterables[1:], 1):
|
| 360 |
+
size = len(it)
|
| 361 |
+
if size != first_size:
|
| 362 |
+
raise UnequalIterablesError(details=(first_size, i, size))
|
| 363 |
+
# All sizes are equal, we can use the built-in zip.
|
| 364 |
+
return zip(*iterables)
|
| 365 |
+
# If any one of the iterables didn't have a length, start reading
|
| 366 |
+
# them until one runs out.
|
| 367 |
+
except TypeError:
|
| 368 |
+
return _zip_equal_generator(iterables)
|
| 369 |
+
|
| 370 |
+
|
| 371 |
+
def grouper(iterable, n, incomplete='fill', fillvalue=None):
|
| 372 |
+
"""Group elements from *iterable* into fixed-length groups of length *n*.
|
| 373 |
+
|
| 374 |
+
>>> list(grouper('ABCDEF', 3))
|
| 375 |
+
[('A', 'B', 'C'), ('D', 'E', 'F')]
|
| 376 |
+
|
| 377 |
+
The keyword arguments *incomplete* and *fillvalue* control what happens for
|
| 378 |
+
iterables whose length is not a multiple of *n*.
|
| 379 |
+
|
| 380 |
+
When *incomplete* is `'fill'`, the last group will contain instances of
|
| 381 |
+
*fillvalue*.
|
| 382 |
+
|
| 383 |
+
>>> list(grouper('ABCDEFG', 3, incomplete='fill', fillvalue='x'))
|
| 384 |
+
[('A', 'B', 'C'), ('D', 'E', 'F'), ('G', 'x', 'x')]
|
| 385 |
+
|
| 386 |
+
When *incomplete* is `'ignore'`, the last group will not be emitted.
|
| 387 |
+
|
| 388 |
+
>>> list(grouper('ABCDEFG', 3, incomplete='ignore', fillvalue='x'))
|
| 389 |
+
[('A', 'B', 'C'), ('D', 'E', 'F')]
|
| 390 |
+
|
| 391 |
+
When *incomplete* is `'strict'`, a subclass of `ValueError` will be raised.
|
| 392 |
+
|
| 393 |
+
>>> it = grouper('ABCDEFG', 3, incomplete='strict')
|
| 394 |
+
>>> list(it) # doctest: +IGNORE_EXCEPTION_DETAIL
|
| 395 |
+
Traceback (most recent call last):
|
| 396 |
+
...
|
| 397 |
+
UnequalIterablesError
|
| 398 |
+
|
| 399 |
+
"""
|
| 400 |
+
args = [iter(iterable)] * n
|
| 401 |
+
if incomplete == 'fill':
|
| 402 |
+
return zip_longest(*args, fillvalue=fillvalue)
|
| 403 |
+
if incomplete == 'strict':
|
| 404 |
+
return _zip_equal(*args)
|
| 405 |
+
if incomplete == 'ignore':
|
| 406 |
+
return zip(*args)
|
| 407 |
+
else:
|
| 408 |
+
raise ValueError('Expected fill, strict, or ignore')
|
| 409 |
+
|
| 410 |
+
|
| 411 |
+
def roundrobin(*iterables):
|
| 412 |
+
"""Yields an item from each iterable, alternating between them.
|
| 413 |
+
|
| 414 |
+
>>> list(roundrobin('ABC', 'D', 'EF'))
|
| 415 |
+
['A', 'D', 'E', 'B', 'F', 'C']
|
| 416 |
+
|
| 417 |
+
This function produces the same output as :func:`interleave_longest`, but
|
| 418 |
+
may perform better for some inputs (in particular when the number of
|
| 419 |
+
iterables is small).
|
| 420 |
+
|
| 421 |
+
"""
|
| 422 |
+
# Algorithm credited to George Sakkis
|
| 423 |
+
iterators = map(iter, iterables)
|
| 424 |
+
for num_active in range(len(iterables), 0, -1):
|
| 425 |
+
iterators = cycle(islice(iterators, num_active))
|
| 426 |
+
yield from map(next, iterators)
|
| 427 |
+
|
| 428 |
+
|
| 429 |
+
def partition(pred, iterable):
|
| 430 |
+
"""
|
| 431 |
+
Returns a 2-tuple of iterables derived from the input iterable.
|
| 432 |
+
The first yields the items that have ``pred(item) == False``.
|
| 433 |
+
The second yields the items that have ``pred(item) == True``.
|
| 434 |
+
|
| 435 |
+
>>> is_odd = lambda x: x % 2 != 0
|
| 436 |
+
>>> iterable = range(10)
|
| 437 |
+
>>> even_items, odd_items = partition(is_odd, iterable)
|
| 438 |
+
>>> list(even_items), list(odd_items)
|
| 439 |
+
([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])
|
| 440 |
+
|
| 441 |
+
If *pred* is None, :func:`bool` is used.
|
| 442 |
+
|
| 443 |
+
>>> iterable = [0, 1, False, True, '', ' ']
|
| 444 |
+
>>> false_items, true_items = partition(None, iterable)
|
| 445 |
+
>>> list(false_items), list(true_items)
|
| 446 |
+
([0, False, ''], [1, True, ' '])
|
| 447 |
+
|
| 448 |
+
"""
|
| 449 |
+
if pred is None:
|
| 450 |
+
pred = bool
|
| 451 |
+
|
| 452 |
+
t1, t2, p = tee(iterable, 3)
|
| 453 |
+
p1, p2 = tee(map(pred, p))
|
| 454 |
+
return (compress(t1, map(operator.not_, p1)), compress(t2, p2))
|
| 455 |
+
|
| 456 |
+
|
| 457 |
+
def powerset(iterable):
|
| 458 |
+
"""Yields all possible subsets of the iterable.
|
| 459 |
+
|
| 460 |
+
>>> list(powerset([1, 2, 3]))
|
| 461 |
+
[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]
|
| 462 |
+
|
| 463 |
+
:func:`powerset` will operate on iterables that aren't :class:`set`
|
| 464 |
+
instances, so repeated elements in the input will produce repeated elements
|
| 465 |
+
in the output.
|
| 466 |
+
|
| 467 |
+
>>> seq = [1, 1, 0]
|
| 468 |
+
>>> list(powerset(seq))
|
| 469 |
+
[(), (1,), (1,), (0,), (1, 1), (1, 0), (1, 0), (1, 1, 0)]
|
| 470 |
+
|
| 471 |
+
For a variant that efficiently yields actual :class:`set` instances, see
|
| 472 |
+
:func:`powerset_of_sets`.
|
| 473 |
+
"""
|
| 474 |
+
s = list(iterable)
|
| 475 |
+
return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))
|
| 476 |
+
|
| 477 |
+
|
| 478 |
+
def unique_everseen(iterable, key=None):
|
| 479 |
+
"""
|
| 480 |
+
Yield unique elements, preserving order.
|
| 481 |
+
|
| 482 |
+
>>> list(unique_everseen('AAAABBBCCDAABBB'))
|
| 483 |
+
['A', 'B', 'C', 'D']
|
| 484 |
+
>>> list(unique_everseen('ABBCcAD', str.lower))
|
| 485 |
+
['A', 'B', 'C', 'D']
|
| 486 |
+
|
| 487 |
+
Sequences with a mix of hashable and unhashable items can be used.
|
| 488 |
+
The function will be slower (i.e., `O(n^2)`) for unhashable items.
|
| 489 |
+
|
| 490 |
+
Remember that ``list`` objects are unhashable - you can use the *key*
|
| 491 |
+
parameter to transform the list to a tuple (which is hashable) to
|
| 492 |
+
avoid a slowdown.
|
| 493 |
+
|
| 494 |
+
>>> iterable = ([1, 2], [2, 3], [1, 2])
|
| 495 |
+
>>> list(unique_everseen(iterable)) # Slow
|
| 496 |
+
[[1, 2], [2, 3]]
|
| 497 |
+
>>> list(unique_everseen(iterable, key=tuple)) # Faster
|
| 498 |
+
[[1, 2], [2, 3]]
|
| 499 |
+
|
| 500 |
+
Similarly, you may want to convert unhashable ``set`` objects with
|
| 501 |
+
``key=frozenset``. For ``dict`` objects,
|
| 502 |
+
``key=lambda x: frozenset(x.items())`` can be used.
|
| 503 |
+
|
| 504 |
+
"""
|
| 505 |
+
seenset = set()
|
| 506 |
+
seenset_add = seenset.add
|
| 507 |
+
seenlist = []
|
| 508 |
+
seenlist_add = seenlist.append
|
| 509 |
+
use_key = key is not None
|
| 510 |
+
|
| 511 |
+
for element in iterable:
|
| 512 |
+
k = key(element) if use_key else element
|
| 513 |
+
try:
|
| 514 |
+
if k not in seenset:
|
| 515 |
+
seenset_add(k)
|
| 516 |
+
yield element
|
| 517 |
+
except TypeError:
|
| 518 |
+
if k not in seenlist:
|
| 519 |
+
seenlist_add(k)
|
| 520 |
+
yield element
|
| 521 |
+
|
| 522 |
+
|
| 523 |
+
def unique_justseen(iterable, key=None):
|
| 524 |
+
"""Yields elements in order, ignoring serial duplicates
|
| 525 |
+
|
| 526 |
+
>>> list(unique_justseen('AAAABBBCCDAABBB'))
|
| 527 |
+
['A', 'B', 'C', 'D', 'A', 'B']
|
| 528 |
+
>>> list(unique_justseen('ABBCcAD', str.lower))
|
| 529 |
+
['A', 'B', 'C', 'A', 'D']
|
| 530 |
+
|
| 531 |
+
"""
|
| 532 |
+
if key is None:
|
| 533 |
+
return map(operator.itemgetter(0), groupby(iterable))
|
| 534 |
+
|
| 535 |
+
return map(next, map(operator.itemgetter(1), groupby(iterable, key)))
|
| 536 |
+
|
| 537 |
+
|
| 538 |
+
def unique(iterable, key=None, reverse=False):
|
| 539 |
+
"""Yields unique elements in sorted order.
|
| 540 |
+
|
| 541 |
+
>>> list(unique([[1, 2], [3, 4], [1, 2]]))
|
| 542 |
+
[[1, 2], [3, 4]]
|
| 543 |
+
|
| 544 |
+
*key* and *reverse* are passed to :func:`sorted`.
|
| 545 |
+
|
| 546 |
+
>>> list(unique('ABBcCAD', str.casefold))
|
| 547 |
+
['A', 'B', 'c', 'D']
|
| 548 |
+
>>> list(unique('ABBcCAD', str.casefold, reverse=True))
|
| 549 |
+
['D', 'c', 'B', 'A']
|
| 550 |
+
|
| 551 |
+
The elements in *iterable* need not be hashable, but they must be
|
| 552 |
+
comparable for sorting to work.
|
| 553 |
+
"""
|
| 554 |
+
return unique_justseen(sorted(iterable, key=key, reverse=reverse), key=key)
|
| 555 |
+
|
| 556 |
+
|
| 557 |
+
def iter_except(func, exception, first=None):
|
| 558 |
+
"""Yields results from a function repeatedly until an exception is raised.
|
| 559 |
+
|
| 560 |
+
Converts a call-until-exception interface to an iterator interface.
|
| 561 |
+
Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
|
| 562 |
+
to end the loop.
|
| 563 |
+
|
| 564 |
+
>>> l = [0, 1, 2]
|
| 565 |
+
>>> list(iter_except(l.pop, IndexError))
|
| 566 |
+
[2, 1, 0]
|
| 567 |
+
|
| 568 |
+
Multiple exceptions can be specified as a stopping condition:
|
| 569 |
+
|
| 570 |
+
>>> l = [1, 2, 3, '...', 4, 5, 6]
|
| 571 |
+
>>> list(iter_except(lambda: 1 + l.pop(), (IndexError, TypeError)))
|
| 572 |
+
[7, 6, 5]
|
| 573 |
+
>>> list(iter_except(lambda: 1 + l.pop(), (IndexError, TypeError)))
|
| 574 |
+
[4, 3, 2]
|
| 575 |
+
>>> list(iter_except(lambda: 1 + l.pop(), (IndexError, TypeError)))
|
| 576 |
+
[]
|
| 577 |
+
|
| 578 |
+
"""
|
| 579 |
+
try:
|
| 580 |
+
if first is not None:
|
| 581 |
+
yield first()
|
| 582 |
+
while 1:
|
| 583 |
+
yield func()
|
| 584 |
+
except exception:
|
| 585 |
+
pass
|
| 586 |
+
|
| 587 |
+
|
| 588 |
+
def first_true(iterable, default=None, pred=None):
|
| 589 |
+
"""
|
| 590 |
+
Returns the first true value in the iterable.
|
| 591 |
+
|
| 592 |
+
If no true value is found, returns *default*
|
| 593 |
+
|
| 594 |
+
If *pred* is not None, returns the first item for which
|
| 595 |
+
``pred(item) == True`` .
|
| 596 |
+
|
| 597 |
+
>>> first_true(range(10))
|
| 598 |
+
1
|
| 599 |
+
>>> first_true(range(10), pred=lambda x: x > 5)
|
| 600 |
+
6
|
| 601 |
+
>>> first_true(range(10), default='missing', pred=lambda x: x > 9)
|
| 602 |
+
'missing'
|
| 603 |
+
|
| 604 |
+
"""
|
| 605 |
+
return next(filter(pred, iterable), default)
|
| 606 |
+
|
| 607 |
+
|
| 608 |
+
def random_product(*args, repeat=1):
|
| 609 |
+
"""Draw an item at random from each of the input iterables.
|
| 610 |
+
|
| 611 |
+
>>> random_product('abc', range(4), 'XYZ') # doctest:+SKIP
|
| 612 |
+
('c', 3, 'Z')
|
| 613 |
+
|
| 614 |
+
If *repeat* is provided as a keyword argument, that many items will be
|
| 615 |
+
drawn from each iterable.
|
| 616 |
+
|
| 617 |
+
>>> random_product('abcd', range(4), repeat=2) # doctest:+SKIP
|
| 618 |
+
('a', 2, 'd', 3)
|
| 619 |
+
|
| 620 |
+
This equivalent to taking a random selection from
|
| 621 |
+
``itertools.product(*args, **kwarg)``.
|
| 622 |
+
|
| 623 |
+
"""
|
| 624 |
+
pools = [tuple(pool) for pool in args] * repeat
|
| 625 |
+
return tuple(choice(pool) for pool in pools)
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
def random_permutation(iterable, r=None):
|
| 629 |
+
"""Return a random *r* length permutation of the elements in *iterable*.
|
| 630 |
+
|
| 631 |
+
If *r* is not specified or is ``None``, then *r* defaults to the length of
|
| 632 |
+
*iterable*.
|
| 633 |
+
|
| 634 |
+
>>> random_permutation(range(5)) # doctest:+SKIP
|
| 635 |
+
(3, 4, 0, 1, 2)
|
| 636 |
+
|
| 637 |
+
This equivalent to taking a random selection from
|
| 638 |
+
``itertools.permutations(iterable, r)``.
|
| 639 |
+
|
| 640 |
+
"""
|
| 641 |
+
pool = tuple(iterable)
|
| 642 |
+
r = len(pool) if r is None else r
|
| 643 |
+
return tuple(sample(pool, r))
|
| 644 |
+
|
| 645 |
+
|
| 646 |
+
def random_combination(iterable, r):
|
| 647 |
+
"""Return a random *r* length subsequence of the elements in *iterable*.
|
| 648 |
+
|
| 649 |
+
>>> random_combination(range(5), 3) # doctest:+SKIP
|
| 650 |
+
(2, 3, 4)
|
| 651 |
+
|
| 652 |
+
This equivalent to taking a random selection from
|
| 653 |
+
``itertools.combinations(iterable, r)``.
|
| 654 |
+
|
| 655 |
+
"""
|
| 656 |
+
pool = tuple(iterable)
|
| 657 |
+
n = len(pool)
|
| 658 |
+
indices = sorted(sample(range(n), r))
|
| 659 |
+
return tuple(pool[i] for i in indices)
|
| 660 |
+
|
| 661 |
+
|
| 662 |
+
def random_combination_with_replacement(iterable, r):
|
| 663 |
+
"""Return a random *r* length subsequence of elements in *iterable*,
|
| 664 |
+
allowing individual elements to be repeated.
|
| 665 |
+
|
| 666 |
+
>>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
|
| 667 |
+
(0, 0, 1, 2, 2)
|
| 668 |
+
|
| 669 |
+
This equivalent to taking a random selection from
|
| 670 |
+
``itertools.combinations_with_replacement(iterable, r)``.
|
| 671 |
+
|
| 672 |
+
"""
|
| 673 |
+
pool = tuple(iterable)
|
| 674 |
+
n = len(pool)
|
| 675 |
+
indices = sorted(randrange(n) for i in range(r))
|
| 676 |
+
return tuple(pool[i] for i in indices)
|
| 677 |
+
|
| 678 |
+
|
| 679 |
+
def nth_combination(iterable, r, index):
|
| 680 |
+
"""Equivalent to ``list(combinations(iterable, r))[index]``.
|
| 681 |
+
|
| 682 |
+
The subsequences of *iterable* that are of length *r* can be ordered
|
| 683 |
+
lexicographically. :func:`nth_combination` computes the subsequence at
|
| 684 |
+
sort position *index* directly, without computing the previous
|
| 685 |
+
subsequences.
|
| 686 |
+
|
| 687 |
+
>>> nth_combination(range(5), 3, 5)
|
| 688 |
+
(0, 3, 4)
|
| 689 |
+
|
| 690 |
+
``ValueError`` will be raised If *r* is negative or greater than the length
|
| 691 |
+
of *iterable*.
|
| 692 |
+
``IndexError`` will be raised if the given *index* is invalid.
|
| 693 |
+
"""
|
| 694 |
+
pool = tuple(iterable)
|
| 695 |
+
n = len(pool)
|
| 696 |
+
if (r < 0) or (r > n):
|
| 697 |
+
raise ValueError
|
| 698 |
+
|
| 699 |
+
c = 1
|
| 700 |
+
k = min(r, n - r)
|
| 701 |
+
for i in range(1, k + 1):
|
| 702 |
+
c = c * (n - k + i) // i
|
| 703 |
+
|
| 704 |
+
if index < 0:
|
| 705 |
+
index += c
|
| 706 |
+
|
| 707 |
+
if (index < 0) or (index >= c):
|
| 708 |
+
raise IndexError
|
| 709 |
+
|
| 710 |
+
result = []
|
| 711 |
+
while r:
|
| 712 |
+
c, n, r = c * r // n, n - 1, r - 1
|
| 713 |
+
while index >= c:
|
| 714 |
+
index -= c
|
| 715 |
+
c, n = c * (n - r) // n, n - 1
|
| 716 |
+
result.append(pool[-1 - n])
|
| 717 |
+
|
| 718 |
+
return tuple(result)
|
| 719 |
+
|
| 720 |
+
|
| 721 |
+
def prepend(value, iterator):
|
| 722 |
+
"""Yield *value*, followed by the elements in *iterator*.
|
| 723 |
+
|
| 724 |
+
>>> value = '0'
|
| 725 |
+
>>> iterator = ['1', '2', '3']
|
| 726 |
+
>>> list(prepend(value, iterator))
|
| 727 |
+
['0', '1', '2', '3']
|
| 728 |
+
|
| 729 |
+
To prepend multiple values, see :func:`itertools.chain`
|
| 730 |
+
or :func:`value_chain`.
|
| 731 |
+
|
| 732 |
+
"""
|
| 733 |
+
return chain([value], iterator)
|
| 734 |
+
|
| 735 |
+
|
| 736 |
+
def convolve(signal, kernel):
|
| 737 |
+
"""Convolve the iterable *signal* with the iterable *kernel*.
|
| 738 |
+
|
| 739 |
+
>>> signal = (1, 2, 3, 4, 5)
|
| 740 |
+
>>> kernel = [3, 2, 1]
|
| 741 |
+
>>> list(convolve(signal, kernel))
|
| 742 |
+
[3, 8, 14, 20, 26, 14, 5]
|
| 743 |
+
|
| 744 |
+
Note: the input arguments are not interchangeable, as the *kernel*
|
| 745 |
+
is immediately consumed and stored.
|
| 746 |
+
|
| 747 |
+
"""
|
| 748 |
+
# This implementation intentionally doesn't match the one in the itertools
|
| 749 |
+
# documentation.
|
| 750 |
+
kernel = tuple(kernel)[::-1]
|
| 751 |
+
n = len(kernel)
|
| 752 |
+
window = deque([0], maxlen=n) * n
|
| 753 |
+
for x in chain(signal, repeat(0, n - 1)):
|
| 754 |
+
window.append(x)
|
| 755 |
+
yield _sumprod(kernel, window)
|
| 756 |
+
|
| 757 |
+
|
| 758 |
+
def before_and_after(predicate, it):
|
| 759 |
+
"""A variant of :func:`takewhile` that allows complete access to the
|
| 760 |
+
remainder of the iterator.
|
| 761 |
+
|
| 762 |
+
>>> it = iter('ABCdEfGhI')
|
| 763 |
+
>>> all_upper, remainder = before_and_after(str.isupper, it)
|
| 764 |
+
>>> ''.join(all_upper)
|
| 765 |
+
'ABC'
|
| 766 |
+
>>> ''.join(remainder) # takewhile() would lose the 'd'
|
| 767 |
+
'dEfGhI'
|
| 768 |
+
|
| 769 |
+
Note that the first iterator must be fully consumed before the second
|
| 770 |
+
iterator can generate valid results.
|
| 771 |
+
"""
|
| 772 |
+
it = iter(it)
|
| 773 |
+
transition = []
|
| 774 |
+
|
| 775 |
+
def true_iterator():
|
| 776 |
+
for elem in it:
|
| 777 |
+
if predicate(elem):
|
| 778 |
+
yield elem
|
| 779 |
+
else:
|
| 780 |
+
transition.append(elem)
|
| 781 |
+
return
|
| 782 |
+
|
| 783 |
+
# Note: this is different from itertools recipes to allow nesting
|
| 784 |
+
# before_and_after remainders into before_and_after again. See tests
|
| 785 |
+
# for an example.
|
| 786 |
+
remainder_iterator = chain(transition, it)
|
| 787 |
+
|
| 788 |
+
return true_iterator(), remainder_iterator
|
| 789 |
+
|
| 790 |
+
|
| 791 |
+
def triplewise(iterable):
|
| 792 |
+
"""Return overlapping triplets from *iterable*.
|
| 793 |
+
|
| 794 |
+
>>> list(triplewise('ABCDE'))
|
| 795 |
+
[('A', 'B', 'C'), ('B', 'C', 'D'), ('C', 'D', 'E')]
|
| 796 |
+
|
| 797 |
+
"""
|
| 798 |
+
for (a, _), (b, c) in pairwise(pairwise(iterable)):
|
| 799 |
+
yield a, b, c
|
| 800 |
+
|
| 801 |
+
|
| 802 |
+
def sliding_window(iterable, n):
|
| 803 |
+
"""Return a sliding window of width *n* over *iterable*.
|
| 804 |
+
|
| 805 |
+
>>> list(sliding_window(range(6), 4))
|
| 806 |
+
[(0, 1, 2, 3), (1, 2, 3, 4), (2, 3, 4, 5)]
|
| 807 |
+
|
| 808 |
+
If *iterable* has fewer than *n* items, then nothing is yielded:
|
| 809 |
+
|
| 810 |
+
>>> list(sliding_window(range(3), 4))
|
| 811 |
+
[]
|
| 812 |
+
|
| 813 |
+
For a variant with more features, see :func:`windowed`.
|
| 814 |
+
"""
|
| 815 |
+
it = iter(iterable)
|
| 816 |
+
window = deque(islice(it, n - 1), maxlen=n)
|
| 817 |
+
for x in it:
|
| 818 |
+
window.append(x)
|
| 819 |
+
yield tuple(window)
|
| 820 |
+
|
| 821 |
+
|
| 822 |
+
def subslices(iterable):
|
| 823 |
+
"""Return all contiguous non-empty subslices of *iterable*.
|
| 824 |
+
|
| 825 |
+
>>> list(subslices('ABC'))
|
| 826 |
+
[['A'], ['A', 'B'], ['A', 'B', 'C'], ['B'], ['B', 'C'], ['C']]
|
| 827 |
+
|
| 828 |
+
This is similar to :func:`substrings`, but emits items in a different
|
| 829 |
+
order.
|
| 830 |
+
"""
|
| 831 |
+
seq = list(iterable)
|
| 832 |
+
slices = starmap(slice, combinations(range(len(seq) + 1), 2))
|
| 833 |
+
return map(operator.getitem, repeat(seq), slices)
|
| 834 |
+
|
| 835 |
+
|
| 836 |
+
def polynomial_from_roots(roots):
|
| 837 |
+
"""Compute a polynomial's coefficients from its roots.
|
| 838 |
+
|
| 839 |
+
>>> roots = [5, -4, 3] # (x - 5) * (x + 4) * (x - 3)
|
| 840 |
+
>>> polynomial_from_roots(roots) # x^3 - 4 * x^2 - 17 * x + 60
|
| 841 |
+
[1, -4, -17, 60]
|
| 842 |
+
"""
|
| 843 |
+
factors = zip(repeat(1), map(operator.neg, roots))
|
| 844 |
+
return list(reduce(convolve, factors, [1]))
|
| 845 |
+
|
| 846 |
+
|
| 847 |
+
def iter_index(iterable, value, start=0, stop=None):
|
| 848 |
+
"""Yield the index of each place in *iterable* that *value* occurs,
|
| 849 |
+
beginning with index *start* and ending before index *stop*.
|
| 850 |
+
|
| 851 |
+
|
| 852 |
+
>>> list(iter_index('AABCADEAF', 'A'))
|
| 853 |
+
[0, 1, 4, 7]
|
| 854 |
+
>>> list(iter_index('AABCADEAF', 'A', 1)) # start index is inclusive
|
| 855 |
+
[1, 4, 7]
|
| 856 |
+
>>> list(iter_index('AABCADEAF', 'A', 1, 7)) # stop index is not inclusive
|
| 857 |
+
[1, 4]
|
| 858 |
+
|
| 859 |
+
The behavior for non-scalar *values* matches the built-in Python types.
|
| 860 |
+
|
| 861 |
+
>>> list(iter_index('ABCDABCD', 'AB'))
|
| 862 |
+
[0, 4]
|
| 863 |
+
>>> list(iter_index([0, 1, 2, 3, 0, 1, 2, 3], [0, 1]))
|
| 864 |
+
[]
|
| 865 |
+
>>> list(iter_index([[0, 1], [2, 3], [0, 1], [2, 3]], [0, 1]))
|
| 866 |
+
[0, 2]
|
| 867 |
+
|
| 868 |
+
See :func:`locate` for a more general means of finding the indexes
|
| 869 |
+
associated with particular values.
|
| 870 |
+
|
| 871 |
+
"""
|
| 872 |
+
seq_index = getattr(iterable, 'index', None)
|
| 873 |
+
if seq_index is None:
|
| 874 |
+
# Slow path for general iterables
|
| 875 |
+
it = islice(iterable, start, stop)
|
| 876 |
+
for i, element in enumerate(it, start):
|
| 877 |
+
if element is value or element == value:
|
| 878 |
+
yield i
|
| 879 |
+
else:
|
| 880 |
+
# Fast path for sequences
|
| 881 |
+
stop = len(iterable) if stop is None else stop
|
| 882 |
+
i = start - 1
|
| 883 |
+
try:
|
| 884 |
+
while True:
|
| 885 |
+
yield (i := seq_index(value, i + 1, stop))
|
| 886 |
+
except ValueError:
|
| 887 |
+
pass
|
| 888 |
+
|
| 889 |
+
|
| 890 |
+
def sieve(n):
|
| 891 |
+
"""Yield the primes less than n.
|
| 892 |
+
|
| 893 |
+
>>> list(sieve(30))
|
| 894 |
+
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
|
| 895 |
+
"""
|
| 896 |
+
if n > 2:
|
| 897 |
+
yield 2
|
| 898 |
+
start = 3
|
| 899 |
+
data = bytearray((0, 1)) * (n // 2)
|
| 900 |
+
limit = math.isqrt(n) + 1
|
| 901 |
+
for p in iter_index(data, 1, start, limit):
|
| 902 |
+
yield from iter_index(data, 1, start, p * p)
|
| 903 |
+
data[p * p : n : p + p] = bytes(len(range(p * p, n, p + p)))
|
| 904 |
+
start = p * p
|
| 905 |
+
yield from iter_index(data, 1, start)
|
| 906 |
+
|
| 907 |
+
|
| 908 |
+
def _batched(iterable, n, *, strict=False):
|
| 909 |
+
"""Batch data into tuples of length *n*. If the number of items in
|
| 910 |
+
*iterable* is not divisible by *n*:
|
| 911 |
+
* The last batch will be shorter if *strict* is ``False``.
|
| 912 |
+
* :exc:`ValueError` will be raised if *strict* is ``True``.
|
| 913 |
+
|
| 914 |
+
>>> list(batched('ABCDEFG', 3))
|
| 915 |
+
[('A', 'B', 'C'), ('D', 'E', 'F'), ('G',)]
|
| 916 |
+
|
| 917 |
+
On Python 3.13 and above, this is an alias for :func:`itertools.batched`.
|
| 918 |
+
"""
|
| 919 |
+
if n < 1:
|
| 920 |
+
raise ValueError('n must be at least one')
|
| 921 |
+
it = iter(iterable)
|
| 922 |
+
while batch := tuple(islice(it, n)):
|
| 923 |
+
if strict and len(batch) != n:
|
| 924 |
+
raise ValueError('batched(): incomplete batch')
|
| 925 |
+
yield batch
|
| 926 |
+
|
| 927 |
+
|
| 928 |
+
if hexversion >= 0x30D00A2:
|
| 929 |
+
from itertools import batched as itertools_batched
|
| 930 |
+
|
| 931 |
+
def batched(iterable, n, *, strict=False):
|
| 932 |
+
return itertools_batched(iterable, n, strict=strict)
|
| 933 |
+
|
| 934 |
+
else:
|
| 935 |
+
batched = _batched
|
| 936 |
+
|
| 937 |
+
batched.__doc__ = _batched.__doc__
|
| 938 |
+
|
| 939 |
+
|
| 940 |
+
def transpose(it):
|
| 941 |
+
"""Swap the rows and columns of the input matrix.
|
| 942 |
+
|
| 943 |
+
>>> list(transpose([(1, 2, 3), (11, 22, 33)]))
|
| 944 |
+
[(1, 11), (2, 22), (3, 33)]
|
| 945 |
+
|
| 946 |
+
The caller should ensure that the dimensions of the input are compatible.
|
| 947 |
+
If the input is empty, no output will be produced.
|
| 948 |
+
"""
|
| 949 |
+
return _zip_strict(*it)
|
| 950 |
+
|
| 951 |
+
|
| 952 |
+
def reshape(matrix, cols):
|
| 953 |
+
"""Reshape the 2-D input *matrix* to have a column count given by *cols*.
|
| 954 |
+
|
| 955 |
+
>>> matrix = [(0, 1), (2, 3), (4, 5)]
|
| 956 |
+
>>> cols = 3
|
| 957 |
+
>>> list(reshape(matrix, cols))
|
| 958 |
+
[(0, 1, 2), (3, 4, 5)]
|
| 959 |
+
"""
|
| 960 |
+
return batched(chain.from_iterable(matrix), cols)
|
| 961 |
+
|
| 962 |
+
|
| 963 |
+
def matmul(m1, m2):
|
| 964 |
+
"""Multiply two matrices.
|
| 965 |
+
|
| 966 |
+
>>> list(matmul([(7, 5), (3, 5)], [(2, 5), (7, 9)]))
|
| 967 |
+
[(49, 80), (41, 60)]
|
| 968 |
+
|
| 969 |
+
The caller should ensure that the dimensions of the input matrices are
|
| 970 |
+
compatible with each other.
|
| 971 |
+
"""
|
| 972 |
+
n = len(m2[0])
|
| 973 |
+
return batched(starmap(_sumprod, product(m1, transpose(m2))), n)
|
| 974 |
+
|
| 975 |
+
|
| 976 |
+
def factor(n):
|
| 977 |
+
"""Yield the prime factors of n.
|
| 978 |
+
|
| 979 |
+
>>> list(factor(360))
|
| 980 |
+
[2, 2, 2, 3, 3, 5]
|
| 981 |
+
"""
|
| 982 |
+
for prime in sieve(math.isqrt(n) + 1):
|
| 983 |
+
while not n % prime:
|
| 984 |
+
yield prime
|
| 985 |
+
n //= prime
|
| 986 |
+
if n == 1:
|
| 987 |
+
return
|
| 988 |
+
if n > 1:
|
| 989 |
+
yield n
|
| 990 |
+
|
| 991 |
+
|
| 992 |
+
def polynomial_eval(coefficients, x):
|
| 993 |
+
"""Evaluate a polynomial at a specific value.
|
| 994 |
+
|
| 995 |
+
Example: evaluating x^3 - 4 * x^2 - 17 * x + 60 at x = 2.5:
|
| 996 |
+
|
| 997 |
+
>>> coefficients = [1, -4, -17, 60]
|
| 998 |
+
>>> x = 2.5
|
| 999 |
+
>>> polynomial_eval(coefficients, x)
|
| 1000 |
+
8.125
|
| 1001 |
+
"""
|
| 1002 |
+
n = len(coefficients)
|
| 1003 |
+
if n == 0:
|
| 1004 |
+
return x * 0 # coerce zero to the type of x
|
| 1005 |
+
powers = map(pow, repeat(x), reversed(range(n)))
|
| 1006 |
+
return _sumprod(coefficients, powers)
|
| 1007 |
+
|
| 1008 |
+
|
| 1009 |
+
def sum_of_squares(it):
|
| 1010 |
+
"""Return the sum of the squares of the input values.
|
| 1011 |
+
|
| 1012 |
+
>>> sum_of_squares([10, 20, 30])
|
| 1013 |
+
1400
|
| 1014 |
+
"""
|
| 1015 |
+
return _sumprod(*tee(it))
|
| 1016 |
+
|
| 1017 |
+
|
| 1018 |
+
def polynomial_derivative(coefficients):
|
| 1019 |
+
"""Compute the first derivative of a polynomial.
|
| 1020 |
+
|
| 1021 |
+
Example: evaluating the derivative of x^3 - 4 * x^2 - 17 * x + 60
|
| 1022 |
+
|
| 1023 |
+
>>> coefficients = [1, -4, -17, 60]
|
| 1024 |
+
>>> derivative_coefficients = polynomial_derivative(coefficients)
|
| 1025 |
+
>>> derivative_coefficients
|
| 1026 |
+
[3, -8, -17]
|
| 1027 |
+
"""
|
| 1028 |
+
n = len(coefficients)
|
| 1029 |
+
powers = reversed(range(1, n))
|
| 1030 |
+
return list(map(operator.mul, coefficients, powers))
|
| 1031 |
+
|
| 1032 |
+
|
| 1033 |
+
def totient(n):
|
| 1034 |
+
"""Return the count of natural numbers up to *n* that are coprime with *n*.
|
| 1035 |
+
|
| 1036 |
+
>>> totient(9)
|
| 1037 |
+
6
|
| 1038 |
+
>>> totient(12)
|
| 1039 |
+
4
|
| 1040 |
+
"""
|
| 1041 |
+
# The itertools docs use unique_justseen instead of set; see
|
| 1042 |
+
# https://github.com/more-itertools/more-itertools/issues/823
|
| 1043 |
+
for p in set(factor(n)):
|
| 1044 |
+
n = n // p * (p - 1)
|
| 1045 |
+
|
| 1046 |
+
return n
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (492 Bytes). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/_elffile.cpython-310.pyc
ADDED
|
Binary file (3.37 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/_parser.cpython-310.pyc
ADDED
|
Binary file (9.23 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-310.pyc
ADDED
|
Binary file (2.67 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/markers.cpython-310.pyc
ADDED
|
Binary file (7.85 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/metadata.cpython-310.pyc
ADDED
|
Binary file (18.7 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-310.pyc
ADDED
|
Binary file (31.4 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/tags.cpython-310.pyc
ADDED
|
Binary file (15.2 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-310.pyc
ADDED
|
Binary file (4.62 kB). View file
|
|
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2021 Taneli Hukkinen
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/METADATA
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: tomli
|
| 3 |
+
Version: 2.0.1
|
| 4 |
+
Summary: A lil' TOML parser
|
| 5 |
+
Keywords: toml
|
| 6 |
+
Author-email: Taneli Hukkinen <hukkin@users.noreply.github.com>
|
| 7 |
+
Requires-Python: >=3.7
|
| 8 |
+
Description-Content-Type: text/markdown
|
| 9 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 10 |
+
Classifier: Operating System :: MacOS
|
| 11 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 12 |
+
Classifier: Operating System :: POSIX :: Linux
|
| 13 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 14 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 15 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 18 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 19 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 20 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 21 |
+
Classifier: Typing :: Typed
|
| 22 |
+
Project-URL: Changelog, https://github.com/hukkin/tomli/blob/master/CHANGELOG.md
|
| 23 |
+
Project-URL: Homepage, https://github.com/hukkin/tomli
|
| 24 |
+
|
| 25 |
+
[](https://github.com/hukkin/tomli/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush)
|
| 26 |
+
[](https://codecov.io/gh/hukkin/tomli)
|
| 27 |
+
[](https://pypi.org/project/tomli)
|
| 28 |
+
|
| 29 |
+
# Tomli
|
| 30 |
+
|
| 31 |
+
> A lil' TOML parser
|
| 32 |
+
|
| 33 |
+
**Table of Contents** *generated with [mdformat-toc](https://github.com/hukkin/mdformat-toc)*
|
| 34 |
+
|
| 35 |
+
<!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 -->
|
| 36 |
+
|
| 37 |
+
- [Intro](#intro)
|
| 38 |
+
- [Installation](#installation)
|
| 39 |
+
- [Usage](#usage)
|
| 40 |
+
- [Parse a TOML string](#parse-a-toml-string)
|
| 41 |
+
- [Parse a TOML file](#parse-a-toml-file)
|
| 42 |
+
- [Handle invalid TOML](#handle-invalid-toml)
|
| 43 |
+
- [Construct `decimal.Decimal`s from TOML floats](#construct-decimaldecimals-from-toml-floats)
|
| 44 |
+
- [FAQ](#faq)
|
| 45 |
+
- [Why this parser?](#why-this-parser)
|
| 46 |
+
- [Is comment preserving round-trip parsing supported?](#is-comment-preserving-round-trip-parsing-supported)
|
| 47 |
+
- [Is there a `dumps`, `write` or `encode` function?](#is-there-a-dumps-write-or-encode-function)
|
| 48 |
+
- [How do TOML types map into Python types?](#how-do-toml-types-map-into-python-types)
|
| 49 |
+
- [Performance](#performance)
|
| 50 |
+
|
| 51 |
+
<!-- mdformat-toc end -->
|
| 52 |
+
|
| 53 |
+
## Intro<a name="intro"></a>
|
| 54 |
+
|
| 55 |
+
Tomli is a Python library for parsing [TOML](https://toml.io).
|
| 56 |
+
Tomli is fully compatible with [TOML v1.0.0](https://toml.io/en/v1.0.0).
|
| 57 |
+
|
| 58 |
+
## Installation<a name="installation"></a>
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
pip install tomli
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Usage<a name="usage"></a>
|
| 65 |
+
|
| 66 |
+
### Parse a TOML string<a name="parse-a-toml-string"></a>
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
import tomli
|
| 70 |
+
|
| 71 |
+
toml_str = """
|
| 72 |
+
gretzky = 99
|
| 73 |
+
|
| 74 |
+
[kurri]
|
| 75 |
+
jari = 17
|
| 76 |
+
"""
|
| 77 |
+
|
| 78 |
+
toml_dict = tomli.loads(toml_str)
|
| 79 |
+
assert toml_dict == {"gretzky": 99, "kurri": {"jari": 17}}
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
### Parse a TOML file<a name="parse-a-toml-file"></a>
|
| 83 |
+
|
| 84 |
+
```python
|
| 85 |
+
import tomli
|
| 86 |
+
|
| 87 |
+
with open("path_to_file/conf.toml", "rb") as f:
|
| 88 |
+
toml_dict = tomli.load(f)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
The file must be opened in binary mode (with the `"rb"` flag).
|
| 92 |
+
Binary mode will enforce decoding the file as UTF-8 with universal newlines disabled,
|
| 93 |
+
both of which are required to correctly parse TOML.
|
| 94 |
+
|
| 95 |
+
### Handle invalid TOML<a name="handle-invalid-toml"></a>
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
import tomli
|
| 99 |
+
|
| 100 |
+
try:
|
| 101 |
+
toml_dict = tomli.loads("]] this is invalid TOML [[")
|
| 102 |
+
except tomli.TOMLDecodeError:
|
| 103 |
+
print("Yep, definitely not valid.")
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
Note that error messages are considered informational only.
|
| 107 |
+
They should not be assumed to stay constant across Tomli versions.
|
| 108 |
+
|
| 109 |
+
### Construct `decimal.Decimal`s from TOML floats<a name="construct-decimaldecimals-from-toml-floats"></a>
|
| 110 |
+
|
| 111 |
+
```python
|
| 112 |
+
from decimal import Decimal
|
| 113 |
+
import tomli
|
| 114 |
+
|
| 115 |
+
toml_dict = tomli.loads("precision-matters = 0.982492", parse_float=Decimal)
|
| 116 |
+
assert toml_dict["precision-matters"] == Decimal("0.982492")
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
Note that `decimal.Decimal` can be replaced with another callable that converts a TOML float from string to a Python type.
|
| 120 |
+
The `decimal.Decimal` is, however, a practical choice for use cases where float inaccuracies can not be tolerated.
|
| 121 |
+
|
| 122 |
+
Illegal types are `dict` and `list`, and their subtypes.
|
| 123 |
+
A `ValueError` will be raised if `parse_float` produces illegal types.
|
| 124 |
+
|
| 125 |
+
## FAQ<a name="faq"></a>
|
| 126 |
+
|
| 127 |
+
### Why this parser?<a name="why-this-parser"></a>
|
| 128 |
+
|
| 129 |
+
- it's lil'
|
| 130 |
+
- pure Python with zero dependencies
|
| 131 |
+
- the fastest pure Python parser [\*](#performance):
|
| 132 |
+
15x as fast as [tomlkit](https://pypi.org/project/tomlkit/),
|
| 133 |
+
2.4x as fast as [toml](https://pypi.org/project/toml/)
|
| 134 |
+
- outputs [basic data types](#how-do-toml-types-map-into-python-types) only
|
| 135 |
+
- 100% spec compliant: passes all tests in
|
| 136 |
+
[a test set](https://github.com/toml-lang/compliance/pull/8)
|
| 137 |
+
soon to be merged to the official
|
| 138 |
+
[compliance tests for TOML](https://github.com/toml-lang/compliance)
|
| 139 |
+
repository
|
| 140 |
+
- thoroughly tested: 100% branch coverage
|
| 141 |
+
|
| 142 |
+
### Is comment preserving round-trip parsing supported?<a name="is-comment-preserving-round-trip-parsing-supported"></a>
|
| 143 |
+
|
| 144 |
+
No.
|
| 145 |
+
|
| 146 |
+
The `tomli.loads` function returns a plain `dict` that is populated with builtin types and types from the standard library only.
|
| 147 |
+
Preserving comments requires a custom type to be returned so will not be supported,
|
| 148 |
+
at least not by the `tomli.loads` and `tomli.load` functions.
|
| 149 |
+
|
| 150 |
+
Look into [TOML Kit](https://github.com/sdispater/tomlkit) if preservation of style is what you need.
|
| 151 |
+
|
| 152 |
+
### Is there a `dumps`, `write` or `encode` function?<a name="is-there-a-dumps-write-or-encode-function"></a>
|
| 153 |
+
|
| 154 |
+
[Tomli-W](https://github.com/hukkin/tomli-w) is the write-only counterpart of Tomli, providing `dump` and `dumps` functions.
|
| 155 |
+
|
| 156 |
+
The core library does not include write capability, as most TOML use cases are read-only, and Tomli intends to be minimal.
|
| 157 |
+
|
| 158 |
+
### How do TOML types map into Python types?<a name="how-do-toml-types-map-into-python-types"></a>
|
| 159 |
+
|
| 160 |
+
| TOML type | Python type | Details |
|
| 161 |
+
| ---------------- | ------------------- | ------------------------------------------------------------ |
|
| 162 |
+
| Document Root | `dict` | |
|
| 163 |
+
| Key | `str` | |
|
| 164 |
+
| String | `str` | |
|
| 165 |
+
| Integer | `int` | |
|
| 166 |
+
| Float | `float` | |
|
| 167 |
+
| Boolean | `bool` | |
|
| 168 |
+
| Offset Date-Time | `datetime.datetime` | `tzinfo` attribute set to an instance of `datetime.timezone` |
|
| 169 |
+
| Local Date-Time | `datetime.datetime` | `tzinfo` attribute set to `None` |
|
| 170 |
+
| Local Date | `datetime.date` | |
|
| 171 |
+
| Local Time | `datetime.time` | |
|
| 172 |
+
| Array | `list` | |
|
| 173 |
+
| Table | `dict` | |
|
| 174 |
+
| Inline Table | `dict` | |
|
| 175 |
+
|
| 176 |
+
## Performance<a name="performance"></a>
|
| 177 |
+
|
| 178 |
+
The `benchmark/` folder in this repository contains a performance benchmark for comparing the various Python TOML parsers.
|
| 179 |
+
The benchmark can be run with `tox -e benchmark-pypi`.
|
| 180 |
+
Running the benchmark on my personal computer output the following:
|
| 181 |
+
|
| 182 |
+
```console
|
| 183 |
+
foo@bar:~/dev/tomli$ tox -e benchmark-pypi
|
| 184 |
+
benchmark-pypi installed: attrs==19.3.0,click==7.1.2,pytomlpp==1.0.2,qtoml==0.3.0,rtoml==0.7.0,toml==0.10.2,tomli==1.1.0,tomlkit==0.7.2
|
| 185 |
+
benchmark-pypi run-test-pre: PYTHONHASHSEED='2658546909'
|
| 186 |
+
benchmark-pypi run-test: commands[0] | python -c 'import datetime; print(datetime.date.today())'
|
| 187 |
+
2021-07-23
|
| 188 |
+
benchmark-pypi run-test: commands[1] | python --version
|
| 189 |
+
Python 3.8.10
|
| 190 |
+
benchmark-pypi run-test: commands[2] | python benchmark/run.py
|
| 191 |
+
Parsing data.toml 5000 times:
|
| 192 |
+
------------------------------------------------------
|
| 193 |
+
parser | exec time | performance (more is better)
|
| 194 |
+
-----------+------------+-----------------------------
|
| 195 |
+
rtoml | 0.901 s | baseline (100%)
|
| 196 |
+
pytomlpp | 1.08 s | 83.15%
|
| 197 |
+
tomli | 3.89 s | 23.15%
|
| 198 |
+
toml | 9.36 s | 9.63%
|
| 199 |
+
qtoml | 11.5 s | 7.82%
|
| 200 |
+
tomlkit | 56.8 s | 1.59%
|
| 201 |
+
```
|
| 202 |
+
|
| 203 |
+
The parsers are ordered from fastest to slowest, using the fastest parser as baseline.
|
| 204 |
+
Tomli performed the best out of all pure Python TOML parsers,
|
| 205 |
+
losing only to pytomlpp (wraps C++) and rtoml (wraps Rust).
|
| 206 |
+
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/RECORD
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tomli-2.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
tomli-2.0.1.dist-info/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072
|
| 3 |
+
tomli-2.0.1.dist-info/METADATA,sha256=zPDceKmPwJGLWtZykrHixL7WVXWmJGzZ1jyRT5lCoPI,8875
|
| 4 |
+
tomli-2.0.1.dist-info/RECORD,,
|
| 5 |
+
tomli-2.0.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
tomli-2.0.1.dist-info/WHEEL,sha256=jPMR_Dzkc4X4icQtmz81lnNY_kAsfog7ry7qoRvYLXw,81
|
| 7 |
+
tomli/__init__.py,sha256=JhUwV66DB1g4Hvt1UQCVMdfCu-IgAV8FXmvDU9onxd4,396
|
| 8 |
+
tomli/__pycache__/__init__.cpython-312.pyc,,
|
| 9 |
+
tomli/__pycache__/_parser.cpython-312.pyc,,
|
| 10 |
+
tomli/__pycache__/_re.cpython-312.pyc,,
|
| 11 |
+
tomli/__pycache__/_types.cpython-312.pyc,,
|
| 12 |
+
tomli/_parser.py,sha256=g9-ENaALS-B8dokYpCuzUFalWlog7T-SIYMjLZSWrtM,22633
|
| 13 |
+
tomli/_re.py,sha256=dbjg5ChZT23Ka9z9DHOXfdtSpPwUfdgMXnj8NOoly-w,2943
|
| 14 |
+
tomli/_types.py,sha256=-GTG2VUqkpxwMqzmVO4F7ybKddIbAnuAHXfmWQcTi3Q,254
|
| 15 |
+
tomli/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/REQUESTED
ADDED
|
File without changes
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: flit 3.6.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This is the MIT license: http://www.opensource.org/licenses/mit-license.php
|
| 2 |
+
|
| 3 |
+
Copyright (c) Alex Grönholm
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
| 6 |
+
software and associated documentation files (the "Software"), to deal in the Software
|
| 7 |
+
without restriction, including without limitation the rights to use, copy, modify, merge,
|
| 8 |
+
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
| 9 |
+
to whom the Software is furnished to do so, subject to the following conditions:
|
| 10 |
+
|
| 11 |
+
The above copyright notice and this permission notice shall be included in all copies or
|
| 12 |
+
substantial portions of the Software.
|
| 13 |
+
|
| 14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
| 15 |
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
| 16 |
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
| 17 |
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 18 |
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
| 19 |
+
DEALINGS IN THE SOFTWARE.
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: typeguard
|
| 3 |
+
Version: 4.3.0
|
| 4 |
+
Summary: Run-time type checker for Python
|
| 5 |
+
Author-email: Alex Grönholm <alex.gronholm@nextday.fi>
|
| 6 |
+
License: MIT
|
| 7 |
+
Project-URL: Documentation, https://typeguard.readthedocs.io/en/latest/
|
| 8 |
+
Project-URL: Change log, https://typeguard.readthedocs.io/en/latest/versionhistory.html
|
| 9 |
+
Project-URL: Source code, https://github.com/agronholm/typeguard
|
| 10 |
+
Project-URL: Issue tracker, https://github.com/agronholm/typeguard/issues
|
| 11 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 12 |
+
Classifier: Intended Audience :: Developers
|
| 13 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 21 |
+
Requires-Python: >=3.8
|
| 22 |
+
Description-Content-Type: text/x-rst
|
| 23 |
+
License-File: LICENSE
|
| 24 |
+
Requires-Dist: typing-extensions >=4.10.0
|
| 25 |
+
Requires-Dist: importlib-metadata >=3.6 ; python_version < "3.10"
|
| 26 |
+
Provides-Extra: doc
|
| 27 |
+
Requires-Dist: packaging ; extra == 'doc'
|
| 28 |
+
Requires-Dist: Sphinx >=7 ; extra == 'doc'
|
| 29 |
+
Requires-Dist: sphinx-autodoc-typehints >=1.2.0 ; extra == 'doc'
|
| 30 |
+
Requires-Dist: sphinx-rtd-theme >=1.3.0 ; extra == 'doc'
|
| 31 |
+
Provides-Extra: test
|
| 32 |
+
Requires-Dist: coverage[toml] >=7 ; extra == 'test'
|
| 33 |
+
Requires-Dist: pytest >=7 ; extra == 'test'
|
| 34 |
+
Requires-Dist: mypy >=1.2.0 ; (platform_python_implementation != "PyPy") and extra == 'test'
|
| 35 |
+
|
| 36 |
+
.. image:: https://github.com/agronholm/typeguard/actions/workflows/test.yml/badge.svg
|
| 37 |
+
:target: https://github.com/agronholm/typeguard/actions/workflows/test.yml
|
| 38 |
+
:alt: Build Status
|
| 39 |
+
.. image:: https://coveralls.io/repos/agronholm/typeguard/badge.svg?branch=master&service=github
|
| 40 |
+
:target: https://coveralls.io/github/agronholm/typeguard?branch=master
|
| 41 |
+
:alt: Code Coverage
|
| 42 |
+
.. image:: https://readthedocs.org/projects/typeguard/badge/?version=latest
|
| 43 |
+
:target: https://typeguard.readthedocs.io/en/latest/?badge=latest
|
| 44 |
+
:alt: Documentation
|
| 45 |
+
|
| 46 |
+
This library provides run-time type checking for functions defined with
|
| 47 |
+
`PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_ argument (and return) type
|
| 48 |
+
annotations, and any arbitrary objects. It can be used together with static type
|
| 49 |
+
checkers as an additional layer of type safety, to catch type violations that could only
|
| 50 |
+
be detected at run time.
|
| 51 |
+
|
| 52 |
+
Two principal ways to do type checking are provided:
|
| 53 |
+
|
| 54 |
+
#. The ``check_type`` function:
|
| 55 |
+
|
| 56 |
+
* like ``isinstance()``, but supports arbitrary type annotations (within limits)
|
| 57 |
+
* can be used as a ``cast()`` replacement, but with actual checking of the value
|
| 58 |
+
#. Code instrumentation:
|
| 59 |
+
|
| 60 |
+
* entire modules, or individual functions (via ``@typechecked``) are recompiled, with
|
| 61 |
+
type checking code injected into them
|
| 62 |
+
* automatically checks function arguments, return values and assignments to annotated
|
| 63 |
+
local variables
|
| 64 |
+
* for generator functions (regular and async), checks yield and send values
|
| 65 |
+
* requires the original source code of the instrumented module(s) to be accessible
|
| 66 |
+
|
| 67 |
+
Two options are provided for code instrumentation:
|
| 68 |
+
|
| 69 |
+
#. the ``@typechecked`` function:
|
| 70 |
+
|
| 71 |
+
* can be applied to functions individually
|
| 72 |
+
#. the import hook (``typeguard.install_import_hook()``):
|
| 73 |
+
|
| 74 |
+
* automatically instruments targeted modules on import
|
| 75 |
+
* no manual code changes required in the target modules
|
| 76 |
+
* requires the import hook to be installed before the targeted modules are imported
|
| 77 |
+
* may clash with other import hooks
|
| 78 |
+
|
| 79 |
+
See the documentation_ for further information.
|
| 80 |
+
|
| 81 |
+
.. _documentation: https://typeguard.readthedocs.io/en/latest/
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
typeguard-4.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
typeguard-4.3.0.dist-info/LICENSE,sha256=YWP3mH37ONa8MgzitwsvArhivEESZRbVUu8c1DJH51g,1130
|
| 3 |
+
typeguard-4.3.0.dist-info/METADATA,sha256=z2dcHAp0TwhYCFU5Deh8x31nazElgujUz9tbuP0pjSE,3717
|
| 4 |
+
typeguard-4.3.0.dist-info/RECORD,,
|
| 5 |
+
typeguard-4.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 6 |
+
typeguard-4.3.0.dist-info/entry_points.txt,sha256=qp7NQ1aLtiSgMQqo6gWlfGpy0IIXzoMJmeQTLpzqFZQ,48
|
| 7 |
+
typeguard-4.3.0.dist-info/top_level.txt,sha256=4z28AhuDodwRS_c1J_l8H51t5QuwfTseskYzlxp6grs,10
|
| 8 |
+
typeguard/__init__.py,sha256=Onh4w38elPCjtlcU3JY9k3h70NjsxXIkAflmQn-Z0FY,2071
|
| 9 |
+
typeguard/__pycache__/__init__.cpython-312.pyc,,
|
| 10 |
+
typeguard/__pycache__/_checkers.cpython-312.pyc,,
|
| 11 |
+
typeguard/__pycache__/_config.cpython-312.pyc,,
|
| 12 |
+
typeguard/__pycache__/_decorators.cpython-312.pyc,,
|
| 13 |
+
typeguard/__pycache__/_exceptions.cpython-312.pyc,,
|
| 14 |
+
typeguard/__pycache__/_functions.cpython-312.pyc,,
|
| 15 |
+
typeguard/__pycache__/_importhook.cpython-312.pyc,,
|
| 16 |
+
typeguard/__pycache__/_memo.cpython-312.pyc,,
|
| 17 |
+
typeguard/__pycache__/_pytest_plugin.cpython-312.pyc,,
|
| 18 |
+
typeguard/__pycache__/_suppression.cpython-312.pyc,,
|
| 19 |
+
typeguard/__pycache__/_transformer.cpython-312.pyc,,
|
| 20 |
+
typeguard/__pycache__/_union_transformer.cpython-312.pyc,,
|
| 21 |
+
typeguard/__pycache__/_utils.cpython-312.pyc,,
|
| 22 |
+
typeguard/_checkers.py,sha256=JRrgKicdOEfIBoNEtegYCEIlhpad-a1u1Em7GCj0WCI,31360
|
| 23 |
+
typeguard/_config.py,sha256=nIz8QwDa-oFO3L9O8_6srzlmd99pSby2wOM4Wb7F_B0,2846
|
| 24 |
+
typeguard/_decorators.py,sha256=v6dsIeWvPhExGLP_wXF-RmDUyjZf_Ak28g7gBJ_v0-0,9033
|
| 25 |
+
typeguard/_exceptions.py,sha256=ZIPeiV-FBd5Emw2EaWd2Fvlsrwi4ocwT2fVGBIAtHcQ,1121
|
| 26 |
+
typeguard/_functions.py,sha256=ibgSAKa5ptIm1eR9ARG0BSozAFJPFNASZqhPVyQeqig,10393
|
| 27 |
+
typeguard/_importhook.py,sha256=ugjCDvFcdWMU7UugqlJG91IpVNpEIxtRr-99s0h1k7M,6389
|
| 28 |
+
typeguard/_memo.py,sha256=1juQV_vxnD2JYKbSrebiQuj4oKHz6n67v9pYA-CCISg,1303
|
| 29 |
+
typeguard/_pytest_plugin.py,sha256=-fcSqkv54rIfIF8pDavY5YQPkj4OX8GMt_lL7CQSD4I,4416
|
| 30 |
+
typeguard/_suppression.py,sha256=VQfzxcwIbu3if0f7VBkKM7hkYOA7tNFw9a7jMBsmMg4,2266
|
| 31 |
+
typeguard/_transformer.py,sha256=9Ha7_QhdwoUni_6hvdY-hZbuEergowHrNL2vzHIakFY,44937
|
| 32 |
+
typeguard/_union_transformer.py,sha256=v_42r7-6HuRX2SoFwnyJ-E5PlxXpVeUJPJR1-HU9qSo,1354
|
| 33 |
+
typeguard/_utils.py,sha256=5HhO1rPn5f1M6ymkVAEv7Xmlz1cX-j0OnTMlyHqqrR8,5270
|
| 34 |
+
typeguard/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.43.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
typeguard
|
falcon/lib/python3.10/site-packages/setuptools/_vendor/wheel/__main__.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Wheel command line tool (enable python -m wheel syntax)
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import sys
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def main(): # needed for console script
|
| 11 |
+
if __package__ == "":
|
| 12 |
+
# To be able to run 'python wheel-0.9.whl/wheel':
|
| 13 |
+
import os.path
|
| 14 |
+
|
| 15 |
+
path = os.path.dirname(os.path.dirname(__file__))
|
| 16 |
+
sys.path[0:0] = [path]
|
| 17 |
+
import wheel.cli
|
| 18 |
+
|
| 19 |
+
sys.exit(wheel.cli.main())
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
if __name__ == "__main__":
|
| 23 |
+
sys.exit(main())
|