Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/METADATA +104 -0
- evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/RECORD +87 -0
- evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/REQUESTED +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/WHEEL +5 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__init__.py +49 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/__init__.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/__main__.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/cli.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/ipython.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/main.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/parser.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/variables.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/version.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/cli.py +199 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/ipython.py +39 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/main.py +392 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/parser.py +175 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/py.typed +1 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/variables.py +86 -0
- evalkit_cambrian/lib/python3.10/site-packages/dotenv/version.py +1 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/__init__.py +32 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/__pycache__/__init__.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/__pycache__/_helpers.cpython-310.pyc +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/_helpers.py +39 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/_helpers_c.pyx +84 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/_helpers_py.py +56 -0
- evalkit_cambrian/lib/python3.10/site-packages/propcache/py.typed +1 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/INSTALLER +1 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/LICENSE +19 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/METADATA +473 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/RECORD +163 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/REQUESTED +0 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/WHEEL +4 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich/columns.py +187 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich/file_proxy.py +57 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich/live.py +375 -0
- evalkit_cambrian/lib/python3.10/site-packages/rich/pager.py +34 -0
- evalkit_cambrian/lib/python3.10/site-packages/wheel-0.45.1.dist-info/METADATA +66 -0
- evalkit_cambrian/lib/python3.10/site-packages/wheel-0.45.1.dist-info/WHEEL +4 -0
- evalkit_cambrian/lib/python3.10/site-packages/wheel-0.45.1.dist-info/entry_points.txt +6 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_adaptive_avg_pool3d_cuda_dispatch.h +24 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_foreach_ceil_native.h +25 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_log_softmax_cuda_dispatch.h +25 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_padded_dense_to_jagged_forward.h +47 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_segment_reduce_backward_cuda_dispatch.h +23 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_unique_native.h +23 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/addcdiv_native.h +23 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/addr.h +39 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/div_compositeexplicitautograd_dispatch.h +30 -0
- infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/fft_fft.h +91 -0
evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: anyio
|
| 3 |
+
Version: 4.8.0
|
| 4 |
+
Summary: High level compatibility layer for multiple asynchronous event loop implementations
|
| 5 |
+
Author-email: Alex Grönholm <alex.gronholm@nextday.fi>
|
| 6 |
+
License: MIT
|
| 7 |
+
Project-URL: Documentation, https://anyio.readthedocs.io/en/latest/
|
| 8 |
+
Project-URL: Changelog, https://anyio.readthedocs.io/en/stable/versionhistory.html
|
| 9 |
+
Project-URL: Source code, https://github.com/agronholm/anyio
|
| 10 |
+
Project-URL: Issue tracker, https://github.com/agronholm/anyio/issues
|
| 11 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 12 |
+
Classifier: Intended Audience :: Developers
|
| 13 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 14 |
+
Classifier: Framework :: AnyIO
|
| 15 |
+
Classifier: Typing :: Typed
|
| 16 |
+
Classifier: Programming Language :: Python
|
| 17 |
+
Classifier: Programming Language :: Python :: 3
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 23 |
+
Requires-Python: >=3.9
|
| 24 |
+
Description-Content-Type: text/x-rst
|
| 25 |
+
License-File: LICENSE
|
| 26 |
+
Requires-Dist: exceptiongroup>=1.0.2; python_version < "3.11"
|
| 27 |
+
Requires-Dist: idna>=2.8
|
| 28 |
+
Requires-Dist: sniffio>=1.1
|
| 29 |
+
Requires-Dist: typing_extensions>=4.5; python_version < "3.13"
|
| 30 |
+
Provides-Extra: trio
|
| 31 |
+
Requires-Dist: trio>=0.26.1; extra == "trio"
|
| 32 |
+
Provides-Extra: test
|
| 33 |
+
Requires-Dist: anyio[trio]; extra == "test"
|
| 34 |
+
Requires-Dist: coverage[toml]>=7; extra == "test"
|
| 35 |
+
Requires-Dist: exceptiongroup>=1.2.0; extra == "test"
|
| 36 |
+
Requires-Dist: hypothesis>=4.0; extra == "test"
|
| 37 |
+
Requires-Dist: psutil>=5.9; extra == "test"
|
| 38 |
+
Requires-Dist: pytest>=7.0; extra == "test"
|
| 39 |
+
Requires-Dist: trustme; extra == "test"
|
| 40 |
+
Requires-Dist: truststore>=0.9.1; python_version >= "3.10" and extra == "test"
|
| 41 |
+
Requires-Dist: uvloop>=0.21; (platform_python_implementation == "CPython" and platform_system != "Windows" and python_version < "3.14") and extra == "test"
|
| 42 |
+
Provides-Extra: doc
|
| 43 |
+
Requires-Dist: packaging; extra == "doc"
|
| 44 |
+
Requires-Dist: Sphinx~=7.4; extra == "doc"
|
| 45 |
+
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
| 46 |
+
Requires-Dist: sphinx-autodoc-typehints>=1.2.0; extra == "doc"
|
| 47 |
+
|
| 48 |
+
.. image:: https://github.com/agronholm/anyio/actions/workflows/test.yml/badge.svg
|
| 49 |
+
:target: https://github.com/agronholm/anyio/actions/workflows/test.yml
|
| 50 |
+
:alt: Build Status
|
| 51 |
+
.. image:: https://coveralls.io/repos/github/agronholm/anyio/badge.svg?branch=master
|
| 52 |
+
:target: https://coveralls.io/github/agronholm/anyio?branch=master
|
| 53 |
+
:alt: Code Coverage
|
| 54 |
+
.. image:: https://readthedocs.org/projects/anyio/badge/?version=latest
|
| 55 |
+
:target: https://anyio.readthedocs.io/en/latest/?badge=latest
|
| 56 |
+
:alt: Documentation
|
| 57 |
+
.. image:: https://badges.gitter.im/gitterHQ/gitter.svg
|
| 58 |
+
:target: https://gitter.im/python-trio/AnyIO
|
| 59 |
+
:alt: Gitter chat
|
| 60 |
+
|
| 61 |
+
AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio_ or
|
| 62 |
+
trio_. It implements trio-like `structured concurrency`_ (SC) on top of asyncio and works in harmony
|
| 63 |
+
with the native SC of trio itself.
|
| 64 |
+
|
| 65 |
+
Applications and libraries written against AnyIO's API will run unmodified on either asyncio_ or
|
| 66 |
+
trio_. AnyIO can also be adopted into a library or application incrementally – bit by bit, no full
|
| 67 |
+
refactoring necessary. It will blend in with the native libraries of your chosen backend.
|
| 68 |
+
|
| 69 |
+
Documentation
|
| 70 |
+
-------------
|
| 71 |
+
|
| 72 |
+
View full documentation at: https://anyio.readthedocs.io/
|
| 73 |
+
|
| 74 |
+
Features
|
| 75 |
+
--------
|
| 76 |
+
|
| 77 |
+
AnyIO offers the following functionality:
|
| 78 |
+
|
| 79 |
+
* Task groups (nurseries_ in trio terminology)
|
| 80 |
+
* High-level networking (TCP, UDP and UNIX sockets)
|
| 81 |
+
|
| 82 |
+
* `Happy eyeballs`_ algorithm for TCP connections (more robust than that of asyncio on Python
|
| 83 |
+
3.8)
|
| 84 |
+
* async/await style UDP sockets (unlike asyncio where you still have to use Transports and
|
| 85 |
+
Protocols)
|
| 86 |
+
|
| 87 |
+
* A versatile API for byte streams and object streams
|
| 88 |
+
* Inter-task synchronization and communication (locks, conditions, events, semaphores, object
|
| 89 |
+
streams)
|
| 90 |
+
* Worker threads
|
| 91 |
+
* Subprocesses
|
| 92 |
+
* Asynchronous file I/O (using worker threads)
|
| 93 |
+
* Signal handling
|
| 94 |
+
|
| 95 |
+
AnyIO also comes with its own pytest_ plugin which also supports asynchronous fixtures.
|
| 96 |
+
It even works with the popular Hypothesis_ library.
|
| 97 |
+
|
| 98 |
+
.. _asyncio: https://docs.python.org/3/library/asyncio.html
|
| 99 |
+
.. _trio: https://github.com/python-trio/trio
|
| 100 |
+
.. _structured concurrency: https://en.wikipedia.org/wiki/Structured_concurrency
|
| 101 |
+
.. _nurseries: https://trio.readthedocs.io/en/stable/reference-core.html#nurseries-and-spawning
|
| 102 |
+
.. _Happy eyeballs: https://en.wikipedia.org/wiki/Happy_Eyeballs
|
| 103 |
+
.. _pytest: https://docs.pytest.org/en/latest/
|
| 104 |
+
.. _Hypothesis: https://hypothesis.works/
|
evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
anyio-4.8.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
anyio-4.8.0.dist-info/LICENSE,sha256=U2GsncWPLvX9LpsJxoKXwX8ElQkJu8gCO9uC6s8iwrA,1081
|
| 3 |
+
anyio-4.8.0.dist-info/METADATA,sha256=WjTz5zz2NgMStBtw4xDh8CDvf6YXgAOrA0nboFQkXEg,4630
|
| 4 |
+
anyio-4.8.0.dist-info/RECORD,,
|
| 5 |
+
anyio-4.8.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
anyio-4.8.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
| 7 |
+
anyio-4.8.0.dist-info/entry_points.txt,sha256=_d6Yu6uiaZmNe0CydowirE9Cmg7zUL2g08tQpoS3Qvc,39
|
| 8 |
+
anyio-4.8.0.dist-info/top_level.txt,sha256=QglSMiWX8_5dpoVAEIHdEYzvqFMdSYWmCj6tYw2ITkQ,6
|
| 9 |
+
anyio/__init__.py,sha256=mVsWuQ6wxcPT9QUAxhz1Rg2u53PskaBJw4TXVXk63ZQ,4513
|
| 10 |
+
anyio/__pycache__/__init__.cpython-310.pyc,,
|
| 11 |
+
anyio/__pycache__/from_thread.cpython-310.pyc,,
|
| 12 |
+
anyio/__pycache__/lowlevel.cpython-310.pyc,,
|
| 13 |
+
anyio/__pycache__/pytest_plugin.cpython-310.pyc,,
|
| 14 |
+
anyio/__pycache__/to_interpreter.cpython-310.pyc,,
|
| 15 |
+
anyio/__pycache__/to_process.cpython-310.pyc,,
|
| 16 |
+
anyio/__pycache__/to_thread.cpython-310.pyc,,
|
| 17 |
+
anyio/_backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 18 |
+
anyio/_backends/__pycache__/__init__.cpython-310.pyc,,
|
| 19 |
+
anyio/_backends/__pycache__/_asyncio.cpython-310.pyc,,
|
| 20 |
+
anyio/_backends/__pycache__/_trio.cpython-310.pyc,,
|
| 21 |
+
anyio/_backends/_asyncio.py,sha256=_6BDFDrEPI1aRPFDSPsUzyPGm-dnRgBPfEOdeCH1Ixg,92951
|
| 22 |
+
anyio/_backends/_trio.py,sha256=7PNO_GPq8Dmo1kQmmE2z57dhnv4TUoinsEHt_PJg3oE,40405
|
| 23 |
+
anyio/_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 24 |
+
anyio/_core/__pycache__/__init__.cpython-310.pyc,,
|
| 25 |
+
anyio/_core/__pycache__/_asyncio_selector_thread.cpython-310.pyc,,
|
| 26 |
+
anyio/_core/__pycache__/_eventloop.cpython-310.pyc,,
|
| 27 |
+
anyio/_core/__pycache__/_exceptions.cpython-310.pyc,,
|
| 28 |
+
anyio/_core/__pycache__/_fileio.cpython-310.pyc,,
|
| 29 |
+
anyio/_core/__pycache__/_resources.cpython-310.pyc,,
|
| 30 |
+
anyio/_core/__pycache__/_signals.cpython-310.pyc,,
|
| 31 |
+
anyio/_core/__pycache__/_sockets.cpython-310.pyc,,
|
| 32 |
+
anyio/_core/__pycache__/_streams.cpython-310.pyc,,
|
| 33 |
+
anyio/_core/__pycache__/_subprocesses.cpython-310.pyc,,
|
| 34 |
+
anyio/_core/__pycache__/_synchronization.cpython-310.pyc,,
|
| 35 |
+
anyio/_core/__pycache__/_tasks.cpython-310.pyc,,
|
| 36 |
+
anyio/_core/__pycache__/_testing.cpython-310.pyc,,
|
| 37 |
+
anyio/_core/__pycache__/_typedattr.cpython-310.pyc,,
|
| 38 |
+
anyio/_core/_asyncio_selector_thread.py,sha256=53RhMHpFAexW0dQz2Rn8iy8zt931NXyEJITyILWVV_A,5626
|
| 39 |
+
anyio/_core/_eventloop.py,sha256=t_tAwBFPjF8jrZGjlJ6bbYy6KA3bjsbZxV9mvh9t1i0,4695
|
| 40 |
+
anyio/_core/_exceptions.py,sha256=RlPRlwastdmfDPoskdXNO6SI8_l3fclA2wtW6cokU9I,3503
|
| 41 |
+
anyio/_core/_fileio.py,sha256=r6QJmwn90vU0CyCDAWgGhCwc8cT26ofosaHl7Jo3LJU,22853
|
| 42 |
+
anyio/_core/_resources.py,sha256=NbmU5O5UX3xEyACnkmYX28Fmwdl-f-ny0tHym26e0w0,435
|
| 43 |
+
anyio/_core/_signals.py,sha256=vulT1M1xdLYtAR-eY5TamIgaf1WTlOwOrMGwswlTTr8,905
|
| 44 |
+
anyio/_core/_sockets.py,sha256=vQ5GnSDLHjEhHhV2yvsdiPs5wmPxxb1kRsv3RM5lbQk,26951
|
| 45 |
+
anyio/_core/_streams.py,sha256=OnaKgoDD-FcMSwLvkoAUGP51sG2ZdRvMpxt9q2w1gYA,1804
|
| 46 |
+
anyio/_core/_subprocesses.py,sha256=WquR6sHrnaZofaeqnL8U4Yv___msVW_WqivleLHK4zI,7760
|
| 47 |
+
anyio/_core/_synchronization.py,sha256=DwUh8Tl6cG_UMVC_GyzPoC_U9BpfDfjMl9SINSxcZN4,20320
|
| 48 |
+
anyio/_core/_tasks.py,sha256=f3CuWwo06cCZ6jaOv-JHFKWkgpgf2cvaF25Oh4augMA,4757
|
| 49 |
+
anyio/_core/_testing.py,sha256=YUGwA5cgFFbUTv4WFd7cv_BSVr4ryTtPp8owQA3JdWE,2118
|
| 50 |
+
anyio/_core/_typedattr.py,sha256=P4ozZikn3-DbpoYcvyghS_FOYAgbmUxeoU8-L_07pZM,2508
|
| 51 |
+
anyio/abc/__init__.py,sha256=c2OQbTCS_fQowviMXanLPh8m29ccwkXmpDr7uyNZYOo,2652
|
| 52 |
+
anyio/abc/__pycache__/__init__.cpython-310.pyc,,
|
| 53 |
+
anyio/abc/__pycache__/_eventloop.cpython-310.pyc,,
|
| 54 |
+
anyio/abc/__pycache__/_resources.cpython-310.pyc,,
|
| 55 |
+
anyio/abc/__pycache__/_sockets.cpython-310.pyc,,
|
| 56 |
+
anyio/abc/__pycache__/_streams.cpython-310.pyc,,
|
| 57 |
+
anyio/abc/__pycache__/_subprocesses.cpython-310.pyc,,
|
| 58 |
+
anyio/abc/__pycache__/_tasks.cpython-310.pyc,,
|
| 59 |
+
anyio/abc/__pycache__/_testing.cpython-310.pyc,,
|
| 60 |
+
anyio/abc/_eventloop.py,sha256=Wd_3C3hLm0ex5z_eHHWGqvLle2OKCSexJSZVnwQNGV4,9658
|
| 61 |
+
anyio/abc/_resources.py,sha256=DrYvkNN1hH6Uvv5_5uKySvDsnknGVDe8FCKfko0VtN8,783
|
| 62 |
+
anyio/abc/_sockets.py,sha256=KhWtJxan8jpBXKwPaFeQzI4iRXdFaOIn0HXtDZnaO7U,6262
|
| 63 |
+
anyio/abc/_streams.py,sha256=GzST5Q2zQmxVzdrAqtbSyHNxkPlIC9AzeZJg_YyPAXw,6598
|
| 64 |
+
anyio/abc/_subprocesses.py,sha256=cumAPJTktOQtw63IqG0lDpyZqu_l1EElvQHMiwJgL08,2067
|
| 65 |
+
anyio/abc/_tasks.py,sha256=yJWbMwowvqjlAX4oJ3l9Is1w-zwynr2lX1Z02AWJqsY,3080
|
| 66 |
+
anyio/abc/_testing.py,sha256=tBJUzkSfOXJw23fe8qSJ03kJlShOYjjaEyFB6k6MYT8,1821
|
| 67 |
+
anyio/from_thread.py,sha256=dbi5TUH45_Sg_jZ8Vv1NJWVohe0WeQ_OaCvXIKveAGg,17478
|
| 68 |
+
anyio/lowlevel.py,sha256=nkgmW--SdxGVp0cmLUYazjkigveRm5HY7-gW8Bpp9oY,4169
|
| 69 |
+
anyio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 70 |
+
anyio/pytest_plugin.py,sha256=vjGhGRHD31OyMgJRFQrMvExhx3Ea8KbyDqYKmiSDdXA,6712
|
| 71 |
+
anyio/streams/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 72 |
+
anyio/streams/__pycache__/__init__.cpython-310.pyc,,
|
| 73 |
+
anyio/streams/__pycache__/buffered.cpython-310.pyc,,
|
| 74 |
+
anyio/streams/__pycache__/file.cpython-310.pyc,,
|
| 75 |
+
anyio/streams/__pycache__/memory.cpython-310.pyc,,
|
| 76 |
+
anyio/streams/__pycache__/stapled.cpython-310.pyc,,
|
| 77 |
+
anyio/streams/__pycache__/text.cpython-310.pyc,,
|
| 78 |
+
anyio/streams/__pycache__/tls.cpython-310.pyc,,
|
| 79 |
+
anyio/streams/buffered.py,sha256=UCldKC168YuLvT7n3HtNPnQ2iWAMSTYQWbZvzLwMwkM,4500
|
| 80 |
+
anyio/streams/file.py,sha256=6uoTNb5KbMoj-6gS3_xrrL8uZN8Q4iIvOS1WtGyFfKw,4383
|
| 81 |
+
anyio/streams/memory.py,sha256=j8AyOExK4-UPaon_Xbhwax25Vqs0DwFg3ZXc-EIiHjY,10550
|
| 82 |
+
anyio/streams/stapled.py,sha256=U09pCrmOw9kkNhe6tKopsm1QIMT1lFTFvtb-A7SIe4k,4302
|
| 83 |
+
anyio/streams/text.py,sha256=6x8w8xlfCZKTUWQoJiMPoMhSSJFUBRKgoBNSBtbd9yg,5094
|
| 84 |
+
anyio/streams/tls.py,sha256=m3AE2LVSpoRHSIwSoSCupiOVL54EvOFoY3CcwTxcZfg,12742
|
| 85 |
+
anyio/to_interpreter.py,sha256=QhTFaSdyUjxpuN_wBJWPWyh8N6kKV4qhkn71Op84AEc,6624
|
| 86 |
+
anyio/to_process.py,sha256=ZvruelRM-HNmqDaql4sdNODg2QD_uSlwSCxnV4OhsfQ,9595
|
| 87 |
+
anyio/to_thread.py,sha256=WM2JQ2MbVsd5D5CM08bQiTwzZIvpsGjfH1Fy247KoDQ,2396
|
evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/REQUESTED
ADDED
|
File without changes
|
evalkit_cambrian/lib/python3.10/site-packages/anyio-4.8.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (75.6.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__init__.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, Optional
|
| 2 |
+
|
| 3 |
+
from .main import (dotenv_values, find_dotenv, get_key, load_dotenv, set_key,
|
| 4 |
+
unset_key)
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def load_ipython_extension(ipython: Any) -> None:
|
| 8 |
+
from .ipython import load_ipython_extension
|
| 9 |
+
load_ipython_extension(ipython)
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def get_cli_string(
|
| 13 |
+
path: Optional[str] = None,
|
| 14 |
+
action: Optional[str] = None,
|
| 15 |
+
key: Optional[str] = None,
|
| 16 |
+
value: Optional[str] = None,
|
| 17 |
+
quote: Optional[str] = None,
|
| 18 |
+
):
|
| 19 |
+
"""Returns a string suitable for running as a shell script.
|
| 20 |
+
|
| 21 |
+
Useful for converting a arguments passed to a fabric task
|
| 22 |
+
to be passed to a `local` or `run` command.
|
| 23 |
+
"""
|
| 24 |
+
command = ['dotenv']
|
| 25 |
+
if quote:
|
| 26 |
+
command.append(f'-q {quote}')
|
| 27 |
+
if path:
|
| 28 |
+
command.append(f'-f {path}')
|
| 29 |
+
if action:
|
| 30 |
+
command.append(action)
|
| 31 |
+
if key:
|
| 32 |
+
command.append(key)
|
| 33 |
+
if value:
|
| 34 |
+
if ' ' in value:
|
| 35 |
+
command.append(f'"{value}"')
|
| 36 |
+
else:
|
| 37 |
+
command.append(value)
|
| 38 |
+
|
| 39 |
+
return ' '.join(command).strip()
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
__all__ = ['get_cli_string',
|
| 43 |
+
'load_dotenv',
|
| 44 |
+
'dotenv_values',
|
| 45 |
+
'get_key',
|
| 46 |
+
'set_key',
|
| 47 |
+
'unset_key',
|
| 48 |
+
'find_dotenv',
|
| 49 |
+
'load_ipython_extension']
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.25 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/__main__.cpython-310.pyc
ADDED
|
Binary file (317 Bytes). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/cli.cpython-310.pyc
ADDED
|
Binary file (5.98 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/ipython.cpython-310.pyc
ADDED
|
Binary file (1.48 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/main.cpython-310.pyc
ADDED
|
Binary file (10.3 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/parser.cpython-310.pyc
ADDED
|
Binary file (6.14 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/variables.cpython-310.pyc
ADDED
|
Binary file (3.53 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/__pycache__/version.cpython-310.pyc
ADDED
|
Binary file (188 Bytes). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/cli.py
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
import shlex
|
| 4 |
+
import sys
|
| 5 |
+
from contextlib import contextmanager
|
| 6 |
+
from subprocess import Popen
|
| 7 |
+
from typing import Any, Dict, IO, Iterator, List
|
| 8 |
+
|
| 9 |
+
try:
|
| 10 |
+
import click
|
| 11 |
+
except ImportError:
|
| 12 |
+
sys.stderr.write('It seems python-dotenv is not installed with cli option. \n'
|
| 13 |
+
'Run pip install "python-dotenv[cli]" to fix this.')
|
| 14 |
+
sys.exit(1)
|
| 15 |
+
|
| 16 |
+
from .main import dotenv_values, set_key, unset_key
|
| 17 |
+
from .version import __version__
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def enumerate_env():
|
| 21 |
+
"""
|
| 22 |
+
Return a path for the ${pwd}/.env file.
|
| 23 |
+
|
| 24 |
+
If pwd does not exist, return None.
|
| 25 |
+
"""
|
| 26 |
+
try:
|
| 27 |
+
cwd = os.getcwd()
|
| 28 |
+
except FileNotFoundError:
|
| 29 |
+
return None
|
| 30 |
+
path = os.path.join(cwd, '.env')
|
| 31 |
+
return path
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@click.group()
|
| 35 |
+
@click.option('-f', '--file', default=enumerate_env(),
|
| 36 |
+
type=click.Path(file_okay=True),
|
| 37 |
+
help="Location of the .env file, defaults to .env file in current working directory.")
|
| 38 |
+
@click.option('-q', '--quote', default='always',
|
| 39 |
+
type=click.Choice(['always', 'never', 'auto']),
|
| 40 |
+
help="Whether to quote or not the variable values. Default mode is always. This does not affect parsing.")
|
| 41 |
+
@click.option('-e', '--export', default=False,
|
| 42 |
+
type=click.BOOL,
|
| 43 |
+
help="Whether to write the dot file as an executable bash script.")
|
| 44 |
+
@click.version_option(version=__version__)
|
| 45 |
+
@click.pass_context
|
| 46 |
+
def cli(ctx: click.Context, file: Any, quote: Any, export: Any) -> None:
|
| 47 |
+
"""This script is used to set, get or unset values from a .env file."""
|
| 48 |
+
ctx.obj = {'QUOTE': quote, 'EXPORT': export, 'FILE': file}
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
@contextmanager
|
| 52 |
+
def stream_file(path: os.PathLike) -> Iterator[IO[str]]:
|
| 53 |
+
"""
|
| 54 |
+
Open a file and yield the corresponding (decoded) stream.
|
| 55 |
+
|
| 56 |
+
Exits with error code 2 if the file cannot be opened.
|
| 57 |
+
"""
|
| 58 |
+
|
| 59 |
+
try:
|
| 60 |
+
with open(path) as stream:
|
| 61 |
+
yield stream
|
| 62 |
+
except OSError as exc:
|
| 63 |
+
print(f"Error opening env file: {exc}", file=sys.stderr)
|
| 64 |
+
exit(2)
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
@cli.command()
|
| 68 |
+
@click.pass_context
|
| 69 |
+
@click.option('--format', default='simple',
|
| 70 |
+
type=click.Choice(['simple', 'json', 'shell', 'export']),
|
| 71 |
+
help="The format in which to display the list. Default format is simple, "
|
| 72 |
+
"which displays name=value without quotes.")
|
| 73 |
+
def list(ctx: click.Context, format: bool) -> None:
|
| 74 |
+
"""Display all the stored key/value."""
|
| 75 |
+
file = ctx.obj['FILE']
|
| 76 |
+
|
| 77 |
+
with stream_file(file) as stream:
|
| 78 |
+
values = dotenv_values(stream=stream)
|
| 79 |
+
|
| 80 |
+
if format == 'json':
|
| 81 |
+
click.echo(json.dumps(values, indent=2, sort_keys=True))
|
| 82 |
+
else:
|
| 83 |
+
prefix = 'export ' if format == 'export' else ''
|
| 84 |
+
for k in sorted(values):
|
| 85 |
+
v = values[k]
|
| 86 |
+
if v is not None:
|
| 87 |
+
if format in ('export', 'shell'):
|
| 88 |
+
v = shlex.quote(v)
|
| 89 |
+
click.echo(f'{prefix}{k}={v}')
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
@cli.command()
|
| 93 |
+
@click.pass_context
|
| 94 |
+
@click.argument('key', required=True)
|
| 95 |
+
@click.argument('value', required=True)
|
| 96 |
+
def set(ctx: click.Context, key: Any, value: Any) -> None:
|
| 97 |
+
"""Store the given key/value."""
|
| 98 |
+
file = ctx.obj['FILE']
|
| 99 |
+
quote = ctx.obj['QUOTE']
|
| 100 |
+
export = ctx.obj['EXPORT']
|
| 101 |
+
success, key, value = set_key(file, key, value, quote, export)
|
| 102 |
+
if success:
|
| 103 |
+
click.echo(f'{key}={value}')
|
| 104 |
+
else:
|
| 105 |
+
exit(1)
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
@cli.command()
|
| 109 |
+
@click.pass_context
|
| 110 |
+
@click.argument('key', required=True)
|
| 111 |
+
def get(ctx: click.Context, key: Any) -> None:
|
| 112 |
+
"""Retrieve the value for the given key."""
|
| 113 |
+
file = ctx.obj['FILE']
|
| 114 |
+
|
| 115 |
+
with stream_file(file) as stream:
|
| 116 |
+
values = dotenv_values(stream=stream)
|
| 117 |
+
|
| 118 |
+
stored_value = values.get(key)
|
| 119 |
+
if stored_value:
|
| 120 |
+
click.echo(stored_value)
|
| 121 |
+
else:
|
| 122 |
+
exit(1)
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
@cli.command()
|
| 126 |
+
@click.pass_context
|
| 127 |
+
@click.argument('key', required=True)
|
| 128 |
+
def unset(ctx: click.Context, key: Any) -> None:
|
| 129 |
+
"""Removes the given key."""
|
| 130 |
+
file = ctx.obj['FILE']
|
| 131 |
+
quote = ctx.obj['QUOTE']
|
| 132 |
+
success, key = unset_key(file, key, quote)
|
| 133 |
+
if success:
|
| 134 |
+
click.echo(f"Successfully removed {key}")
|
| 135 |
+
else:
|
| 136 |
+
exit(1)
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
@cli.command(context_settings={'ignore_unknown_options': True})
|
| 140 |
+
@click.pass_context
|
| 141 |
+
@click.option(
|
| 142 |
+
"--override/--no-override",
|
| 143 |
+
default=True,
|
| 144 |
+
help="Override variables from the environment file with those from the .env file.",
|
| 145 |
+
)
|
| 146 |
+
@click.argument('commandline', nargs=-1, type=click.UNPROCESSED)
|
| 147 |
+
def run(ctx: click.Context, override: bool, commandline: List[str]) -> None:
|
| 148 |
+
"""Run command with environment variables present."""
|
| 149 |
+
file = ctx.obj['FILE']
|
| 150 |
+
if not os.path.isfile(file):
|
| 151 |
+
raise click.BadParameter(
|
| 152 |
+
f'Invalid value for \'-f\' "{file}" does not exist.',
|
| 153 |
+
ctx=ctx
|
| 154 |
+
)
|
| 155 |
+
dotenv_as_dict = {
|
| 156 |
+
k: v
|
| 157 |
+
for (k, v) in dotenv_values(file).items()
|
| 158 |
+
if v is not None and (override or k not in os.environ)
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
if not commandline:
|
| 162 |
+
click.echo('No command given.')
|
| 163 |
+
exit(1)
|
| 164 |
+
ret = run_command(commandline, dotenv_as_dict)
|
| 165 |
+
exit(ret)
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
def run_command(command: List[str], env: Dict[str, str]) -> int:
|
| 169 |
+
"""Run command in sub process.
|
| 170 |
+
|
| 171 |
+
Runs the command in a sub process with the variables from `env`
|
| 172 |
+
added in the current environment variables.
|
| 173 |
+
|
| 174 |
+
Parameters
|
| 175 |
+
----------
|
| 176 |
+
command: List[str]
|
| 177 |
+
The command and it's parameters
|
| 178 |
+
env: Dict
|
| 179 |
+
The additional environment variables
|
| 180 |
+
|
| 181 |
+
Returns
|
| 182 |
+
-------
|
| 183 |
+
int
|
| 184 |
+
The return code of the command
|
| 185 |
+
|
| 186 |
+
"""
|
| 187 |
+
# copy the current environment variables and add the vales from
|
| 188 |
+
# `env`
|
| 189 |
+
cmd_env = os.environ.copy()
|
| 190 |
+
cmd_env.update(env)
|
| 191 |
+
|
| 192 |
+
p = Popen(command,
|
| 193 |
+
universal_newlines=True,
|
| 194 |
+
bufsize=0,
|
| 195 |
+
shell=False,
|
| 196 |
+
env=cmd_env)
|
| 197 |
+
_, _ = p.communicate()
|
| 198 |
+
|
| 199 |
+
return p.returncode
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/ipython.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from IPython.core.magic import Magics, line_magic, magics_class # type: ignore
|
| 2 |
+
from IPython.core.magic_arguments import (argument, magic_arguments, # type: ignore
|
| 3 |
+
parse_argstring) # type: ignore
|
| 4 |
+
|
| 5 |
+
from .main import find_dotenv, load_dotenv
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
@magics_class
|
| 9 |
+
class IPythonDotEnv(Magics):
|
| 10 |
+
|
| 11 |
+
@magic_arguments()
|
| 12 |
+
@argument(
|
| 13 |
+
'-o', '--override', action='store_true',
|
| 14 |
+
help="Indicate to override existing variables"
|
| 15 |
+
)
|
| 16 |
+
@argument(
|
| 17 |
+
'-v', '--verbose', action='store_true',
|
| 18 |
+
help="Indicate function calls to be verbose"
|
| 19 |
+
)
|
| 20 |
+
@argument('dotenv_path', nargs='?', type=str, default='.env',
|
| 21 |
+
help='Search in increasingly higher folders for the `dotenv_path`')
|
| 22 |
+
@line_magic
|
| 23 |
+
def dotenv(self, line):
|
| 24 |
+
args = parse_argstring(self.dotenv, line)
|
| 25 |
+
# Locate the .env file
|
| 26 |
+
dotenv_path = args.dotenv_path
|
| 27 |
+
try:
|
| 28 |
+
dotenv_path = find_dotenv(dotenv_path, True, True)
|
| 29 |
+
except IOError:
|
| 30 |
+
print("cannot find .env file")
|
| 31 |
+
return
|
| 32 |
+
|
| 33 |
+
# Load the .env file
|
| 34 |
+
load_dotenv(dotenv_path, verbose=args.verbose, override=args.override)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def load_ipython_extension(ipython):
|
| 38 |
+
"""Register the %dotenv magic."""
|
| 39 |
+
ipython.register_magics(IPythonDotEnv)
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/main.py
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import io
|
| 2 |
+
import logging
|
| 3 |
+
import os
|
| 4 |
+
import pathlib
|
| 5 |
+
import shutil
|
| 6 |
+
import sys
|
| 7 |
+
import tempfile
|
| 8 |
+
from collections import OrderedDict
|
| 9 |
+
from contextlib import contextmanager
|
| 10 |
+
from typing import (IO, Dict, Iterable, Iterator, Mapping, Optional, Tuple,
|
| 11 |
+
Union)
|
| 12 |
+
|
| 13 |
+
from .parser import Binding, parse_stream
|
| 14 |
+
from .variables import parse_variables
|
| 15 |
+
|
| 16 |
+
# A type alias for a string path to be used for the paths in this file.
|
| 17 |
+
# These paths may flow to `open()` and `shutil.move()`; `shutil.move()`
|
| 18 |
+
# only accepts string paths, not byte paths or file descriptors. See
|
| 19 |
+
# https://github.com/python/typeshed/pull/6832.
|
| 20 |
+
StrPath = Union[str, 'os.PathLike[str]']
|
| 21 |
+
|
| 22 |
+
logger = logging.getLogger(__name__)
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def with_warn_for_invalid_lines(mappings: Iterator[Binding]) -> Iterator[Binding]:
|
| 26 |
+
for mapping in mappings:
|
| 27 |
+
if mapping.error:
|
| 28 |
+
logger.warning(
|
| 29 |
+
"Python-dotenv could not parse statement starting at line %s",
|
| 30 |
+
mapping.original.line,
|
| 31 |
+
)
|
| 32 |
+
yield mapping
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class DotEnv:
|
| 36 |
+
def __init__(
|
| 37 |
+
self,
|
| 38 |
+
dotenv_path: Optional[StrPath],
|
| 39 |
+
stream: Optional[IO[str]] = None,
|
| 40 |
+
verbose: bool = False,
|
| 41 |
+
encoding: Optional[str] = None,
|
| 42 |
+
interpolate: bool = True,
|
| 43 |
+
override: bool = True,
|
| 44 |
+
) -> None:
|
| 45 |
+
self.dotenv_path: Optional[StrPath] = dotenv_path
|
| 46 |
+
self.stream: Optional[IO[str]] = stream
|
| 47 |
+
self._dict: Optional[Dict[str, Optional[str]]] = None
|
| 48 |
+
self.verbose: bool = verbose
|
| 49 |
+
self.encoding: Optional[str] = encoding
|
| 50 |
+
self.interpolate: bool = interpolate
|
| 51 |
+
self.override: bool = override
|
| 52 |
+
|
| 53 |
+
@contextmanager
|
| 54 |
+
def _get_stream(self) -> Iterator[IO[str]]:
|
| 55 |
+
if self.dotenv_path and os.path.isfile(self.dotenv_path):
|
| 56 |
+
with open(self.dotenv_path, encoding=self.encoding) as stream:
|
| 57 |
+
yield stream
|
| 58 |
+
elif self.stream is not None:
|
| 59 |
+
yield self.stream
|
| 60 |
+
else:
|
| 61 |
+
if self.verbose:
|
| 62 |
+
logger.info(
|
| 63 |
+
"Python-dotenv could not find configuration file %s.",
|
| 64 |
+
self.dotenv_path or '.env',
|
| 65 |
+
)
|
| 66 |
+
yield io.StringIO('')
|
| 67 |
+
|
| 68 |
+
def dict(self) -> Dict[str, Optional[str]]:
|
| 69 |
+
"""Return dotenv as dict"""
|
| 70 |
+
if self._dict:
|
| 71 |
+
return self._dict
|
| 72 |
+
|
| 73 |
+
raw_values = self.parse()
|
| 74 |
+
|
| 75 |
+
if self.interpolate:
|
| 76 |
+
self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
|
| 77 |
+
else:
|
| 78 |
+
self._dict = OrderedDict(raw_values)
|
| 79 |
+
|
| 80 |
+
return self._dict
|
| 81 |
+
|
| 82 |
+
def parse(self) -> Iterator[Tuple[str, Optional[str]]]:
|
| 83 |
+
with self._get_stream() as stream:
|
| 84 |
+
for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
|
| 85 |
+
if mapping.key is not None:
|
| 86 |
+
yield mapping.key, mapping.value
|
| 87 |
+
|
| 88 |
+
def set_as_environment_variables(self) -> bool:
|
| 89 |
+
"""
|
| 90 |
+
Load the current dotenv as system environment variable.
|
| 91 |
+
"""
|
| 92 |
+
if not self.dict():
|
| 93 |
+
return False
|
| 94 |
+
|
| 95 |
+
for k, v in self.dict().items():
|
| 96 |
+
if k in os.environ and not self.override:
|
| 97 |
+
continue
|
| 98 |
+
if v is not None:
|
| 99 |
+
os.environ[k] = v
|
| 100 |
+
|
| 101 |
+
return True
|
| 102 |
+
|
| 103 |
+
def get(self, key: str) -> Optional[str]:
|
| 104 |
+
"""
|
| 105 |
+
"""
|
| 106 |
+
data = self.dict()
|
| 107 |
+
|
| 108 |
+
if key in data:
|
| 109 |
+
return data[key]
|
| 110 |
+
|
| 111 |
+
if self.verbose:
|
| 112 |
+
logger.warning("Key %s not found in %s.", key, self.dotenv_path)
|
| 113 |
+
|
| 114 |
+
return None
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def get_key(
|
| 118 |
+
dotenv_path: StrPath,
|
| 119 |
+
key_to_get: str,
|
| 120 |
+
encoding: Optional[str] = "utf-8",
|
| 121 |
+
) -> Optional[str]:
|
| 122 |
+
"""
|
| 123 |
+
Get the value of a given key from the given .env.
|
| 124 |
+
|
| 125 |
+
Returns `None` if the key isn't found or doesn't have a value.
|
| 126 |
+
"""
|
| 127 |
+
return DotEnv(dotenv_path, verbose=True, encoding=encoding).get(key_to_get)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
@contextmanager
|
| 131 |
+
def rewrite(
|
| 132 |
+
path: StrPath,
|
| 133 |
+
encoding: Optional[str],
|
| 134 |
+
) -> Iterator[Tuple[IO[str], IO[str]]]:
|
| 135 |
+
pathlib.Path(path).touch()
|
| 136 |
+
|
| 137 |
+
with tempfile.NamedTemporaryFile(mode="w", encoding=encoding, delete=False) as dest:
|
| 138 |
+
error = None
|
| 139 |
+
try:
|
| 140 |
+
with open(path, encoding=encoding) as source:
|
| 141 |
+
yield (source, dest)
|
| 142 |
+
except BaseException as err:
|
| 143 |
+
error = err
|
| 144 |
+
|
| 145 |
+
if error is None:
|
| 146 |
+
shutil.move(dest.name, path)
|
| 147 |
+
else:
|
| 148 |
+
os.unlink(dest.name)
|
| 149 |
+
raise error from None
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
def set_key(
|
| 153 |
+
dotenv_path: StrPath,
|
| 154 |
+
key_to_set: str,
|
| 155 |
+
value_to_set: str,
|
| 156 |
+
quote_mode: str = "always",
|
| 157 |
+
export: bool = False,
|
| 158 |
+
encoding: Optional[str] = "utf-8",
|
| 159 |
+
) -> Tuple[Optional[bool], str, str]:
|
| 160 |
+
"""
|
| 161 |
+
Adds or Updates a key/value to the given .env
|
| 162 |
+
|
| 163 |
+
If the .env path given doesn't exist, fails instead of risking creating
|
| 164 |
+
an orphan .env somewhere in the filesystem
|
| 165 |
+
"""
|
| 166 |
+
if quote_mode not in ("always", "auto", "never"):
|
| 167 |
+
raise ValueError(f"Unknown quote_mode: {quote_mode}")
|
| 168 |
+
|
| 169 |
+
quote = (
|
| 170 |
+
quote_mode == "always"
|
| 171 |
+
or (quote_mode == "auto" and not value_to_set.isalnum())
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
if quote:
|
| 175 |
+
value_out = "'{}'".format(value_to_set.replace("'", "\\'"))
|
| 176 |
+
else:
|
| 177 |
+
value_out = value_to_set
|
| 178 |
+
if export:
|
| 179 |
+
line_out = f'export {key_to_set}={value_out}\n'
|
| 180 |
+
else:
|
| 181 |
+
line_out = f"{key_to_set}={value_out}\n"
|
| 182 |
+
|
| 183 |
+
with rewrite(dotenv_path, encoding=encoding) as (source, dest):
|
| 184 |
+
replaced = False
|
| 185 |
+
missing_newline = False
|
| 186 |
+
for mapping in with_warn_for_invalid_lines(parse_stream(source)):
|
| 187 |
+
if mapping.key == key_to_set:
|
| 188 |
+
dest.write(line_out)
|
| 189 |
+
replaced = True
|
| 190 |
+
else:
|
| 191 |
+
dest.write(mapping.original.string)
|
| 192 |
+
missing_newline = not mapping.original.string.endswith("\n")
|
| 193 |
+
if not replaced:
|
| 194 |
+
if missing_newline:
|
| 195 |
+
dest.write("\n")
|
| 196 |
+
dest.write(line_out)
|
| 197 |
+
|
| 198 |
+
return True, key_to_set, value_to_set
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
def unset_key(
|
| 202 |
+
dotenv_path: StrPath,
|
| 203 |
+
key_to_unset: str,
|
| 204 |
+
quote_mode: str = "always",
|
| 205 |
+
encoding: Optional[str] = "utf-8",
|
| 206 |
+
) -> Tuple[Optional[bool], str]:
|
| 207 |
+
"""
|
| 208 |
+
Removes a given key from the given `.env` file.
|
| 209 |
+
|
| 210 |
+
If the .env path given doesn't exist, fails.
|
| 211 |
+
If the given key doesn't exist in the .env, fails.
|
| 212 |
+
"""
|
| 213 |
+
if not os.path.exists(dotenv_path):
|
| 214 |
+
logger.warning("Can't delete from %s - it doesn't exist.", dotenv_path)
|
| 215 |
+
return None, key_to_unset
|
| 216 |
+
|
| 217 |
+
removed = False
|
| 218 |
+
with rewrite(dotenv_path, encoding=encoding) as (source, dest):
|
| 219 |
+
for mapping in with_warn_for_invalid_lines(parse_stream(source)):
|
| 220 |
+
if mapping.key == key_to_unset:
|
| 221 |
+
removed = True
|
| 222 |
+
else:
|
| 223 |
+
dest.write(mapping.original.string)
|
| 224 |
+
|
| 225 |
+
if not removed:
|
| 226 |
+
logger.warning("Key %s not removed from %s - key doesn't exist.", key_to_unset, dotenv_path)
|
| 227 |
+
return None, key_to_unset
|
| 228 |
+
|
| 229 |
+
return removed, key_to_unset
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
def resolve_variables(
|
| 233 |
+
values: Iterable[Tuple[str, Optional[str]]],
|
| 234 |
+
override: bool,
|
| 235 |
+
) -> Mapping[str, Optional[str]]:
|
| 236 |
+
new_values: Dict[str, Optional[str]] = {}
|
| 237 |
+
|
| 238 |
+
for (name, value) in values:
|
| 239 |
+
if value is None:
|
| 240 |
+
result = None
|
| 241 |
+
else:
|
| 242 |
+
atoms = parse_variables(value)
|
| 243 |
+
env: Dict[str, Optional[str]] = {}
|
| 244 |
+
if override:
|
| 245 |
+
env.update(os.environ) # type: ignore
|
| 246 |
+
env.update(new_values)
|
| 247 |
+
else:
|
| 248 |
+
env.update(new_values)
|
| 249 |
+
env.update(os.environ) # type: ignore
|
| 250 |
+
result = "".join(atom.resolve(env) for atom in atoms)
|
| 251 |
+
|
| 252 |
+
new_values[name] = result
|
| 253 |
+
|
| 254 |
+
return new_values
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
def _walk_to_root(path: str) -> Iterator[str]:
|
| 258 |
+
"""
|
| 259 |
+
Yield directories starting from the given directory up to the root
|
| 260 |
+
"""
|
| 261 |
+
if not os.path.exists(path):
|
| 262 |
+
raise IOError('Starting path not found')
|
| 263 |
+
|
| 264 |
+
if os.path.isfile(path):
|
| 265 |
+
path = os.path.dirname(path)
|
| 266 |
+
|
| 267 |
+
last_dir = None
|
| 268 |
+
current_dir = os.path.abspath(path)
|
| 269 |
+
while last_dir != current_dir:
|
| 270 |
+
yield current_dir
|
| 271 |
+
parent_dir = os.path.abspath(os.path.join(current_dir, os.path.pardir))
|
| 272 |
+
last_dir, current_dir = current_dir, parent_dir
|
| 273 |
+
|
| 274 |
+
|
| 275 |
+
def find_dotenv(
|
| 276 |
+
filename: str = '.env',
|
| 277 |
+
raise_error_if_not_found: bool = False,
|
| 278 |
+
usecwd: bool = False,
|
| 279 |
+
) -> str:
|
| 280 |
+
"""
|
| 281 |
+
Search in increasingly higher folders for the given file
|
| 282 |
+
|
| 283 |
+
Returns path to the file if found, or an empty string otherwise
|
| 284 |
+
"""
|
| 285 |
+
|
| 286 |
+
def _is_interactive():
|
| 287 |
+
""" Decide whether this is running in a REPL or IPython notebook """
|
| 288 |
+
try:
|
| 289 |
+
main = __import__('__main__', None, None, fromlist=['__file__'])
|
| 290 |
+
except ModuleNotFoundError:
|
| 291 |
+
return False
|
| 292 |
+
return not hasattr(main, '__file__')
|
| 293 |
+
|
| 294 |
+
if usecwd or _is_interactive() or getattr(sys, 'frozen', False):
|
| 295 |
+
# Should work without __file__, e.g. in REPL or IPython notebook.
|
| 296 |
+
path = os.getcwd()
|
| 297 |
+
else:
|
| 298 |
+
# will work for .py files
|
| 299 |
+
frame = sys._getframe()
|
| 300 |
+
current_file = __file__
|
| 301 |
+
|
| 302 |
+
while frame.f_code.co_filename == current_file or not os.path.exists(
|
| 303 |
+
frame.f_code.co_filename
|
| 304 |
+
):
|
| 305 |
+
assert frame.f_back is not None
|
| 306 |
+
frame = frame.f_back
|
| 307 |
+
frame_filename = frame.f_code.co_filename
|
| 308 |
+
path = os.path.dirname(os.path.abspath(frame_filename))
|
| 309 |
+
|
| 310 |
+
for dirname in _walk_to_root(path):
|
| 311 |
+
check_path = os.path.join(dirname, filename)
|
| 312 |
+
if os.path.isfile(check_path):
|
| 313 |
+
return check_path
|
| 314 |
+
|
| 315 |
+
if raise_error_if_not_found:
|
| 316 |
+
raise IOError('File not found')
|
| 317 |
+
|
| 318 |
+
return ''
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
def load_dotenv(
|
| 322 |
+
dotenv_path: Optional[StrPath] = None,
|
| 323 |
+
stream: Optional[IO[str]] = None,
|
| 324 |
+
verbose: bool = False,
|
| 325 |
+
override: bool = False,
|
| 326 |
+
interpolate: bool = True,
|
| 327 |
+
encoding: Optional[str] = "utf-8",
|
| 328 |
+
) -> bool:
|
| 329 |
+
"""Parse a .env file and then load all the variables found as environment variables.
|
| 330 |
+
|
| 331 |
+
Parameters:
|
| 332 |
+
dotenv_path: Absolute or relative path to .env file.
|
| 333 |
+
stream: Text stream (such as `io.StringIO`) with .env content, used if
|
| 334 |
+
`dotenv_path` is `None`.
|
| 335 |
+
verbose: Whether to output a warning the .env file is missing.
|
| 336 |
+
override: Whether to override the system environment variables with the variables
|
| 337 |
+
from the `.env` file.
|
| 338 |
+
encoding: Encoding to be used to read the file.
|
| 339 |
+
Returns:
|
| 340 |
+
Bool: True if at least one environment variable is set else False
|
| 341 |
+
|
| 342 |
+
If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the
|
| 343 |
+
.env file.
|
| 344 |
+
"""
|
| 345 |
+
if dotenv_path is None and stream is None:
|
| 346 |
+
dotenv_path = find_dotenv()
|
| 347 |
+
|
| 348 |
+
dotenv = DotEnv(
|
| 349 |
+
dotenv_path=dotenv_path,
|
| 350 |
+
stream=stream,
|
| 351 |
+
verbose=verbose,
|
| 352 |
+
interpolate=interpolate,
|
| 353 |
+
override=override,
|
| 354 |
+
encoding=encoding,
|
| 355 |
+
)
|
| 356 |
+
return dotenv.set_as_environment_variables()
|
| 357 |
+
|
| 358 |
+
|
| 359 |
+
def dotenv_values(
|
| 360 |
+
dotenv_path: Optional[StrPath] = None,
|
| 361 |
+
stream: Optional[IO[str]] = None,
|
| 362 |
+
verbose: bool = False,
|
| 363 |
+
interpolate: bool = True,
|
| 364 |
+
encoding: Optional[str] = "utf-8",
|
| 365 |
+
) -> Dict[str, Optional[str]]:
|
| 366 |
+
"""
|
| 367 |
+
Parse a .env file and return its content as a dict.
|
| 368 |
+
|
| 369 |
+
The returned dict will have `None` values for keys without values in the .env file.
|
| 370 |
+
For example, `foo=bar` results in `{"foo": "bar"}` whereas `foo` alone results in
|
| 371 |
+
`{"foo": None}`
|
| 372 |
+
|
| 373 |
+
Parameters:
|
| 374 |
+
dotenv_path: Absolute or relative path to the .env file.
|
| 375 |
+
stream: `StringIO` object with .env content, used if `dotenv_path` is `None`.
|
| 376 |
+
verbose: Whether to output a warning if the .env file is missing.
|
| 377 |
+
encoding: Encoding to be used to read the file.
|
| 378 |
+
|
| 379 |
+
If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the
|
| 380 |
+
.env file.
|
| 381 |
+
"""
|
| 382 |
+
if dotenv_path is None and stream is None:
|
| 383 |
+
dotenv_path = find_dotenv()
|
| 384 |
+
|
| 385 |
+
return DotEnv(
|
| 386 |
+
dotenv_path=dotenv_path,
|
| 387 |
+
stream=stream,
|
| 388 |
+
verbose=verbose,
|
| 389 |
+
interpolate=interpolate,
|
| 390 |
+
override=True,
|
| 391 |
+
encoding=encoding,
|
| 392 |
+
).dict()
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/parser.py
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import codecs
|
| 2 |
+
import re
|
| 3 |
+
from typing import (IO, Iterator, Match, NamedTuple, Optional, # noqa:F401
|
| 4 |
+
Pattern, Sequence, Tuple)
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def make_regex(string: str, extra_flags: int = 0) -> Pattern[str]:
|
| 8 |
+
return re.compile(string, re.UNICODE | extra_flags)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
_newline = make_regex(r"(\r\n|\n|\r)")
|
| 12 |
+
_multiline_whitespace = make_regex(r"\s*", extra_flags=re.MULTILINE)
|
| 13 |
+
_whitespace = make_regex(r"[^\S\r\n]*")
|
| 14 |
+
_export = make_regex(r"(?:export[^\S\r\n]+)?")
|
| 15 |
+
_single_quoted_key = make_regex(r"'([^']+)'")
|
| 16 |
+
_unquoted_key = make_regex(r"([^=\#\s]+)")
|
| 17 |
+
_equal_sign = make_regex(r"(=[^\S\r\n]*)")
|
| 18 |
+
_single_quoted_value = make_regex(r"'((?:\\'|[^'])*)'")
|
| 19 |
+
_double_quoted_value = make_regex(r'"((?:\\"|[^"])*)"')
|
| 20 |
+
_unquoted_value = make_regex(r"([^\r\n]*)")
|
| 21 |
+
_comment = make_regex(r"(?:[^\S\r\n]*#[^\r\n]*)?")
|
| 22 |
+
_end_of_line = make_regex(r"[^\S\r\n]*(?:\r\n|\n|\r|$)")
|
| 23 |
+
_rest_of_line = make_regex(r"[^\r\n]*(?:\r|\n|\r\n)?")
|
| 24 |
+
_double_quote_escapes = make_regex(r"\\[\\'\"abfnrtv]")
|
| 25 |
+
_single_quote_escapes = make_regex(r"\\[\\']")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class Original(NamedTuple):
|
| 29 |
+
string: str
|
| 30 |
+
line: int
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
class Binding(NamedTuple):
|
| 34 |
+
key: Optional[str]
|
| 35 |
+
value: Optional[str]
|
| 36 |
+
original: Original
|
| 37 |
+
error: bool
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class Position:
|
| 41 |
+
def __init__(self, chars: int, line: int) -> None:
|
| 42 |
+
self.chars = chars
|
| 43 |
+
self.line = line
|
| 44 |
+
|
| 45 |
+
@classmethod
|
| 46 |
+
def start(cls) -> "Position":
|
| 47 |
+
return cls(chars=0, line=1)
|
| 48 |
+
|
| 49 |
+
def set(self, other: "Position") -> None:
|
| 50 |
+
self.chars = other.chars
|
| 51 |
+
self.line = other.line
|
| 52 |
+
|
| 53 |
+
def advance(self, string: str) -> None:
|
| 54 |
+
self.chars += len(string)
|
| 55 |
+
self.line += len(re.findall(_newline, string))
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
class Error(Exception):
|
| 59 |
+
pass
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
class Reader:
|
| 63 |
+
def __init__(self, stream: IO[str]) -> None:
|
| 64 |
+
self.string = stream.read()
|
| 65 |
+
self.position = Position.start()
|
| 66 |
+
self.mark = Position.start()
|
| 67 |
+
|
| 68 |
+
def has_next(self) -> bool:
|
| 69 |
+
return self.position.chars < len(self.string)
|
| 70 |
+
|
| 71 |
+
def set_mark(self) -> None:
|
| 72 |
+
self.mark.set(self.position)
|
| 73 |
+
|
| 74 |
+
def get_marked(self) -> Original:
|
| 75 |
+
return Original(
|
| 76 |
+
string=self.string[self.mark.chars:self.position.chars],
|
| 77 |
+
line=self.mark.line,
|
| 78 |
+
)
|
| 79 |
+
|
| 80 |
+
def peek(self, count: int) -> str:
|
| 81 |
+
return self.string[self.position.chars:self.position.chars + count]
|
| 82 |
+
|
| 83 |
+
def read(self, count: int) -> str:
|
| 84 |
+
result = self.string[self.position.chars:self.position.chars + count]
|
| 85 |
+
if len(result) < count:
|
| 86 |
+
raise Error("read: End of string")
|
| 87 |
+
self.position.advance(result)
|
| 88 |
+
return result
|
| 89 |
+
|
| 90 |
+
def read_regex(self, regex: Pattern[str]) -> Sequence[str]:
|
| 91 |
+
match = regex.match(self.string, self.position.chars)
|
| 92 |
+
if match is None:
|
| 93 |
+
raise Error("read_regex: Pattern not found")
|
| 94 |
+
self.position.advance(self.string[match.start():match.end()])
|
| 95 |
+
return match.groups()
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def decode_escapes(regex: Pattern[str], string: str) -> str:
|
| 99 |
+
def decode_match(match: Match[str]) -> str:
|
| 100 |
+
return codecs.decode(match.group(0), 'unicode-escape') # type: ignore
|
| 101 |
+
|
| 102 |
+
return regex.sub(decode_match, string)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def parse_key(reader: Reader) -> Optional[str]:
|
| 106 |
+
char = reader.peek(1)
|
| 107 |
+
if char == "#":
|
| 108 |
+
return None
|
| 109 |
+
elif char == "'":
|
| 110 |
+
(key,) = reader.read_regex(_single_quoted_key)
|
| 111 |
+
else:
|
| 112 |
+
(key,) = reader.read_regex(_unquoted_key)
|
| 113 |
+
return key
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def parse_unquoted_value(reader: Reader) -> str:
|
| 117 |
+
(part,) = reader.read_regex(_unquoted_value)
|
| 118 |
+
return re.sub(r"\s+#.*", "", part).rstrip()
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
def parse_value(reader: Reader) -> str:
|
| 122 |
+
char = reader.peek(1)
|
| 123 |
+
if char == u"'":
|
| 124 |
+
(value,) = reader.read_regex(_single_quoted_value)
|
| 125 |
+
return decode_escapes(_single_quote_escapes, value)
|
| 126 |
+
elif char == u'"':
|
| 127 |
+
(value,) = reader.read_regex(_double_quoted_value)
|
| 128 |
+
return decode_escapes(_double_quote_escapes, value)
|
| 129 |
+
elif char in (u"", u"\n", u"\r"):
|
| 130 |
+
return u""
|
| 131 |
+
else:
|
| 132 |
+
return parse_unquoted_value(reader)
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
def parse_binding(reader: Reader) -> Binding:
|
| 136 |
+
reader.set_mark()
|
| 137 |
+
try:
|
| 138 |
+
reader.read_regex(_multiline_whitespace)
|
| 139 |
+
if not reader.has_next():
|
| 140 |
+
return Binding(
|
| 141 |
+
key=None,
|
| 142 |
+
value=None,
|
| 143 |
+
original=reader.get_marked(),
|
| 144 |
+
error=False,
|
| 145 |
+
)
|
| 146 |
+
reader.read_regex(_export)
|
| 147 |
+
key = parse_key(reader)
|
| 148 |
+
reader.read_regex(_whitespace)
|
| 149 |
+
if reader.peek(1) == "=":
|
| 150 |
+
reader.read_regex(_equal_sign)
|
| 151 |
+
value: Optional[str] = parse_value(reader)
|
| 152 |
+
else:
|
| 153 |
+
value = None
|
| 154 |
+
reader.read_regex(_comment)
|
| 155 |
+
reader.read_regex(_end_of_line)
|
| 156 |
+
return Binding(
|
| 157 |
+
key=key,
|
| 158 |
+
value=value,
|
| 159 |
+
original=reader.get_marked(),
|
| 160 |
+
error=False,
|
| 161 |
+
)
|
| 162 |
+
except Error:
|
| 163 |
+
reader.read_regex(_rest_of_line)
|
| 164 |
+
return Binding(
|
| 165 |
+
key=None,
|
| 166 |
+
value=None,
|
| 167 |
+
original=reader.get_marked(),
|
| 168 |
+
error=True,
|
| 169 |
+
)
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
def parse_stream(stream: IO[str]) -> Iterator[Binding]:
|
| 173 |
+
reader = Reader(stream)
|
| 174 |
+
while reader.has_next():
|
| 175 |
+
yield parse_binding(reader)
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Marker file for PEP 561
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/variables.py
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
from abc import ABCMeta, abstractmethod
|
| 3 |
+
from typing import Iterator, Mapping, Optional, Pattern
|
| 4 |
+
|
| 5 |
+
_posix_variable: Pattern[str] = re.compile(
|
| 6 |
+
r"""
|
| 7 |
+
\$\{
|
| 8 |
+
(?P<name>[^\}:]*)
|
| 9 |
+
(?::-
|
| 10 |
+
(?P<default>[^\}]*)
|
| 11 |
+
)?
|
| 12 |
+
\}
|
| 13 |
+
""",
|
| 14 |
+
re.VERBOSE,
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class Atom(metaclass=ABCMeta):
|
| 19 |
+
def __ne__(self, other: object) -> bool:
|
| 20 |
+
result = self.__eq__(other)
|
| 21 |
+
if result is NotImplemented:
|
| 22 |
+
return NotImplemented
|
| 23 |
+
return not result
|
| 24 |
+
|
| 25 |
+
@abstractmethod
|
| 26 |
+
def resolve(self, env: Mapping[str, Optional[str]]) -> str: ...
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class Literal(Atom):
|
| 30 |
+
def __init__(self, value: str) -> None:
|
| 31 |
+
self.value = value
|
| 32 |
+
|
| 33 |
+
def __repr__(self) -> str:
|
| 34 |
+
return f"Literal(value={self.value})"
|
| 35 |
+
|
| 36 |
+
def __eq__(self, other: object) -> bool:
|
| 37 |
+
if not isinstance(other, self.__class__):
|
| 38 |
+
return NotImplemented
|
| 39 |
+
return self.value == other.value
|
| 40 |
+
|
| 41 |
+
def __hash__(self) -> int:
|
| 42 |
+
return hash((self.__class__, self.value))
|
| 43 |
+
|
| 44 |
+
def resolve(self, env: Mapping[str, Optional[str]]) -> str:
|
| 45 |
+
return self.value
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
class Variable(Atom):
|
| 49 |
+
def __init__(self, name: str, default: Optional[str]) -> None:
|
| 50 |
+
self.name = name
|
| 51 |
+
self.default = default
|
| 52 |
+
|
| 53 |
+
def __repr__(self) -> str:
|
| 54 |
+
return f"Variable(name={self.name}, default={self.default})"
|
| 55 |
+
|
| 56 |
+
def __eq__(self, other: object) -> bool:
|
| 57 |
+
if not isinstance(other, self.__class__):
|
| 58 |
+
return NotImplemented
|
| 59 |
+
return (self.name, self.default) == (other.name, other.default)
|
| 60 |
+
|
| 61 |
+
def __hash__(self) -> int:
|
| 62 |
+
return hash((self.__class__, self.name, self.default))
|
| 63 |
+
|
| 64 |
+
def resolve(self, env: Mapping[str, Optional[str]]) -> str:
|
| 65 |
+
default = self.default if self.default is not None else ""
|
| 66 |
+
result = env.get(self.name, default)
|
| 67 |
+
return result if result is not None else ""
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def parse_variables(value: str) -> Iterator[Atom]:
|
| 71 |
+
cursor = 0
|
| 72 |
+
|
| 73 |
+
for match in _posix_variable.finditer(value):
|
| 74 |
+
(start, end) = match.span()
|
| 75 |
+
name = match["name"]
|
| 76 |
+
default = match["default"]
|
| 77 |
+
|
| 78 |
+
if start > cursor:
|
| 79 |
+
yield Literal(value=value[cursor:start])
|
| 80 |
+
|
| 81 |
+
yield Variable(name=name, default=default)
|
| 82 |
+
cursor = end
|
| 83 |
+
|
| 84 |
+
length = len(value)
|
| 85 |
+
if cursor < length:
|
| 86 |
+
yield Literal(value=value[cursor:length])
|
evalkit_cambrian/lib/python3.10/site-packages/dotenv/version.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__version__ = "1.0.1"
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/__init__.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""propcache: An accelerated property cache for Python classes."""
|
| 2 |
+
|
| 3 |
+
from typing import TYPE_CHECKING
|
| 4 |
+
|
| 5 |
+
_PUBLIC_API = ("cached_property", "under_cached_property")
|
| 6 |
+
|
| 7 |
+
__version__ = "0.2.1"
|
| 8 |
+
__all__ = ()
|
| 9 |
+
|
| 10 |
+
# Imports have moved to `propcache.api` in 0.2.0+.
|
| 11 |
+
# This module is now a facade for the API.
|
| 12 |
+
if TYPE_CHECKING:
|
| 13 |
+
from .api import cached_property as cached_property # noqa: F401
|
| 14 |
+
from .api import under_cached_property as under_cached_property # noqa: F401
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def _import_facade(attr: str) -> object:
|
| 18 |
+
"""Import the public API from the `api` module."""
|
| 19 |
+
if attr in _PUBLIC_API:
|
| 20 |
+
from . import api # pylint: disable=import-outside-toplevel
|
| 21 |
+
|
| 22 |
+
return getattr(api, attr)
|
| 23 |
+
raise AttributeError(f"module '{__package__}' has no attribute '{attr}'")
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def _dir_facade() -> list[str]:
|
| 27 |
+
"""Include the public API in the module's dir() output."""
|
| 28 |
+
return [*_PUBLIC_API, *globals().keys()]
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
__getattr__ = _import_facade
|
| 32 |
+
__dir__ = _dir_facade
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.05 kB). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/__pycache__/_helpers.cpython-310.pyc
ADDED
|
Binary file (798 Bytes). View file
|
|
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/_helpers.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
from typing import TYPE_CHECKING
|
| 4 |
+
|
| 5 |
+
__all__ = ("cached_property", "under_cached_property")
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
NO_EXTENSIONS = bool(os.environ.get("PROPCACHE_NO_EXTENSIONS")) # type: bool
|
| 9 |
+
if sys.implementation.name != "cpython":
|
| 10 |
+
NO_EXTENSIONS = True
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
# isort: off
|
| 14 |
+
if TYPE_CHECKING:
|
| 15 |
+
from ._helpers_py import cached_property as cached_property_py
|
| 16 |
+
from ._helpers_py import under_cached_property as under_cached_property_py
|
| 17 |
+
|
| 18 |
+
cached_property = cached_property_py
|
| 19 |
+
under_cached_property = under_cached_property_py
|
| 20 |
+
elif not NO_EXTENSIONS: # pragma: no branch
|
| 21 |
+
try:
|
| 22 |
+
from ._helpers_c import cached_property as cached_property_c # type: ignore[attr-defined, unused-ignore] # noqa: E501
|
| 23 |
+
from ._helpers_c import under_cached_property as under_cached_property_c # type: ignore[attr-defined, unused-ignore] # noqa: E501
|
| 24 |
+
|
| 25 |
+
cached_property = cached_property_c
|
| 26 |
+
under_cached_property = under_cached_property_c
|
| 27 |
+
except ImportError: # pragma: no cover
|
| 28 |
+
from ._helpers_py import cached_property as cached_property_py
|
| 29 |
+
from ._helpers_py import under_cached_property as under_cached_property_py
|
| 30 |
+
|
| 31 |
+
cached_property = cached_property_py # type: ignore[assignment, misc]
|
| 32 |
+
under_cached_property = under_cached_property_py
|
| 33 |
+
else:
|
| 34 |
+
from ._helpers_py import cached_property as cached_property_py
|
| 35 |
+
from ._helpers_py import under_cached_property as under_cached_property_py
|
| 36 |
+
|
| 37 |
+
cached_property = cached_property_py # type: ignore[assignment, misc]
|
| 38 |
+
under_cached_property = under_cached_property_py
|
| 39 |
+
# isort: on
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/_helpers_c.pyx
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# cython: language_level=3
|
| 2 |
+
from types import GenericAlias
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
cdef _sentinel = object()
|
| 6 |
+
|
| 7 |
+
cdef class under_cached_property:
|
| 8 |
+
"""Use as a class method decorator. It operates almost exactly like
|
| 9 |
+
the Python `@property` decorator, but it puts the result of the
|
| 10 |
+
method it decorates into the instance dict after the first call,
|
| 11 |
+
effectively replacing the function it decorates with an instance
|
| 12 |
+
variable. It is, in Python parlance, a data descriptor.
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
cdef readonly object wrapped
|
| 17 |
+
cdef object name
|
| 18 |
+
|
| 19 |
+
def __init__(self, wrapped):
|
| 20 |
+
self.wrapped = wrapped
|
| 21 |
+
self.name = wrapped.__name__
|
| 22 |
+
|
| 23 |
+
@property
|
| 24 |
+
def __doc__(self):
|
| 25 |
+
return self.wrapped.__doc__
|
| 26 |
+
|
| 27 |
+
def __get__(self, inst, owner):
|
| 28 |
+
if inst is None:
|
| 29 |
+
return self
|
| 30 |
+
cdef dict cache = inst._cache
|
| 31 |
+
val = cache.get(self.name, _sentinel)
|
| 32 |
+
if val is _sentinel:
|
| 33 |
+
val = self.wrapped(inst)
|
| 34 |
+
cache[self.name] = val
|
| 35 |
+
return val
|
| 36 |
+
|
| 37 |
+
def __set__(self, inst, value):
|
| 38 |
+
raise AttributeError("cached property is read-only")
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
cdef class cached_property:
|
| 42 |
+
"""Use as a class method decorator. It operates almost exactly like
|
| 43 |
+
the Python `@property` decorator, but it puts the result of the
|
| 44 |
+
method it decorates into the instance dict after the first call,
|
| 45 |
+
effectively replacing the function it decorates with an instance
|
| 46 |
+
variable. It is, in Python parlance, a data descriptor.
|
| 47 |
+
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
cdef readonly object func
|
| 51 |
+
cdef object name
|
| 52 |
+
|
| 53 |
+
def __init__(self, func):
|
| 54 |
+
self.func = func
|
| 55 |
+
self.name = None
|
| 56 |
+
|
| 57 |
+
@property
|
| 58 |
+
def __doc__(self):
|
| 59 |
+
return self.func.__doc__
|
| 60 |
+
|
| 61 |
+
def __set_name__(self, owner, name):
|
| 62 |
+
if self.name is None:
|
| 63 |
+
self.name = name
|
| 64 |
+
elif name != self.name:
|
| 65 |
+
raise TypeError(
|
| 66 |
+
"Cannot assign the same cached_property to two different names "
|
| 67 |
+
f"({self.name!r} and {name!r})."
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
def __get__(self, inst, owner):
|
| 71 |
+
if inst is None:
|
| 72 |
+
return self
|
| 73 |
+
if self.name is None:
|
| 74 |
+
raise TypeError(
|
| 75 |
+
"Cannot use cached_property instance"
|
| 76 |
+
" without calling __set_name__ on it.")
|
| 77 |
+
cdef dict cache = inst.__dict__
|
| 78 |
+
val = cache.get(self.name, _sentinel)
|
| 79 |
+
if val is _sentinel:
|
| 80 |
+
val = self.func(inst)
|
| 81 |
+
cache[self.name] = val
|
| 82 |
+
return val
|
| 83 |
+
|
| 84 |
+
__class_getitem__ = classmethod(GenericAlias)
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/_helpers_py.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Various helper functions."""
|
| 2 |
+
|
| 3 |
+
import sys
|
| 4 |
+
from functools import cached_property
|
| 5 |
+
from typing import Any, Callable, Generic, Optional, Protocol, TypeVar, Union, overload
|
| 6 |
+
|
| 7 |
+
__all__ = ("under_cached_property", "cached_property")
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
if sys.version_info >= (3, 11):
|
| 11 |
+
from typing import Self
|
| 12 |
+
else:
|
| 13 |
+
Self = Any
|
| 14 |
+
|
| 15 |
+
_T = TypeVar("_T")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class _TSelf(Protocol, Generic[_T]):
|
| 19 |
+
_cache: dict[str, _T]
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class under_cached_property(Generic[_T]):
|
| 23 |
+
"""Use as a class method decorator.
|
| 24 |
+
|
| 25 |
+
It operates almost exactly like
|
| 26 |
+
the Python `@property` decorator, but it puts the result of the
|
| 27 |
+
method it decorates into the instance dict after the first call,
|
| 28 |
+
effectively replacing the function it decorates with an instance
|
| 29 |
+
variable. It is, in Python parlance, a data descriptor.
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
def __init__(self, wrapped: Callable[..., _T]) -> None:
|
| 33 |
+
self.wrapped = wrapped
|
| 34 |
+
self.__doc__ = wrapped.__doc__
|
| 35 |
+
self.name = wrapped.__name__
|
| 36 |
+
|
| 37 |
+
@overload
|
| 38 |
+
def __get__(self, inst: None, owner: Optional[type[object]] = None) -> Self: ...
|
| 39 |
+
|
| 40 |
+
@overload
|
| 41 |
+
def __get__(self, inst: _TSelf[_T], owner: Optional[type[object]] = None) -> _T: ...
|
| 42 |
+
|
| 43 |
+
def __get__(
|
| 44 |
+
self, inst: Optional[_TSelf[_T]], owner: Optional[type[object]] = None
|
| 45 |
+
) -> Union[_T, Self]:
|
| 46 |
+
if inst is None:
|
| 47 |
+
return self
|
| 48 |
+
try:
|
| 49 |
+
return inst._cache[self.name]
|
| 50 |
+
except KeyError:
|
| 51 |
+
val = self.wrapped(inst)
|
| 52 |
+
inst._cache[self.name] = val
|
| 53 |
+
return val
|
| 54 |
+
|
| 55 |
+
def __set__(self, inst: _TSelf[_T], value: _T) -> None:
|
| 56 |
+
raise AttributeError("cached property is read-only")
|
evalkit_cambrian/lib/python3.10/site-packages/propcache/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Placeholder
|
evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2020 Will McGugan
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 5 |
+
in the Software without restriction, including without limitation the rights
|
| 6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 7 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 8 |
+
furnished to do 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 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 19 |
+
SOFTWARE.
|
evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/METADATA
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: rich
|
| 3 |
+
Version: 13.9.4
|
| 4 |
+
Summary: Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal
|
| 5 |
+
Home-page: https://github.com/Textualize/rich
|
| 6 |
+
License: MIT
|
| 7 |
+
Author: Will McGugan
|
| 8 |
+
Author-email: willmcgugan@gmail.com
|
| 9 |
+
Requires-Python: >=3.8.0
|
| 10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 11 |
+
Classifier: Environment :: Console
|
| 12 |
+
Classifier: Framework :: IPython
|
| 13 |
+
Classifier: Intended Audience :: Developers
|
| 14 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 15 |
+
Classifier: Operating System :: MacOS
|
| 16 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 17 |
+
Classifier: Operating System :: POSIX :: Linux
|
| 18 |
+
Classifier: Programming Language :: Python :: 3
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 25 |
+
Classifier: Typing :: Typed
|
| 26 |
+
Provides-Extra: jupyter
|
| 27 |
+
Requires-Dist: ipywidgets (>=7.5.1,<9) ; extra == "jupyter"
|
| 28 |
+
Requires-Dist: markdown-it-py (>=2.2.0)
|
| 29 |
+
Requires-Dist: pygments (>=2.13.0,<3.0.0)
|
| 30 |
+
Requires-Dist: typing-extensions (>=4.0.0,<5.0) ; python_version < "3.11"
|
| 31 |
+
Project-URL: Documentation, https://rich.readthedocs.io/en/latest/
|
| 32 |
+
Description-Content-Type: text/markdown
|
| 33 |
+
|
| 34 |
+
[](https://pypi.org/project/rich/) [](https://badge.fury.io/py/rich)
|
| 35 |
+
|
| 36 |
+
[](https://pepy.tech/project/rich)
|
| 37 |
+
[](https://codecov.io/gh/Textualize/rich)
|
| 38 |
+
[](https://www.willmcgugan.com/tag/rich/)
|
| 39 |
+
[](https://twitter.com/willmcgugan)
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
|
| 43 |
+
[English readme](https://github.com/textualize/rich/blob/master/README.md)
|
| 44 |
+
• [简体中文 readme](https://github.com/textualize/rich/blob/master/README.cn.md)
|
| 45 |
+
• [正體中文 readme](https://github.com/textualize/rich/blob/master/README.zh-tw.md)
|
| 46 |
+
• [Lengua española readme](https://github.com/textualize/rich/blob/master/README.es.md)
|
| 47 |
+
• [Deutsche readme](https://github.com/textualize/rich/blob/master/README.de.md)
|
| 48 |
+
• [Läs på svenska](https://github.com/textualize/rich/blob/master/README.sv.md)
|
| 49 |
+
• [日本語 readme](https://github.com/textualize/rich/blob/master/README.ja.md)
|
| 50 |
+
• [한국어 readme](https://github.com/textualize/rich/blob/master/README.kr.md)
|
| 51 |
+
• [Français readme](https://github.com/textualize/rich/blob/master/README.fr.md)
|
| 52 |
+
• [Schwizerdütsch readme](https://github.com/textualize/rich/blob/master/README.de-ch.md)
|
| 53 |
+
• [हिन्दी readme](https://github.com/textualize/rich/blob/master/README.hi.md)
|
| 54 |
+
• [Português brasileiro readme](https://github.com/textualize/rich/blob/master/README.pt-br.md)
|
| 55 |
+
• [Italian readme](https://github.com/textualize/rich/blob/master/README.it.md)
|
| 56 |
+
• [Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
|
| 57 |
+
• [Indonesian readme](https://github.com/textualize/rich/blob/master/README.id.md)
|
| 58 |
+
• [فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
|
| 59 |
+
• [Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
|
| 60 |
+
• [Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
Rich is a Python library for _rich_ text and beautiful formatting in the terminal.
|
| 64 |
+
|
| 65 |
+
The [Rich API](https://rich.readthedocs.io/en/latest/) makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
|
| 69 |
+
For a video introduction to Rich see [calmcode.io](https://calmcode.io/rich/introduction.html) by [@fishnets88](https://twitter.com/fishnets88).
|
| 70 |
+
|
| 71 |
+
See what [people are saying about Rich](https://www.willmcgugan.com/blog/pages/post/rich-tweets/).
|
| 72 |
+
|
| 73 |
+
## Compatibility
|
| 74 |
+
|
| 75 |
+
Rich works with Linux, macOS and Windows. True color / emoji works with new Windows Terminal, classic terminal is limited to 16 colors. Rich requires Python 3.8 or later.
|
| 76 |
+
|
| 77 |
+
Rich works with [Jupyter notebooks](https://jupyter.org/) with no additional configuration required.
|
| 78 |
+
|
| 79 |
+
## Installing
|
| 80 |
+
|
| 81 |
+
Install with `pip` or your favorite PyPI package manager.
|
| 82 |
+
|
| 83 |
+
```sh
|
| 84 |
+
python -m pip install rich
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
Run the following to test Rich output on your terminal:
|
| 88 |
+
|
| 89 |
+
```sh
|
| 90 |
+
python -m rich
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## Rich Print
|
| 94 |
+
|
| 95 |
+
To effortlessly add rich output to your application, you can import the [rich print](https://rich.readthedocs.io/en/latest/introduction.html#quick-start) method, which has the same signature as the builtin Python function. Try this:
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
from rich import print
|
| 99 |
+
|
| 100 |
+
print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals())
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
|
| 105 |
+
## Rich REPL
|
| 106 |
+
|
| 107 |
+
Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted.
|
| 108 |
+
|
| 109 |
+
```python
|
| 110 |
+
>>> from rich import pretty
|
| 111 |
+
>>> pretty.install()
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
|
| 116 |
+
## Using the Console
|
| 117 |
+
|
| 118 |
+
For more control over rich terminal content, import and construct a [Console](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console) object.
|
| 119 |
+
|
| 120 |
+
```python
|
| 121 |
+
from rich.console import Console
|
| 122 |
+
|
| 123 |
+
console = Console()
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
The Console object has a `print` method which has an intentionally similar interface to the builtin `print` function. Here's an example of use:
|
| 127 |
+
|
| 128 |
+
```python
|
| 129 |
+
console.print("Hello", "World!")
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
As you might expect, this will print `"Hello World!"` to the terminal. Note that unlike the builtin `print` function, Rich will word-wrap your text to fit within the terminal width.
|
| 133 |
+
|
| 134 |
+
There are a few ways of adding color and style to your output. You can set a style for the entire output by adding a `style` keyword argument. Here's an example:
|
| 135 |
+
|
| 136 |
+
```python
|
| 137 |
+
console.print("Hello", "World!", style="bold red")
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
The output will be something like the following:
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
|
| 144 |
+
That's fine for styling a line of text at a time. For more finely grained styling, Rich renders a special markup which is similar in syntax to [bbcode](https://en.wikipedia.org/wiki/BBCode). Here's an example:
|
| 145 |
+
|
| 146 |
+
```python
|
| 147 |
+
console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].")
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
|
| 152 |
+
You can use a Console object to generate sophisticated output with minimal effort. See the [Console API](https://rich.readthedocs.io/en/latest/console.html) docs for details.
|
| 153 |
+
|
| 154 |
+
## Rich Inspect
|
| 155 |
+
|
| 156 |
+
Rich has an [inspect](https://rich.readthedocs.io/en/latest/reference/init.html?highlight=inspect#rich.inspect) function which can produce a report on any Python object, such as class, instance, or builtin.
|
| 157 |
+
|
| 158 |
+
```python
|
| 159 |
+
>>> my_list = ["foo", "bar"]
|
| 160 |
+
>>> from rich import inspect
|
| 161 |
+
>>> inspect(my_list, methods=True)
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
|
| 166 |
+
See the [inspect docs](https://rich.readthedocs.io/en/latest/reference/init.html#rich.inspect) for details.
|
| 167 |
+
|
| 168 |
+
# Rich Library
|
| 169 |
+
|
| 170 |
+
Rich contains a number of builtin _renderables_ you can use to create elegant output in your CLI and help you debug your code.
|
| 171 |
+
|
| 172 |
+
Click the following headings for details:
|
| 173 |
+
|
| 174 |
+
<details>
|
| 175 |
+
<summary>Log</summary>
|
| 176 |
+
|
| 177 |
+
The Console object has a `log()` method which has a similar interface to `print()`, but also renders a column for the current time and the file and line which made the call. By default Rich will do syntax highlighting for Python structures and for repr strings. If you log a collection (i.e. a dict or a list) Rich will pretty print it so that it fits in the available space. Here's an example of some of these features.
|
| 178 |
+
|
| 179 |
+
```python
|
| 180 |
+
from rich.console import Console
|
| 181 |
+
console = Console()
|
| 182 |
+
|
| 183 |
+
test_data = [
|
| 184 |
+
{"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",},
|
| 185 |
+
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
|
| 186 |
+
{"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"},
|
| 187 |
+
]
|
| 188 |
+
|
| 189 |
+
def test_log():
|
| 190 |
+
enabled = False
|
| 191 |
+
context = {
|
| 192 |
+
"foo": "bar",
|
| 193 |
+
}
|
| 194 |
+
movies = ["Deadpool", "Rise of the Skywalker"]
|
| 195 |
+
console.log("Hello from", console, "!")
|
| 196 |
+
console.log(test_data, log_locals=True)
|
| 197 |
+
|
| 198 |
+
|
| 199 |
+
test_log()
|
| 200 |
+
```
|
| 201 |
+
|
| 202 |
+
The above produces the following output:
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
|
| 206 |
+
Note the `log_locals` argument, which outputs a table containing the local variables where the log method was called.
|
| 207 |
+
|
| 208 |
+
The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid.
|
| 209 |
+
|
| 210 |
+
</details>
|
| 211 |
+
<details>
|
| 212 |
+
<summary>Logging Handler</summary>
|
| 213 |
+
|
| 214 |
+
You can also use the builtin [Handler class](https://rich.readthedocs.io/en/latest/logging.html) to format and colorize output from Python's logging module. Here's an example of the output:
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
|
| 218 |
+
</details>
|
| 219 |
+
|
| 220 |
+
<details>
|
| 221 |
+
<summary>Emoji</summary>
|
| 222 |
+
|
| 223 |
+
To insert an emoji in to console output place the name between two colons. Here's an example:
|
| 224 |
+
|
| 225 |
+
```python
|
| 226 |
+
>>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:")
|
| 227 |
+
😃 🧛 💩 👍 🦝
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
Please use this feature wisely.
|
| 231 |
+
|
| 232 |
+
</details>
|
| 233 |
+
|
| 234 |
+
<details>
|
| 235 |
+
<summary>Tables</summary>
|
| 236 |
+
|
| 237 |
+
Rich can render flexible [tables](https://rich.readthedocs.io/en/latest/tables.html) with unicode box characters. There is a large variety of formatting options for borders, styles, cell alignment etc.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
|
| 241 |
+
The animation above was generated with [table_movie.py](https://github.com/textualize/rich/blob/master/examples/table_movie.py) in the examples directory.
|
| 242 |
+
|
| 243 |
+
Here's a simpler table example:
|
| 244 |
+
|
| 245 |
+
```python
|
| 246 |
+
from rich.console import Console
|
| 247 |
+
from rich.table import Table
|
| 248 |
+
|
| 249 |
+
console = Console()
|
| 250 |
+
|
| 251 |
+
table = Table(show_header=True, header_style="bold magenta")
|
| 252 |
+
table.add_column("Date", style="dim", width=12)
|
| 253 |
+
table.add_column("Title")
|
| 254 |
+
table.add_column("Production Budget", justify="right")
|
| 255 |
+
table.add_column("Box Office", justify="right")
|
| 256 |
+
table.add_row(
|
| 257 |
+
"Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118"
|
| 258 |
+
)
|
| 259 |
+
table.add_row(
|
| 260 |
+
"May 25, 2018",
|
| 261 |
+
"[red]Solo[/red]: A Star Wars Story",
|
| 262 |
+
"$275,000,000",
|
| 263 |
+
"$393,151,347",
|
| 264 |
+
)
|
| 265 |
+
table.add_row(
|
| 266 |
+
"Dec 15, 2017",
|
| 267 |
+
"Star Wars Ep. VIII: The Last Jedi",
|
| 268 |
+
"$262,000,000",
|
| 269 |
+
"[bold]$1,332,539,889[/bold]",
|
| 270 |
+
)
|
| 271 |
+
|
| 272 |
+
console.print(table)
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
+
This produces the following output:
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
|
| 279 |
+
Note that console markup is rendered in the same way as `print()` and `log()`. In fact, anything that is renderable by Rich may be included in the headers / rows (even other tables).
|
| 280 |
+
|
| 281 |
+
The `Table` class is smart enough to resize columns to fit the available width of the terminal, wrapping text as required. Here's the same example, with the terminal made smaller than the table above:
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
|
| 285 |
+
</details>
|
| 286 |
+
|
| 287 |
+
<details>
|
| 288 |
+
<summary>Progress Bars</summary>
|
| 289 |
+
|
| 290 |
+
Rich can render multiple flicker-free [progress](https://rich.readthedocs.io/en/latest/progress.html) bars to track long-running tasks.
|
| 291 |
+
|
| 292 |
+
For basic usage, wrap any sequence in the `track` function and iterate over the result. Here's an example:
|
| 293 |
+
|
| 294 |
+
```python
|
| 295 |
+
from rich.progress import track
|
| 296 |
+
|
| 297 |
+
for step in track(range(100)):
|
| 298 |
+
do_step(step)
|
| 299 |
+
```
|
| 300 |
+
|
| 301 |
+
It's not much harder to add multiple progress bars. Here's an example taken from the docs:
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
|
| 305 |
+
The columns may be configured to show any details you want. Built-in columns include percentage complete, file size, file speed, and time remaining. Here's another example showing a download in progress:
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
|
| 309 |
+
To try this out yourself, see [examples/downloader.py](https://github.com/textualize/rich/blob/master/examples/downloader.py) which can download multiple URLs simultaneously while displaying progress.
|
| 310 |
+
|
| 311 |
+
</details>
|
| 312 |
+
|
| 313 |
+
<details>
|
| 314 |
+
<summary>Status</summary>
|
| 315 |
+
|
| 316 |
+
For situations where it is hard to calculate progress, you can use the [status](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console.status) method which will display a 'spinner' animation and message. The animation won't prevent you from using the console as normal. Here's an example:
|
| 317 |
+
|
| 318 |
+
```python
|
| 319 |
+
from time import sleep
|
| 320 |
+
from rich.console import Console
|
| 321 |
+
|
| 322 |
+
console = Console()
|
| 323 |
+
tasks = [f"task {n}" for n in range(1, 11)]
|
| 324 |
+
|
| 325 |
+
with console.status("[bold green]Working on tasks...") as status:
|
| 326 |
+
while tasks:
|
| 327 |
+
task = tasks.pop(0)
|
| 328 |
+
sleep(1)
|
| 329 |
+
console.log(f"{task} complete")
|
| 330 |
+
```
|
| 331 |
+
|
| 332 |
+
This generates the following output in the terminal.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
|
| 336 |
+
The spinner animations were borrowed from [cli-spinners](https://www.npmjs.com/package/cli-spinners). You can select a spinner by specifying the `spinner` parameter. Run the following command to see the available values:
|
| 337 |
+
|
| 338 |
+
```
|
| 339 |
+
python -m rich.spinner
|
| 340 |
+
```
|
| 341 |
+
|
| 342 |
+
The above command generates the following output in the terminal:
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
|
| 346 |
+
</details>
|
| 347 |
+
|
| 348 |
+
<details>
|
| 349 |
+
<summary>Tree</summary>
|
| 350 |
+
|
| 351 |
+
Rich can render a [tree](https://rich.readthedocs.io/en/latest/tree.html) with guide lines. A tree is ideal for displaying a file structure, or any other hierarchical data.
|
| 352 |
+
|
| 353 |
+
The labels of the tree can be simple text or anything else Rich can render. Run the following for a demonstration:
|
| 354 |
+
|
| 355 |
+
```
|
| 356 |
+
python -m rich.tree
|
| 357 |
+
```
|
| 358 |
+
|
| 359 |
+
This generates the following output:
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
|
| 363 |
+
See the [tree.py](https://github.com/textualize/rich/blob/master/examples/tree.py) example for a script that displays a tree view of any directory, similar to the linux `tree` command.
|
| 364 |
+
|
| 365 |
+
</details>
|
| 366 |
+
|
| 367 |
+
<details>
|
| 368 |
+
<summary>Columns</summary>
|
| 369 |
+
|
| 370 |
+
Rich can render content in neat [columns](https://rich.readthedocs.io/en/latest/columns.html) with equal or optimal width. Here's a very basic clone of the (MacOS / Linux) `ls` command which displays a directory listing in columns:
|
| 371 |
+
|
| 372 |
+
```python
|
| 373 |
+
import os
|
| 374 |
+
import sys
|
| 375 |
+
|
| 376 |
+
from rich import print
|
| 377 |
+
from rich.columns import Columns
|
| 378 |
+
|
| 379 |
+
directory = os.listdir(sys.argv[1])
|
| 380 |
+
print(Columns(directory))
|
| 381 |
+
```
|
| 382 |
+
|
| 383 |
+
The following screenshot is the output from the [columns example](https://github.com/textualize/rich/blob/master/examples/columns.py) which displays data pulled from an API in columns:
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
|
| 387 |
+
</details>
|
| 388 |
+
|
| 389 |
+
<details>
|
| 390 |
+
<summary>Markdown</summary>
|
| 391 |
+
|
| 392 |
+
Rich can render [markdown](https://rich.readthedocs.io/en/latest/markdown.html) and does a reasonable job of translating the formatting to the terminal.
|
| 393 |
+
|
| 394 |
+
To render markdown import the `Markdown` class and construct it with a string containing markdown code. Then print it to the console. Here's an example:
|
| 395 |
+
|
| 396 |
+
```python
|
| 397 |
+
from rich.console import Console
|
| 398 |
+
from rich.markdown import Markdown
|
| 399 |
+
|
| 400 |
+
console = Console()
|
| 401 |
+
with open("README.md") as readme:
|
| 402 |
+
markdown = Markdown(readme.read())
|
| 403 |
+
console.print(markdown)
|
| 404 |
+
```
|
| 405 |
+
|
| 406 |
+
This will produce output something like the following:
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
|
| 410 |
+
</details>
|
| 411 |
+
|
| 412 |
+
<details>
|
| 413 |
+
<summary>Syntax Highlighting</summary>
|
| 414 |
+
|
| 415 |
+
Rich uses the [pygments](https://pygments.org/) library to implement [syntax highlighting](https://rich.readthedocs.io/en/latest/syntax.html). Usage is similar to rendering markdown; construct a `Syntax` object and print it to the console. Here's an example:
|
| 416 |
+
|
| 417 |
+
```python
|
| 418 |
+
from rich.console import Console
|
| 419 |
+
from rich.syntax import Syntax
|
| 420 |
+
|
| 421 |
+
my_code = '''
|
| 422 |
+
def iter_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]:
|
| 423 |
+
"""Iterate and generate a tuple with a flag for first and last value."""
|
| 424 |
+
iter_values = iter(values)
|
| 425 |
+
try:
|
| 426 |
+
previous_value = next(iter_values)
|
| 427 |
+
except StopIteration:
|
| 428 |
+
return
|
| 429 |
+
first = True
|
| 430 |
+
for value in iter_values:
|
| 431 |
+
yield first, False, previous_value
|
| 432 |
+
first = False
|
| 433 |
+
previous_value = value
|
| 434 |
+
yield first, True, previous_value
|
| 435 |
+
'''
|
| 436 |
+
syntax = Syntax(my_code, "python", theme="monokai", line_numbers=True)
|
| 437 |
+
console = Console()
|
| 438 |
+
console.print(syntax)
|
| 439 |
+
```
|
| 440 |
+
|
| 441 |
+
This will produce the following output:
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
|
| 445 |
+
</details>
|
| 446 |
+
|
| 447 |
+
<details>
|
| 448 |
+
<summary>Tracebacks</summary>
|
| 449 |
+
|
| 450 |
+
Rich can render [beautiful tracebacks](https://rich.readthedocs.io/en/latest/traceback.html) which are easier to read and show more code than standard Python tracebacks. You can set Rich as the default traceback handler so all uncaught exceptions will be rendered by Rich.
|
| 451 |
+
|
| 452 |
+
Here's what it looks like on OSX (similar on Linux):
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
|
| 456 |
+
</details>
|
| 457 |
+
|
| 458 |
+
All Rich renderables make use of the [Console Protocol](https://rich.readthedocs.io/en/latest/protocol.html), which you can also use to implement your own Rich content.
|
| 459 |
+
|
| 460 |
+
# Rich CLI
|
| 461 |
+
|
| 462 |
+
|
| 463 |
+
See also [Rich CLI](https://github.com/textualize/rich-cli) for a command line application powered by Rich. Syntax highlight code, render markdown, display CSVs in tables, and more, directly from the command prompt.
|
| 464 |
+
|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
|
| 468 |
+
# Textual
|
| 469 |
+
|
| 470 |
+
See also Rich's sister project, [Textual](https://github.com/Textualize/textual), which you can use to build sophisticated User Interfaces in the terminal.
|
| 471 |
+
|
| 472 |
+

|
| 473 |
+
|
evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/RECORD
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
rich-13.9.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
rich-13.9.4.dist-info/LICENSE,sha256=3u18F6QxgVgZCj6iOcyHmlpQJxzruYrnAl9I--WNyhU,1056
|
| 3 |
+
rich-13.9.4.dist-info/METADATA,sha256=dg29ATErmwW3hqOEbIsmWW2Y4ieh38w98r9l8MfIrGI,18274
|
| 4 |
+
rich-13.9.4.dist-info/RECORD,,
|
| 5 |
+
rich-13.9.4.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
rich-13.9.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
| 7 |
+
rich/__init__.py,sha256=lh2WcoIOJp5M5_lbAsSUMGv8oiJeumROazHH_AYMS8I,6066
|
| 8 |
+
rich/__main__.py,sha256=Wvh53rmOMyWeUeyqUHpn1PXsHlBc4TVcQnqrw46nf9Y,8333
|
| 9 |
+
rich/__pycache__/__init__.cpython-310.pyc,,
|
| 10 |
+
rich/__pycache__/__main__.cpython-310.pyc,,
|
| 11 |
+
rich/__pycache__/_cell_widths.cpython-310.pyc,,
|
| 12 |
+
rich/__pycache__/_emoji_codes.cpython-310.pyc,,
|
| 13 |
+
rich/__pycache__/_emoji_replace.cpython-310.pyc,,
|
| 14 |
+
rich/__pycache__/_export_format.cpython-310.pyc,,
|
| 15 |
+
rich/__pycache__/_extension.cpython-310.pyc,,
|
| 16 |
+
rich/__pycache__/_fileno.cpython-310.pyc,,
|
| 17 |
+
rich/__pycache__/_inspect.cpython-310.pyc,,
|
| 18 |
+
rich/__pycache__/_log_render.cpython-310.pyc,,
|
| 19 |
+
rich/__pycache__/_loop.cpython-310.pyc,,
|
| 20 |
+
rich/__pycache__/_null_file.cpython-310.pyc,,
|
| 21 |
+
rich/__pycache__/_palettes.cpython-310.pyc,,
|
| 22 |
+
rich/__pycache__/_pick.cpython-310.pyc,,
|
| 23 |
+
rich/__pycache__/_ratio.cpython-310.pyc,,
|
| 24 |
+
rich/__pycache__/_spinners.cpython-310.pyc,,
|
| 25 |
+
rich/__pycache__/_stack.cpython-310.pyc,,
|
| 26 |
+
rich/__pycache__/_timer.cpython-310.pyc,,
|
| 27 |
+
rich/__pycache__/_win32_console.cpython-310.pyc,,
|
| 28 |
+
rich/__pycache__/_windows.cpython-310.pyc,,
|
| 29 |
+
rich/__pycache__/_windows_renderer.cpython-310.pyc,,
|
| 30 |
+
rich/__pycache__/_wrap.cpython-310.pyc,,
|
| 31 |
+
rich/__pycache__/abc.cpython-310.pyc,,
|
| 32 |
+
rich/__pycache__/align.cpython-310.pyc,,
|
| 33 |
+
rich/__pycache__/ansi.cpython-310.pyc,,
|
| 34 |
+
rich/__pycache__/bar.cpython-310.pyc,,
|
| 35 |
+
rich/__pycache__/box.cpython-310.pyc,,
|
| 36 |
+
rich/__pycache__/cells.cpython-310.pyc,,
|
| 37 |
+
rich/__pycache__/color.cpython-310.pyc,,
|
| 38 |
+
rich/__pycache__/color_triplet.cpython-310.pyc,,
|
| 39 |
+
rich/__pycache__/columns.cpython-310.pyc,,
|
| 40 |
+
rich/__pycache__/console.cpython-310.pyc,,
|
| 41 |
+
rich/__pycache__/constrain.cpython-310.pyc,,
|
| 42 |
+
rich/__pycache__/containers.cpython-310.pyc,,
|
| 43 |
+
rich/__pycache__/control.cpython-310.pyc,,
|
| 44 |
+
rich/__pycache__/default_styles.cpython-310.pyc,,
|
| 45 |
+
rich/__pycache__/diagnose.cpython-310.pyc,,
|
| 46 |
+
rich/__pycache__/emoji.cpython-310.pyc,,
|
| 47 |
+
rich/__pycache__/errors.cpython-310.pyc,,
|
| 48 |
+
rich/__pycache__/file_proxy.cpython-310.pyc,,
|
| 49 |
+
rich/__pycache__/filesize.cpython-310.pyc,,
|
| 50 |
+
rich/__pycache__/highlighter.cpython-310.pyc,,
|
| 51 |
+
rich/__pycache__/json.cpython-310.pyc,,
|
| 52 |
+
rich/__pycache__/jupyter.cpython-310.pyc,,
|
| 53 |
+
rich/__pycache__/layout.cpython-310.pyc,,
|
| 54 |
+
rich/__pycache__/live.cpython-310.pyc,,
|
| 55 |
+
rich/__pycache__/live_render.cpython-310.pyc,,
|
| 56 |
+
rich/__pycache__/logging.cpython-310.pyc,,
|
| 57 |
+
rich/__pycache__/markdown.cpython-310.pyc,,
|
| 58 |
+
rich/__pycache__/markup.cpython-310.pyc,,
|
| 59 |
+
rich/__pycache__/measure.cpython-310.pyc,,
|
| 60 |
+
rich/__pycache__/padding.cpython-310.pyc,,
|
| 61 |
+
rich/__pycache__/pager.cpython-310.pyc,,
|
| 62 |
+
rich/__pycache__/palette.cpython-310.pyc,,
|
| 63 |
+
rich/__pycache__/panel.cpython-310.pyc,,
|
| 64 |
+
rich/__pycache__/pretty.cpython-310.pyc,,
|
| 65 |
+
rich/__pycache__/progress.cpython-310.pyc,,
|
| 66 |
+
rich/__pycache__/progress_bar.cpython-310.pyc,,
|
| 67 |
+
rich/__pycache__/prompt.cpython-310.pyc,,
|
| 68 |
+
rich/__pycache__/protocol.cpython-310.pyc,,
|
| 69 |
+
rich/__pycache__/region.cpython-310.pyc,,
|
| 70 |
+
rich/__pycache__/repr.cpython-310.pyc,,
|
| 71 |
+
rich/__pycache__/rule.cpython-310.pyc,,
|
| 72 |
+
rich/__pycache__/scope.cpython-310.pyc,,
|
| 73 |
+
rich/__pycache__/screen.cpython-310.pyc,,
|
| 74 |
+
rich/__pycache__/segment.cpython-310.pyc,,
|
| 75 |
+
rich/__pycache__/spinner.cpython-310.pyc,,
|
| 76 |
+
rich/__pycache__/status.cpython-310.pyc,,
|
| 77 |
+
rich/__pycache__/style.cpython-310.pyc,,
|
| 78 |
+
rich/__pycache__/styled.cpython-310.pyc,,
|
| 79 |
+
rich/__pycache__/syntax.cpython-310.pyc,,
|
| 80 |
+
rich/__pycache__/table.cpython-310.pyc,,
|
| 81 |
+
rich/__pycache__/terminal_theme.cpython-310.pyc,,
|
| 82 |
+
rich/__pycache__/text.cpython-310.pyc,,
|
| 83 |
+
rich/__pycache__/theme.cpython-310.pyc,,
|
| 84 |
+
rich/__pycache__/themes.cpython-310.pyc,,
|
| 85 |
+
rich/__pycache__/traceback.cpython-310.pyc,,
|
| 86 |
+
rich/__pycache__/tree.cpython-310.pyc,,
|
| 87 |
+
rich/_cell_widths.py,sha256=fbmeyetEdHjzE_Vx2l1uK7tnPOhMs2X1lJfO3vsKDpA,10209
|
| 88 |
+
rich/_emoji_codes.py,sha256=hu1VL9nbVdppJrVoijVshRlcRRe_v3dju3Mmd2sKZdY,140235
|
| 89 |
+
rich/_emoji_replace.py,sha256=n-kcetsEUx2ZUmhQrfeMNc-teeGhpuSQ5F8VPBsyvDo,1064
|
| 90 |
+
rich/_export_format.py,sha256=RI08pSrm5tBSzPMvnbTqbD9WIalaOoN5d4M1RTmLq1Y,2128
|
| 91 |
+
rich/_extension.py,sha256=G66PkbH_QdTJh6jD-J228O76CmAnr2hLQv72CgPPuzE,241
|
| 92 |
+
rich/_fileno.py,sha256=HWZxP5C2ajMbHryvAQZseflVfQoGzsKOHzKGsLD8ynQ,799
|
| 93 |
+
rich/_inspect.py,sha256=QM05lEFnFoTaFqpnbx-zBEI6k8oIKrD3cvjEOQNhKig,9655
|
| 94 |
+
rich/_log_render.py,sha256=xBKCxqiO4FZk8eG56f8crFdrmJxFrJsQE3V3F-fFekc,3213
|
| 95 |
+
rich/_loop.py,sha256=hV_6CLdoPm0va22Wpw4zKqM0RYsz3TZxXj0PoS-9eDQ,1236
|
| 96 |
+
rich/_null_file.py,sha256=ADGKp1yt-k70FMKV6tnqCqecB-rSJzp-WQsD7LPL-kg,1394
|
| 97 |
+
rich/_palettes.py,sha256=cdev1JQKZ0JvlguV9ipHgznTdnvlIzUFDBb0It2PzjI,7063
|
| 98 |
+
rich/_pick.py,sha256=evDt8QN4lF5CiwrUIXlOJCntitBCOsI3ZLPEIAVRLJU,423
|
| 99 |
+
rich/_ratio.py,sha256=d2k38QnkJKhkHAqqSseqMQ-ZuvgbwnocRKhMQq84EdI,5459
|
| 100 |
+
rich/_spinners.py,sha256=U2r1_g_1zSjsjiUdAESc2iAMc3i4ri_S8PYP6kQ5z1I,19919
|
| 101 |
+
rich/_stack.py,sha256=-C8OK7rxn3sIUdVwxZBBpeHhIzX0eI-VM3MemYfaXm0,351
|
| 102 |
+
rich/_timer.py,sha256=zelxbT6oPFZnNrwWPpc1ktUeAT-Vc4fuFcRZLQGLtMI,417
|
| 103 |
+
rich/_win32_console.py,sha256=o2QN_IRx10biGP3Ap1neaqX8FBGlUKSmWM6Kw4OSg-U,22719
|
| 104 |
+
rich/_windows.py,sha256=is3WpbHMj8WaTHYB11hc6lP2t4hlvt4TViTlHSmjsi0,1901
|
| 105 |
+
rich/_windows_renderer.py,sha256=d799xOnxLbCCCzGu9-U7YLmIQkxtxQIBFQQ6iu4veSc,2759
|
| 106 |
+
rich/_wrap.py,sha256=FlSsom5EX0LVkA3KWy34yHnCfLtqX-ZIepXKh-70rpc,3404
|
| 107 |
+
rich/abc.py,sha256=dALMOGfKVNeAbvqq66IpTQxQUerxD7AE4FKwqd0eQKk,878
|
| 108 |
+
rich/align.py,sha256=gxlfgvi4ah8ERmg8RpGFtWY1Z4WBuWm-6qSIUSFx4bQ,10421
|
| 109 |
+
rich/ansi.py,sha256=Avs1LHbSdcyOvDOdpELZUoULcBiYewY76eNBp6uFBhs,6921
|
| 110 |
+
rich/bar.py,sha256=ldbVHOzKJOnflVNuv1xS7g6dLX2E3wMnXkdPbpzJTcs,3263
|
| 111 |
+
rich/box.py,sha256=46rA0eBKLBcqNhCXmEKS4pN1dz36F0Vzi52hyVT-tyc,10783
|
| 112 |
+
rich/cells.py,sha256=KrQkj5-LghCCpJLSNQIyAZjndc4bnEqOEmi5YuZ9UCY,5130
|
| 113 |
+
rich/color.py,sha256=3HSULVDj7qQkXUdFWv78JOiSZzfy5y1nkcYhna296V0,18211
|
| 114 |
+
rich/color_triplet.py,sha256=3lhQkdJbvWPoLDO-AnYImAWmJvV5dlgYNCVZ97ORaN4,1054
|
| 115 |
+
rich/columns.py,sha256=HUX0KcMm9dsKNi11fTbiM_h2iDtl8ySCaVcxlalEzq8,7131
|
| 116 |
+
rich/console.py,sha256=zgSwvRDPiDXh6wQ_kbnNSxff-s7uuljVmaTeoYPyh6E,100084
|
| 117 |
+
rich/constrain.py,sha256=1VIPuC8AgtKWrcncQrjBdYqA3JVWysu6jZo1rrh7c7Q,1288
|
| 118 |
+
rich/containers.py,sha256=c_56TxcedGYqDepHBMTuZdUIijitAQgnox-Qde0Z1qo,5502
|
| 119 |
+
rich/control.py,sha256=Ix-rO8ZhSB2q1Biazr4l72ZyAw27H9or7ElipWVVo0M,6606
|
| 120 |
+
rich/default_styles.py,sha256=gY-aX6rUxxlxdOOt5CqxnltpFDQqqqdHuXwAy2OD1o8,8123
|
| 121 |
+
rich/diagnose.py,sha256=ZopD2EpWVtmmKptgbXT-sOMkAJ7DGrMSUXUiaU2GZ78,924
|
| 122 |
+
rich/emoji.py,sha256=1jTRHFwvQxY1ciul22MdEZcWc7brfjKT8FG6ZjXj5dM,2465
|
| 123 |
+
rich/errors.py,sha256=5pP3Kc5d4QJ_c0KFsxrfyhjiPVe7J1zOqSFbFAzcV-Y,642
|
| 124 |
+
rich/file_proxy.py,sha256=Tl9THMDZ-Pk5Wm8sI1gGg_U5DhusmxD-FZ0fUbcU0W0,1683
|
| 125 |
+
rich/filesize.py,sha256=_iz9lIpRgvW7MNSeCZnLg-HwzbP4GETg543WqD8SFs0,2484
|
| 126 |
+
rich/highlighter.py,sha256=G_sn-8DKjM1sEjLG_oc4ovkWmiUpWvj8bXi0yed2LnY,9586
|
| 127 |
+
rich/json.py,sha256=omC2WHTgURxEosna1ftoSJCne2EX7MDuQtCdswS3qsk,5019
|
| 128 |
+
rich/jupyter.py,sha256=G9pOJmR4ESIFYSd4MKGqmHqCtstx0oRWpyeTgv54-Xc,3228
|
| 129 |
+
rich/layout.py,sha256=WR8PCSroYnteIT3zawxQ3k3ad1sQO5wGG1SZOoeBuBM,13944
|
| 130 |
+
rich/live.py,sha256=DhzAPEnjTxQuq9_0Y2xh2MUwQcP_aGPkenLfKETslwM,14270
|
| 131 |
+
rich/live_render.py,sha256=QaiB8dtGikCdssoXpkEmmiH55fxT-9bzLkBO9pbBvrU,3654
|
| 132 |
+
rich/logging.py,sha256=aqZpsmIEE45-wbnZqWnEaNSdQ89cbGcaL26-ZV0poj0,12446
|
| 133 |
+
rich/markdown.py,sha256=eDi7dMN7RQD5u21tuqCOSpNWGZdKmyGtKmaZNt257rA,25969
|
| 134 |
+
rich/markup.py,sha256=btpr271BLhiCR1jNglRnv2BpIzVcNefYwSMeW9teDbc,8427
|
| 135 |
+
rich/measure.py,sha256=HmrIJX8sWRTHbgh8MxEay_83VkqNW_70s8aKP5ZcYI8,5305
|
| 136 |
+
rich/padding.py,sha256=h8XnIivLrNtlxI3vQPKHXh4hAwjOJqZx0slM0z3g1_M,4896
|
| 137 |
+
rich/pager.py,sha256=SO_ETBFKbg3n_AgOzXm41Sv36YxXAyI3_R-KOY2_uSc,828
|
| 138 |
+
rich/palette.py,sha256=Ar6ZUrYHiFt6-Rr2k-k9F8V7hxgJYHNdqjk2vVXsLgc,3288
|
| 139 |
+
rich/panel.py,sha256=fFRHcviXvWhk3V3zx5Zwmsb_RL9KJ3esD-sU0NYEVyw,11235
|
| 140 |
+
rich/pretty.py,sha256=eQs437AksYaCB2qO_d-z6e0DF_t5F1KfXfa1Hi-Ya0E,36355
|
| 141 |
+
rich/progress.py,sha256=tLmBGHrAfxIQxfB2kq1IpNXTVFNuvl9bXd_QkLQUN8Q,60333
|
| 142 |
+
rich/progress_bar.py,sha256=mZTPpJUwcfcdgQCTTz3kyY-fc79ddLwtx6Ghhxfo064,8162
|
| 143 |
+
rich/prompt.py,sha256=k0CUIW-3I55jGk8U3O1WiEhdF6yXa2EiWeRqRhuJXWA,12435
|
| 144 |
+
rich/protocol.py,sha256=Wt-2HZd67OYiopUkCTOz7lM38vyo5r3HEQZ9TOPDl5Q,1367
|
| 145 |
+
rich/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 146 |
+
rich/region.py,sha256=rNT9xZrVZTYIXZC0NYn41CJQwYNbR-KecPOxTgQvB8Y,166
|
| 147 |
+
rich/repr.py,sha256=HIsurPLZK9Gray75l3_vQx7S27AzTpAj4ChXSfe1Fes,4419
|
| 148 |
+
rich/rule.py,sha256=umO21Wjw0FcYAeTB3UumNLCsDWhejzxnjlf2VwiXiDI,4590
|
| 149 |
+
rich/scope.py,sha256=lf6Qet_e4JOY34lwhYSAG-NBXYKBcYu6t_igv_JoGog,2831
|
| 150 |
+
rich/screen.py,sha256=rL_j2wX-4SeuIOI2oOlc418QP9EAvD59GInUmEAE6jQ,1579
|
| 151 |
+
rich/segment.py,sha256=7gOdwSPrzu0a2gRmxBDtu3u2S8iG5s9l7wlB58dKMy0,24707
|
| 152 |
+
rich/spinner.py,sha256=PT5qgXPG3ZpqRj7n3EZQ6NW56mx3ldZqZCU7gEMyZk4,4364
|
| 153 |
+
rich/status.py,sha256=kkPph3YeAZBo-X-4wPp8gTqZyU466NLwZBA4PZTTewo,4424
|
| 154 |
+
rich/style.py,sha256=aSoUNbVgfP1PAnduAqgbbl4AMQy668qs2S1FEwr3Oqs,27067
|
| 155 |
+
rich/styled.py,sha256=wljVsVTXbABMMZvkzkO43ZEk_-irzEtvUiQ-sNnikQ8,1234
|
| 156 |
+
rich/syntax.py,sha256=NY1DRIqXBkFExudqxm5K3BJXFCttN63AF_3IZAvtLMg,35655
|
| 157 |
+
rich/table.py,sha256=RX26U8oHV0s1U-gl6WqylfesmOT2qt7VVtMtC18-Pk0,40067
|
| 158 |
+
rich/terminal_theme.py,sha256=1j5-ufJfnvlAo5Qsi_ACZiXDmwMXzqgmFByObT9-yJY,3370
|
| 159 |
+
rich/text.py,sha256=v-vCOG8gS_D5QDhOhU19478-yEJGAXKVi8iYCCk7O_M,47540
|
| 160 |
+
rich/theme.py,sha256=oNyhXhGagtDlbDye3tVu3esWOWk0vNkuxFw-_unlaK0,3771
|
| 161 |
+
rich/themes.py,sha256=0xgTLozfabebYtcJtDdC5QkX5IVUEaviqDUJJh4YVFk,102
|
| 162 |
+
rich/traceback.py,sha256=hCLOig4Uwtc7f0FqseEkFZ8YUwzvGOli8BOG517mipg,31725
|
| 163 |
+
rich/tree.py,sha256=QoOwg424FkdwGfR8K0tZ6Q7qtzWNAUP_m4sFaYuG6nw,9391
|
evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/REQUESTED
ADDED
|
File without changes
|
evalkit_cambrian/lib/python3.10/site-packages/rich-13.9.4.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: poetry-core 1.9.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
evalkit_cambrian/lib/python3.10/site-packages/rich/columns.py
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from collections import defaultdict
|
| 2 |
+
from itertools import chain
|
| 3 |
+
from operator import itemgetter
|
| 4 |
+
from typing import Dict, Iterable, List, Optional, Tuple
|
| 5 |
+
|
| 6 |
+
from .align import Align, AlignMethod
|
| 7 |
+
from .console import Console, ConsoleOptions, RenderableType, RenderResult
|
| 8 |
+
from .constrain import Constrain
|
| 9 |
+
from .measure import Measurement
|
| 10 |
+
from .padding import Padding, PaddingDimensions
|
| 11 |
+
from .table import Table
|
| 12 |
+
from .text import TextType
|
| 13 |
+
from .jupyter import JupyterMixin
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class Columns(JupyterMixin):
|
| 17 |
+
"""Display renderables in neat columns.
|
| 18 |
+
|
| 19 |
+
Args:
|
| 20 |
+
renderables (Iterable[RenderableType]): Any number of Rich renderables (including str).
|
| 21 |
+
width (int, optional): The desired width of the columns, or None to auto detect. Defaults to None.
|
| 22 |
+
padding (PaddingDimensions, optional): Optional padding around cells. Defaults to (0, 1).
|
| 23 |
+
expand (bool, optional): Expand columns to full width. Defaults to False.
|
| 24 |
+
equal (bool, optional): Arrange in to equal sized columns. Defaults to False.
|
| 25 |
+
column_first (bool, optional): Align items from top to bottom (rather than left to right). Defaults to False.
|
| 26 |
+
right_to_left (bool, optional): Start column from right hand side. Defaults to False.
|
| 27 |
+
align (str, optional): Align value ("left", "right", or "center") or None for default. Defaults to None.
|
| 28 |
+
title (TextType, optional): Optional title for Columns.
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
def __init__(
|
| 32 |
+
self,
|
| 33 |
+
renderables: Optional[Iterable[RenderableType]] = None,
|
| 34 |
+
padding: PaddingDimensions = (0, 1),
|
| 35 |
+
*,
|
| 36 |
+
width: Optional[int] = None,
|
| 37 |
+
expand: bool = False,
|
| 38 |
+
equal: bool = False,
|
| 39 |
+
column_first: bool = False,
|
| 40 |
+
right_to_left: bool = False,
|
| 41 |
+
align: Optional[AlignMethod] = None,
|
| 42 |
+
title: Optional[TextType] = None,
|
| 43 |
+
) -> None:
|
| 44 |
+
self.renderables = list(renderables or [])
|
| 45 |
+
self.width = width
|
| 46 |
+
self.padding = padding
|
| 47 |
+
self.expand = expand
|
| 48 |
+
self.equal = equal
|
| 49 |
+
self.column_first = column_first
|
| 50 |
+
self.right_to_left = right_to_left
|
| 51 |
+
self.align: Optional[AlignMethod] = align
|
| 52 |
+
self.title = title
|
| 53 |
+
|
| 54 |
+
def add_renderable(self, renderable: RenderableType) -> None:
|
| 55 |
+
"""Add a renderable to the columns.
|
| 56 |
+
|
| 57 |
+
Args:
|
| 58 |
+
renderable (RenderableType): Any renderable object.
|
| 59 |
+
"""
|
| 60 |
+
self.renderables.append(renderable)
|
| 61 |
+
|
| 62 |
+
def __rich_console__(
|
| 63 |
+
self, console: Console, options: ConsoleOptions
|
| 64 |
+
) -> RenderResult:
|
| 65 |
+
render_str = console.render_str
|
| 66 |
+
renderables = [
|
| 67 |
+
render_str(renderable) if isinstance(renderable, str) else renderable
|
| 68 |
+
for renderable in self.renderables
|
| 69 |
+
]
|
| 70 |
+
if not renderables:
|
| 71 |
+
return
|
| 72 |
+
_top, right, _bottom, left = Padding.unpack(self.padding)
|
| 73 |
+
width_padding = max(left, right)
|
| 74 |
+
max_width = options.max_width
|
| 75 |
+
widths: Dict[int, int] = defaultdict(int)
|
| 76 |
+
column_count = len(renderables)
|
| 77 |
+
|
| 78 |
+
get_measurement = Measurement.get
|
| 79 |
+
renderable_widths = [
|
| 80 |
+
get_measurement(console, options, renderable).maximum
|
| 81 |
+
for renderable in renderables
|
| 82 |
+
]
|
| 83 |
+
if self.equal:
|
| 84 |
+
renderable_widths = [max(renderable_widths)] * len(renderable_widths)
|
| 85 |
+
|
| 86 |
+
def iter_renderables(
|
| 87 |
+
column_count: int,
|
| 88 |
+
) -> Iterable[Tuple[int, Optional[RenderableType]]]:
|
| 89 |
+
item_count = len(renderables)
|
| 90 |
+
if self.column_first:
|
| 91 |
+
width_renderables = list(zip(renderable_widths, renderables))
|
| 92 |
+
|
| 93 |
+
column_lengths: List[int] = [item_count // column_count] * column_count
|
| 94 |
+
for col_no in range(item_count % column_count):
|
| 95 |
+
column_lengths[col_no] += 1
|
| 96 |
+
|
| 97 |
+
row_count = (item_count + column_count - 1) // column_count
|
| 98 |
+
cells = [[-1] * column_count for _ in range(row_count)]
|
| 99 |
+
row = col = 0
|
| 100 |
+
for index in range(item_count):
|
| 101 |
+
cells[row][col] = index
|
| 102 |
+
column_lengths[col] -= 1
|
| 103 |
+
if column_lengths[col]:
|
| 104 |
+
row += 1
|
| 105 |
+
else:
|
| 106 |
+
col += 1
|
| 107 |
+
row = 0
|
| 108 |
+
for index in chain.from_iterable(cells):
|
| 109 |
+
if index == -1:
|
| 110 |
+
break
|
| 111 |
+
yield width_renderables[index]
|
| 112 |
+
else:
|
| 113 |
+
yield from zip(renderable_widths, renderables)
|
| 114 |
+
# Pad odd elements with spaces
|
| 115 |
+
if item_count % column_count:
|
| 116 |
+
for _ in range(column_count - (item_count % column_count)):
|
| 117 |
+
yield 0, None
|
| 118 |
+
|
| 119 |
+
table = Table.grid(padding=self.padding, collapse_padding=True, pad_edge=False)
|
| 120 |
+
table.expand = self.expand
|
| 121 |
+
table.title = self.title
|
| 122 |
+
|
| 123 |
+
if self.width is not None:
|
| 124 |
+
column_count = (max_width) // (self.width + width_padding)
|
| 125 |
+
for _ in range(column_count):
|
| 126 |
+
table.add_column(width=self.width)
|
| 127 |
+
else:
|
| 128 |
+
while column_count > 1:
|
| 129 |
+
widths.clear()
|
| 130 |
+
column_no = 0
|
| 131 |
+
for renderable_width, _ in iter_renderables(column_count):
|
| 132 |
+
widths[column_no] = max(widths[column_no], renderable_width)
|
| 133 |
+
total_width = sum(widths.values()) + width_padding * (
|
| 134 |
+
len(widths) - 1
|
| 135 |
+
)
|
| 136 |
+
if total_width > max_width:
|
| 137 |
+
column_count = len(widths) - 1
|
| 138 |
+
break
|
| 139 |
+
else:
|
| 140 |
+
column_no = (column_no + 1) % column_count
|
| 141 |
+
else:
|
| 142 |
+
break
|
| 143 |
+
|
| 144 |
+
get_renderable = itemgetter(1)
|
| 145 |
+
_renderables = [
|
| 146 |
+
get_renderable(_renderable)
|
| 147 |
+
for _renderable in iter_renderables(column_count)
|
| 148 |
+
]
|
| 149 |
+
if self.equal:
|
| 150 |
+
_renderables = [
|
| 151 |
+
None
|
| 152 |
+
if renderable is None
|
| 153 |
+
else Constrain(renderable, renderable_widths[0])
|
| 154 |
+
for renderable in _renderables
|
| 155 |
+
]
|
| 156 |
+
if self.align:
|
| 157 |
+
align = self.align
|
| 158 |
+
_Align = Align
|
| 159 |
+
_renderables = [
|
| 160 |
+
None if renderable is None else _Align(renderable, align)
|
| 161 |
+
for renderable in _renderables
|
| 162 |
+
]
|
| 163 |
+
|
| 164 |
+
right_to_left = self.right_to_left
|
| 165 |
+
add_row = table.add_row
|
| 166 |
+
for start in range(0, len(_renderables), column_count):
|
| 167 |
+
row = _renderables[start : start + column_count]
|
| 168 |
+
if right_to_left:
|
| 169 |
+
row = row[::-1]
|
| 170 |
+
add_row(*row)
|
| 171 |
+
yield table
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
if __name__ == "__main__": # pragma: no cover
|
| 175 |
+
import os
|
| 176 |
+
|
| 177 |
+
console = Console()
|
| 178 |
+
|
| 179 |
+
files = [f"{i} {s}" for i, s in enumerate(sorted(os.listdir()))]
|
| 180 |
+
columns = Columns(files, padding=(0, 1), expand=False, equal=False)
|
| 181 |
+
console.print(columns)
|
| 182 |
+
console.rule()
|
| 183 |
+
columns.column_first = True
|
| 184 |
+
console.print(columns)
|
| 185 |
+
columns.right_to_left = True
|
| 186 |
+
console.rule()
|
| 187 |
+
console.print(columns)
|
evalkit_cambrian/lib/python3.10/site-packages/rich/file_proxy.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import io
|
| 2 |
+
from typing import IO, TYPE_CHECKING, Any, List
|
| 3 |
+
|
| 4 |
+
from .ansi import AnsiDecoder
|
| 5 |
+
from .text import Text
|
| 6 |
+
|
| 7 |
+
if TYPE_CHECKING:
|
| 8 |
+
from .console import Console
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class FileProxy(io.TextIOBase):
|
| 12 |
+
"""Wraps a file (e.g. sys.stdout) and redirects writes to a console."""
|
| 13 |
+
|
| 14 |
+
def __init__(self, console: "Console", file: IO[str]) -> None:
|
| 15 |
+
self.__console = console
|
| 16 |
+
self.__file = file
|
| 17 |
+
self.__buffer: List[str] = []
|
| 18 |
+
self.__ansi_decoder = AnsiDecoder()
|
| 19 |
+
|
| 20 |
+
@property
|
| 21 |
+
def rich_proxied_file(self) -> IO[str]:
|
| 22 |
+
"""Get proxied file."""
|
| 23 |
+
return self.__file
|
| 24 |
+
|
| 25 |
+
def __getattr__(self, name: str) -> Any:
|
| 26 |
+
return getattr(self.__file, name)
|
| 27 |
+
|
| 28 |
+
def write(self, text: str) -> int:
|
| 29 |
+
if not isinstance(text, str):
|
| 30 |
+
raise TypeError(f"write() argument must be str, not {type(text).__name__}")
|
| 31 |
+
buffer = self.__buffer
|
| 32 |
+
lines: List[str] = []
|
| 33 |
+
while text:
|
| 34 |
+
line, new_line, text = text.partition("\n")
|
| 35 |
+
if new_line:
|
| 36 |
+
lines.append("".join(buffer) + line)
|
| 37 |
+
buffer.clear()
|
| 38 |
+
else:
|
| 39 |
+
buffer.append(line)
|
| 40 |
+
break
|
| 41 |
+
if lines:
|
| 42 |
+
console = self.__console
|
| 43 |
+
with console:
|
| 44 |
+
output = Text("\n").join(
|
| 45 |
+
self.__ansi_decoder.decode_line(line) for line in lines
|
| 46 |
+
)
|
| 47 |
+
console.print(output)
|
| 48 |
+
return len(text)
|
| 49 |
+
|
| 50 |
+
def flush(self) -> None:
|
| 51 |
+
output = "".join(self.__buffer)
|
| 52 |
+
if output:
|
| 53 |
+
self.__console.print(output)
|
| 54 |
+
del self.__buffer[:]
|
| 55 |
+
|
| 56 |
+
def fileno(self) -> int:
|
| 57 |
+
return self.__file.fileno()
|
evalkit_cambrian/lib/python3.10/site-packages/rich/live.py
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from threading import Event, RLock, Thread
|
| 3 |
+
from types import TracebackType
|
| 4 |
+
from typing import IO, Any, Callable, List, Optional, TextIO, Type, cast
|
| 5 |
+
|
| 6 |
+
from . import get_console
|
| 7 |
+
from .console import Console, ConsoleRenderable, RenderableType, RenderHook
|
| 8 |
+
from .control import Control
|
| 9 |
+
from .file_proxy import FileProxy
|
| 10 |
+
from .jupyter import JupyterMixin
|
| 11 |
+
from .live_render import LiveRender, VerticalOverflowMethod
|
| 12 |
+
from .screen import Screen
|
| 13 |
+
from .text import Text
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class _RefreshThread(Thread):
|
| 17 |
+
"""A thread that calls refresh() at regular intervals."""
|
| 18 |
+
|
| 19 |
+
def __init__(self, live: "Live", refresh_per_second: float) -> None:
|
| 20 |
+
self.live = live
|
| 21 |
+
self.refresh_per_second = refresh_per_second
|
| 22 |
+
self.done = Event()
|
| 23 |
+
super().__init__(daemon=True)
|
| 24 |
+
|
| 25 |
+
def stop(self) -> None:
|
| 26 |
+
self.done.set()
|
| 27 |
+
|
| 28 |
+
def run(self) -> None:
|
| 29 |
+
while not self.done.wait(1 / self.refresh_per_second):
|
| 30 |
+
with self.live._lock:
|
| 31 |
+
if not self.done.is_set():
|
| 32 |
+
self.live.refresh()
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class Live(JupyterMixin, RenderHook):
|
| 36 |
+
"""Renders an auto-updating live display of any given renderable.
|
| 37 |
+
|
| 38 |
+
Args:
|
| 39 |
+
renderable (RenderableType, optional): The renderable to live display. Defaults to displaying nothing.
|
| 40 |
+
console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout.
|
| 41 |
+
screen (bool, optional): Enable alternate screen mode. Defaults to False.
|
| 42 |
+
auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()` or `update()` with refresh flag. Defaults to True
|
| 43 |
+
refresh_per_second (float, optional): Number of times per second to refresh the live display. Defaults to 4.
|
| 44 |
+
transient (bool, optional): Clear the renderable on exit (has no effect when screen=True). Defaults to False.
|
| 45 |
+
redirect_stdout (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True.
|
| 46 |
+
redirect_stderr (bool, optional): Enable redirection of stderr. Defaults to True.
|
| 47 |
+
vertical_overflow (VerticalOverflowMethod, optional): How to handle renderable when it is too tall for the console. Defaults to "ellipsis".
|
| 48 |
+
get_renderable (Callable[[], RenderableType], optional): Optional callable to get renderable. Defaults to None.
|
| 49 |
+
"""
|
| 50 |
+
|
| 51 |
+
def __init__(
|
| 52 |
+
self,
|
| 53 |
+
renderable: Optional[RenderableType] = None,
|
| 54 |
+
*,
|
| 55 |
+
console: Optional[Console] = None,
|
| 56 |
+
screen: bool = False,
|
| 57 |
+
auto_refresh: bool = True,
|
| 58 |
+
refresh_per_second: float = 4,
|
| 59 |
+
transient: bool = False,
|
| 60 |
+
redirect_stdout: bool = True,
|
| 61 |
+
redirect_stderr: bool = True,
|
| 62 |
+
vertical_overflow: VerticalOverflowMethod = "ellipsis",
|
| 63 |
+
get_renderable: Optional[Callable[[], RenderableType]] = None,
|
| 64 |
+
) -> None:
|
| 65 |
+
assert refresh_per_second > 0, "refresh_per_second must be > 0"
|
| 66 |
+
self._renderable = renderable
|
| 67 |
+
self.console = console if console is not None else get_console()
|
| 68 |
+
self._screen = screen
|
| 69 |
+
self._alt_screen = False
|
| 70 |
+
|
| 71 |
+
self._redirect_stdout = redirect_stdout
|
| 72 |
+
self._redirect_stderr = redirect_stderr
|
| 73 |
+
self._restore_stdout: Optional[IO[str]] = None
|
| 74 |
+
self._restore_stderr: Optional[IO[str]] = None
|
| 75 |
+
|
| 76 |
+
self._lock = RLock()
|
| 77 |
+
self.ipy_widget: Optional[Any] = None
|
| 78 |
+
self.auto_refresh = auto_refresh
|
| 79 |
+
self._started: bool = False
|
| 80 |
+
self.transient = True if screen else transient
|
| 81 |
+
|
| 82 |
+
self._refresh_thread: Optional[_RefreshThread] = None
|
| 83 |
+
self.refresh_per_second = refresh_per_second
|
| 84 |
+
|
| 85 |
+
self.vertical_overflow = vertical_overflow
|
| 86 |
+
self._get_renderable = get_renderable
|
| 87 |
+
self._live_render = LiveRender(
|
| 88 |
+
self.get_renderable(), vertical_overflow=vertical_overflow
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
@property
|
| 92 |
+
def is_started(self) -> bool:
|
| 93 |
+
"""Check if live display has been started."""
|
| 94 |
+
return self._started
|
| 95 |
+
|
| 96 |
+
def get_renderable(self) -> RenderableType:
|
| 97 |
+
renderable = (
|
| 98 |
+
self._get_renderable()
|
| 99 |
+
if self._get_renderable is not None
|
| 100 |
+
else self._renderable
|
| 101 |
+
)
|
| 102 |
+
return renderable or ""
|
| 103 |
+
|
| 104 |
+
def start(self, refresh: bool = False) -> None:
|
| 105 |
+
"""Start live rendering display.
|
| 106 |
+
|
| 107 |
+
Args:
|
| 108 |
+
refresh (bool, optional): Also refresh. Defaults to False.
|
| 109 |
+
"""
|
| 110 |
+
with self._lock:
|
| 111 |
+
if self._started:
|
| 112 |
+
return
|
| 113 |
+
self.console.set_live(self)
|
| 114 |
+
self._started = True
|
| 115 |
+
if self._screen:
|
| 116 |
+
self._alt_screen = self.console.set_alt_screen(True)
|
| 117 |
+
self.console.show_cursor(False)
|
| 118 |
+
self._enable_redirect_io()
|
| 119 |
+
self.console.push_render_hook(self)
|
| 120 |
+
if refresh:
|
| 121 |
+
try:
|
| 122 |
+
self.refresh()
|
| 123 |
+
except Exception:
|
| 124 |
+
# If refresh fails, we want to stop the redirection of sys.stderr,
|
| 125 |
+
# so the error stacktrace is properly displayed in the terminal.
|
| 126 |
+
# (or, if the code that calls Rich captures the exception and wants to display something,
|
| 127 |
+
# let this be displayed in the terminal).
|
| 128 |
+
self.stop()
|
| 129 |
+
raise
|
| 130 |
+
if self.auto_refresh:
|
| 131 |
+
self._refresh_thread = _RefreshThread(self, self.refresh_per_second)
|
| 132 |
+
self._refresh_thread.start()
|
| 133 |
+
|
| 134 |
+
def stop(self) -> None:
|
| 135 |
+
"""Stop live rendering display."""
|
| 136 |
+
with self._lock:
|
| 137 |
+
if not self._started:
|
| 138 |
+
return
|
| 139 |
+
self.console.clear_live()
|
| 140 |
+
self._started = False
|
| 141 |
+
|
| 142 |
+
if self.auto_refresh and self._refresh_thread is not None:
|
| 143 |
+
self._refresh_thread.stop()
|
| 144 |
+
self._refresh_thread = None
|
| 145 |
+
# allow it to fully render on the last even if overflow
|
| 146 |
+
self.vertical_overflow = "visible"
|
| 147 |
+
with self.console:
|
| 148 |
+
try:
|
| 149 |
+
if not self._alt_screen and not self.console.is_jupyter:
|
| 150 |
+
self.refresh()
|
| 151 |
+
finally:
|
| 152 |
+
self._disable_redirect_io()
|
| 153 |
+
self.console.pop_render_hook()
|
| 154 |
+
if not self._alt_screen and self.console.is_terminal:
|
| 155 |
+
self.console.line()
|
| 156 |
+
self.console.show_cursor(True)
|
| 157 |
+
if self._alt_screen:
|
| 158 |
+
self.console.set_alt_screen(False)
|
| 159 |
+
|
| 160 |
+
if self.transient and not self._alt_screen:
|
| 161 |
+
self.console.control(self._live_render.restore_cursor())
|
| 162 |
+
if self.ipy_widget is not None and self.transient:
|
| 163 |
+
self.ipy_widget.close() # pragma: no cover
|
| 164 |
+
|
| 165 |
+
def __enter__(self) -> "Live":
|
| 166 |
+
self.start(refresh=self._renderable is not None)
|
| 167 |
+
return self
|
| 168 |
+
|
| 169 |
+
def __exit__(
|
| 170 |
+
self,
|
| 171 |
+
exc_type: Optional[Type[BaseException]],
|
| 172 |
+
exc_val: Optional[BaseException],
|
| 173 |
+
exc_tb: Optional[TracebackType],
|
| 174 |
+
) -> None:
|
| 175 |
+
self.stop()
|
| 176 |
+
|
| 177 |
+
def _enable_redirect_io(self) -> None:
|
| 178 |
+
"""Enable redirecting of stdout / stderr."""
|
| 179 |
+
if self.console.is_terminal or self.console.is_jupyter:
|
| 180 |
+
if self._redirect_stdout and not isinstance(sys.stdout, FileProxy):
|
| 181 |
+
self._restore_stdout = sys.stdout
|
| 182 |
+
sys.stdout = cast("TextIO", FileProxy(self.console, sys.stdout))
|
| 183 |
+
if self._redirect_stderr and not isinstance(sys.stderr, FileProxy):
|
| 184 |
+
self._restore_stderr = sys.stderr
|
| 185 |
+
sys.stderr = cast("TextIO", FileProxy(self.console, sys.stderr))
|
| 186 |
+
|
| 187 |
+
def _disable_redirect_io(self) -> None:
|
| 188 |
+
"""Disable redirecting of stdout / stderr."""
|
| 189 |
+
if self._restore_stdout:
|
| 190 |
+
sys.stdout = cast("TextIO", self._restore_stdout)
|
| 191 |
+
self._restore_stdout = None
|
| 192 |
+
if self._restore_stderr:
|
| 193 |
+
sys.stderr = cast("TextIO", self._restore_stderr)
|
| 194 |
+
self._restore_stderr = None
|
| 195 |
+
|
| 196 |
+
@property
|
| 197 |
+
def renderable(self) -> RenderableType:
|
| 198 |
+
"""Get the renderable that is being displayed
|
| 199 |
+
|
| 200 |
+
Returns:
|
| 201 |
+
RenderableType: Displayed renderable.
|
| 202 |
+
"""
|
| 203 |
+
renderable = self.get_renderable()
|
| 204 |
+
return Screen(renderable) if self._alt_screen else renderable
|
| 205 |
+
|
| 206 |
+
def update(self, renderable: RenderableType, *, refresh: bool = False) -> None:
|
| 207 |
+
"""Update the renderable that is being displayed
|
| 208 |
+
|
| 209 |
+
Args:
|
| 210 |
+
renderable (RenderableType): New renderable to use.
|
| 211 |
+
refresh (bool, optional): Refresh the display. Defaults to False.
|
| 212 |
+
"""
|
| 213 |
+
if isinstance(renderable, str):
|
| 214 |
+
renderable = self.console.render_str(renderable)
|
| 215 |
+
with self._lock:
|
| 216 |
+
self._renderable = renderable
|
| 217 |
+
if refresh:
|
| 218 |
+
self.refresh()
|
| 219 |
+
|
| 220 |
+
def refresh(self) -> None:
|
| 221 |
+
"""Update the display of the Live Render."""
|
| 222 |
+
with self._lock:
|
| 223 |
+
self._live_render.set_renderable(self.renderable)
|
| 224 |
+
if self.console.is_jupyter: # pragma: no cover
|
| 225 |
+
try:
|
| 226 |
+
from IPython.display import display
|
| 227 |
+
from ipywidgets import Output
|
| 228 |
+
except ImportError:
|
| 229 |
+
import warnings
|
| 230 |
+
|
| 231 |
+
warnings.warn('install "ipywidgets" for Jupyter support')
|
| 232 |
+
else:
|
| 233 |
+
if self.ipy_widget is None:
|
| 234 |
+
self.ipy_widget = Output()
|
| 235 |
+
display(self.ipy_widget)
|
| 236 |
+
|
| 237 |
+
with self.ipy_widget:
|
| 238 |
+
self.ipy_widget.clear_output(wait=True)
|
| 239 |
+
self.console.print(self._live_render.renderable)
|
| 240 |
+
elif self.console.is_terminal and not self.console.is_dumb_terminal:
|
| 241 |
+
with self.console:
|
| 242 |
+
self.console.print(Control())
|
| 243 |
+
elif (
|
| 244 |
+
not self._started and not self.transient
|
| 245 |
+
): # if it is finished allow files or dumb-terminals to see final result
|
| 246 |
+
with self.console:
|
| 247 |
+
self.console.print(Control())
|
| 248 |
+
|
| 249 |
+
def process_renderables(
|
| 250 |
+
self, renderables: List[ConsoleRenderable]
|
| 251 |
+
) -> List[ConsoleRenderable]:
|
| 252 |
+
"""Process renderables to restore cursor and display progress."""
|
| 253 |
+
self._live_render.vertical_overflow = self.vertical_overflow
|
| 254 |
+
if self.console.is_interactive:
|
| 255 |
+
# lock needs acquiring as user can modify live_render renderable at any time unlike in Progress.
|
| 256 |
+
with self._lock:
|
| 257 |
+
reset = (
|
| 258 |
+
Control.home()
|
| 259 |
+
if self._alt_screen
|
| 260 |
+
else self._live_render.position_cursor()
|
| 261 |
+
)
|
| 262 |
+
renderables = [reset, *renderables, self._live_render]
|
| 263 |
+
elif (
|
| 264 |
+
not self._started and not self.transient
|
| 265 |
+
): # if it is finished render the final output for files or dumb_terminals
|
| 266 |
+
renderables = [*renderables, self._live_render]
|
| 267 |
+
|
| 268 |
+
return renderables
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
if __name__ == "__main__": # pragma: no cover
|
| 272 |
+
import random
|
| 273 |
+
import time
|
| 274 |
+
from itertools import cycle
|
| 275 |
+
from typing import Dict, List, Tuple
|
| 276 |
+
|
| 277 |
+
from .align import Align
|
| 278 |
+
from .console import Console
|
| 279 |
+
from .live import Live as Live
|
| 280 |
+
from .panel import Panel
|
| 281 |
+
from .rule import Rule
|
| 282 |
+
from .syntax import Syntax
|
| 283 |
+
from .table import Table
|
| 284 |
+
|
| 285 |
+
console = Console()
|
| 286 |
+
|
| 287 |
+
syntax = Syntax(
|
| 288 |
+
'''def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
|
| 289 |
+
"""Iterate and generate a tuple with a flag for last value."""
|
| 290 |
+
iter_values = iter(values)
|
| 291 |
+
try:
|
| 292 |
+
previous_value = next(iter_values)
|
| 293 |
+
except StopIteration:
|
| 294 |
+
return
|
| 295 |
+
for value in iter_values:
|
| 296 |
+
yield False, previous_value
|
| 297 |
+
previous_value = value
|
| 298 |
+
yield True, previous_value''',
|
| 299 |
+
"python",
|
| 300 |
+
line_numbers=True,
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
table = Table("foo", "bar", "baz")
|
| 304 |
+
table.add_row("1", "2", "3")
|
| 305 |
+
|
| 306 |
+
progress_renderables = [
|
| 307 |
+
"You can make the terminal shorter and taller to see the live table hide"
|
| 308 |
+
"Text may be printed while the progress bars are rendering.",
|
| 309 |
+
Panel("In fact, [i]any[/i] renderable will work"),
|
| 310 |
+
"Such as [magenta]tables[/]...",
|
| 311 |
+
table,
|
| 312 |
+
"Pretty printed structures...",
|
| 313 |
+
{"type": "example", "text": "Pretty printed"},
|
| 314 |
+
"Syntax...",
|
| 315 |
+
syntax,
|
| 316 |
+
Rule("Give it a try!"),
|
| 317 |
+
]
|
| 318 |
+
|
| 319 |
+
examples = cycle(progress_renderables)
|
| 320 |
+
|
| 321 |
+
exchanges = [
|
| 322 |
+
"SGD",
|
| 323 |
+
"MYR",
|
| 324 |
+
"EUR",
|
| 325 |
+
"USD",
|
| 326 |
+
"AUD",
|
| 327 |
+
"JPY",
|
| 328 |
+
"CNH",
|
| 329 |
+
"HKD",
|
| 330 |
+
"CAD",
|
| 331 |
+
"INR",
|
| 332 |
+
"DKK",
|
| 333 |
+
"GBP",
|
| 334 |
+
"RUB",
|
| 335 |
+
"NZD",
|
| 336 |
+
"MXN",
|
| 337 |
+
"IDR",
|
| 338 |
+
"TWD",
|
| 339 |
+
"THB",
|
| 340 |
+
"VND",
|
| 341 |
+
]
|
| 342 |
+
with Live(console=console) as live_table:
|
| 343 |
+
exchange_rate_dict: Dict[Tuple[str, str], float] = {}
|
| 344 |
+
|
| 345 |
+
for index in range(100):
|
| 346 |
+
select_exchange = exchanges[index % len(exchanges)]
|
| 347 |
+
|
| 348 |
+
for exchange in exchanges:
|
| 349 |
+
if exchange == select_exchange:
|
| 350 |
+
continue
|
| 351 |
+
time.sleep(0.4)
|
| 352 |
+
if random.randint(0, 10) < 1:
|
| 353 |
+
console.log(next(examples))
|
| 354 |
+
exchange_rate_dict[(select_exchange, exchange)] = 200 / (
|
| 355 |
+
(random.random() * 320) + 1
|
| 356 |
+
)
|
| 357 |
+
if len(exchange_rate_dict) > len(exchanges) - 1:
|
| 358 |
+
exchange_rate_dict.pop(list(exchange_rate_dict.keys())[0])
|
| 359 |
+
table = Table(title="Exchange Rates")
|
| 360 |
+
|
| 361 |
+
table.add_column("Source Currency")
|
| 362 |
+
table.add_column("Destination Currency")
|
| 363 |
+
table.add_column("Exchange Rate")
|
| 364 |
+
|
| 365 |
+
for (source, dest), exchange_rate in exchange_rate_dict.items():
|
| 366 |
+
table.add_row(
|
| 367 |
+
source,
|
| 368 |
+
dest,
|
| 369 |
+
Text(
|
| 370 |
+
f"{exchange_rate:.4f}",
|
| 371 |
+
style="red" if exchange_rate < 1.0 else "green",
|
| 372 |
+
),
|
| 373 |
+
)
|
| 374 |
+
|
| 375 |
+
live_table.update(Align.center(table))
|
evalkit_cambrian/lib/python3.10/site-packages/rich/pager.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from abc import ABC, abstractmethod
|
| 2 |
+
from typing import Any
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class Pager(ABC):
|
| 6 |
+
"""Base class for a pager."""
|
| 7 |
+
|
| 8 |
+
@abstractmethod
|
| 9 |
+
def show(self, content: str) -> None:
|
| 10 |
+
"""Show content in pager.
|
| 11 |
+
|
| 12 |
+
Args:
|
| 13 |
+
content (str): Content to be displayed.
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class SystemPager(Pager):
|
| 18 |
+
"""Uses the pager installed on the system."""
|
| 19 |
+
|
| 20 |
+
def _pager(self, content: str) -> Any: # pragma: no cover
|
| 21 |
+
return __import__("pydoc").pager(content)
|
| 22 |
+
|
| 23 |
+
def show(self, content: str) -> None:
|
| 24 |
+
"""Use the same pager used by pydoc."""
|
| 25 |
+
self._pager(content)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
if __name__ == "__main__": # pragma: no cover
|
| 29 |
+
from .__main__ import make_test_card
|
| 30 |
+
from .console import Console
|
| 31 |
+
|
| 32 |
+
console = Console()
|
| 33 |
+
with console.pager(styles=True):
|
| 34 |
+
console.print(make_test_card())
|
evalkit_cambrian/lib/python3.10/site-packages/wheel-0.45.1.dist-info/METADATA
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: wheel
|
| 3 |
+
Version: 0.45.1
|
| 4 |
+
Summary: A built-package format for Python
|
| 5 |
+
Keywords: wheel,packaging
|
| 6 |
+
Author-email: Daniel Holth <dholth@fastmail.fm>
|
| 7 |
+
Maintainer-email: Alex Grönholm <alex.gronholm@nextday.fi>
|
| 8 |
+
Requires-Python: >=3.8
|
| 9 |
+
Description-Content-Type: text/x-rst
|
| 10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 11 |
+
Classifier: Intended Audience :: Developers
|
| 12 |
+
Classifier: Topic :: System :: Archiving :: Packaging
|
| 13 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 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-Dist: pytest >= 6.0.0 ; extra == "test"
|
| 22 |
+
Requires-Dist: setuptools >= 65 ; extra == "test"
|
| 23 |
+
Project-URL: Changelog, https://wheel.readthedocs.io/en/stable/news.html
|
| 24 |
+
Project-URL: Documentation, https://wheel.readthedocs.io/
|
| 25 |
+
Project-URL: Issue Tracker, https://github.com/pypa/wheel/issues
|
| 26 |
+
Project-URL: Source, https://github.com/pypa/wheel
|
| 27 |
+
Provides-Extra: test
|
| 28 |
+
|
| 29 |
+
wheel
|
| 30 |
+
=====
|
| 31 |
+
|
| 32 |
+
This is a command line tool for manipulating Python wheel files, as defined in
|
| 33 |
+
`PEP 427`_. It contains the following functionality:
|
| 34 |
+
|
| 35 |
+
* Convert ``.egg`` archives into ``.whl``
|
| 36 |
+
* Unpack wheel archives
|
| 37 |
+
* Repack wheel archives
|
| 38 |
+
* Add or remove tags in existing wheel archives
|
| 39 |
+
|
| 40 |
+
.. _PEP 427: https://www.python.org/dev/peps/pep-0427/
|
| 41 |
+
|
| 42 |
+
Historical note
|
| 43 |
+
---------------
|
| 44 |
+
|
| 45 |
+
This project used to contain the implementation of the setuptools_ ``bdist_wheel``
|
| 46 |
+
command, but as of setuptools v70.1, it no longer needs ``wheel`` installed for that to
|
| 47 |
+
work. Thus, you should install this **only** if you intend to use the ``wheel`` command
|
| 48 |
+
line tool!
|
| 49 |
+
|
| 50 |
+
.. _setuptools: https://pypi.org/project/setuptools/
|
| 51 |
+
|
| 52 |
+
Documentation
|
| 53 |
+
-------------
|
| 54 |
+
|
| 55 |
+
The documentation_ can be found on Read The Docs.
|
| 56 |
+
|
| 57 |
+
.. _documentation: https://wheel.readthedocs.io/
|
| 58 |
+
|
| 59 |
+
Code of Conduct
|
| 60 |
+
---------------
|
| 61 |
+
|
| 62 |
+
Everyone interacting in the wheel project's codebases, issue trackers, chat
|
| 63 |
+
rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
|
| 64 |
+
|
| 65 |
+
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
|
| 66 |
+
|
evalkit_cambrian/lib/python3.10/site-packages/wheel-0.45.1.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: flit 3.9.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
evalkit_cambrian/lib/python3.10/site-packages/wheel-0.45.1.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[console_scripts]
|
| 2 |
+
wheel=wheel.cli:main
|
| 3 |
+
|
| 4 |
+
[distutils.commands]
|
| 5 |
+
bdist_wheel=wheel.bdist_wheel:bdist_wheel
|
| 6 |
+
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_adaptive_avg_pool3d_cuda_dispatch.h
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace cuda {
|
| 19 |
+
|
| 20 |
+
TORCH_API at::Tensor _adaptive_avg_pool3d(const at::Tensor & self, at::IntArrayRef output_size);
|
| 21 |
+
TORCH_API at::Tensor _adaptive_avg_pool3d_symint(const at::Tensor & self, c10::SymIntArrayRef output_size);
|
| 22 |
+
|
| 23 |
+
} // namespace cuda
|
| 24 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_foreach_ceil_native.h
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from NativeFunction.h
|
| 4 |
+
|
| 5 |
+
#include <c10/core/Scalar.h>
|
| 6 |
+
#include <c10/core/Storage.h>
|
| 7 |
+
#include <c10/core/TensorOptions.h>
|
| 8 |
+
#include <c10/util/Deprecated.h>
|
| 9 |
+
#include <optional>
|
| 10 |
+
#include <c10/core/QScheme.h>
|
| 11 |
+
#include <ATen/core/Reduction.h>
|
| 12 |
+
#include <ATen/core/Tensor.h>
|
| 13 |
+
#include <tuple>
|
| 14 |
+
#include <vector>
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
namespace at {
|
| 18 |
+
namespace native {
|
| 19 |
+
TORCH_API ::std::vector<at::Tensor> foreach_tensor_ceil_slow(at::TensorList self);
|
| 20 |
+
TORCH_API void _foreach_ceil_out(at::TensorList self, at::TensorList out);
|
| 21 |
+
TORCH_API void foreach_tensor_ceil_slow_(at::TensorList self);
|
| 22 |
+
TORCH_API ::std::vector<at::Tensor> foreach_tensor_ceil_cuda(at::TensorList self);
|
| 23 |
+
TORCH_API void foreach_tensor_ceil_cuda_(at::TensorList self);
|
| 24 |
+
} // namespace native
|
| 25 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_log_softmax_cuda_dispatch.h
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace cuda {
|
| 19 |
+
|
| 20 |
+
TORCH_API at::Tensor _log_softmax(const at::Tensor & self, int64_t dim, bool half_to_float);
|
| 21 |
+
TORCH_API at::Tensor & _log_softmax_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool half_to_float);
|
| 22 |
+
TORCH_API at::Tensor & _log_softmax_outf(const at::Tensor & self, int64_t dim, bool half_to_float, at::Tensor & out);
|
| 23 |
+
|
| 24 |
+
} // namespace cuda
|
| 25 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_padded_dense_to_jagged_forward.h
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <optional>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/_padded_dense_to_jagged_forward_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::_padded_dense_to_jagged_forward(Tensor dense, Tensor[] offsets, SymInt? total_L=None) -> Tensor
|
| 26 |
+
inline at::Tensor _padded_dense_to_jagged_forward(const at::Tensor & dense, at::TensorList offsets, ::std::optional<int64_t> total_L=::std::nullopt) {
|
| 27 |
+
return at::_ops::_padded_dense_to_jagged_forward::call(dense, offsets, total_L.has_value() ? ::std::make_optional(c10::SymInt(*total_L)) : ::std::nullopt);
|
| 28 |
+
}
|
| 29 |
+
namespace symint {
|
| 30 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
|
| 31 |
+
at::Tensor _padded_dense_to_jagged_forward(const at::Tensor & dense, at::TensorList offsets, ::std::optional<int64_t> total_L=::std::nullopt) {
|
| 32 |
+
return at::_ops::_padded_dense_to_jagged_forward::call(dense, offsets, total_L.has_value() ? ::std::make_optional(c10::SymInt(*total_L)) : ::std::nullopt);
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// aten::_padded_dense_to_jagged_forward(Tensor dense, Tensor[] offsets, SymInt? total_L=None) -> Tensor
|
| 37 |
+
inline at::Tensor _padded_dense_to_jagged_forward_symint(const at::Tensor & dense, at::TensorList offsets, ::std::optional<c10::SymInt> total_L=::std::nullopt) {
|
| 38 |
+
return at::_ops::_padded_dense_to_jagged_forward::call(dense, offsets, total_L);
|
| 39 |
+
}
|
| 40 |
+
namespace symint {
|
| 41 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
|
| 42 |
+
at::Tensor _padded_dense_to_jagged_forward(const at::Tensor & dense, at::TensorList offsets, ::std::optional<c10::SymInt> total_L=::std::nullopt) {
|
| 43 |
+
return at::_ops::_padded_dense_to_jagged_forward::call(dense, offsets, total_L);
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
}
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_segment_reduce_backward_cuda_dispatch.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace cuda {
|
| 19 |
+
|
| 20 |
+
TORCH_API at::Tensor _segment_reduce_backward(const at::Tensor & grad, const at::Tensor & output, const at::Tensor & data, c10::string_view reduce, const ::std::optional<at::Tensor> & lengths={}, const ::std::optional<at::Tensor> & offsets={}, int64_t axis=0, const ::std::optional<at::Scalar> & initial=::std::nullopt);
|
| 21 |
+
|
| 22 |
+
} // namespace cuda
|
| 23 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/_unique_native.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from NativeFunction.h
|
| 4 |
+
|
| 5 |
+
#include <c10/core/Scalar.h>
|
| 6 |
+
#include <c10/core/Storage.h>
|
| 7 |
+
#include <c10/core/TensorOptions.h>
|
| 8 |
+
#include <c10/util/Deprecated.h>
|
| 9 |
+
#include <optional>
|
| 10 |
+
#include <c10/core/QScheme.h>
|
| 11 |
+
#include <ATen/core/Reduction.h>
|
| 12 |
+
#include <ATen/core/Tensor.h>
|
| 13 |
+
#include <tuple>
|
| 14 |
+
#include <vector>
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
namespace at {
|
| 18 |
+
namespace native {
|
| 19 |
+
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> _unique_out(const at::Tensor & self, bool sorted, bool return_inverse, at::Tensor & out0, at::Tensor & out1);
|
| 20 |
+
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _unique_cpu(const at::Tensor & self, bool sorted=true, bool return_inverse=false);
|
| 21 |
+
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _unique_cuda(const at::Tensor & self, bool sorted=true, bool return_inverse=false);
|
| 22 |
+
} // namespace native
|
| 23 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/addcdiv_native.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from NativeFunction.h
|
| 4 |
+
|
| 5 |
+
#include <c10/core/Scalar.h>
|
| 6 |
+
#include <c10/core/Storage.h>
|
| 7 |
+
#include <c10/core/TensorOptions.h>
|
| 8 |
+
#include <c10/util/Deprecated.h>
|
| 9 |
+
#include <optional>
|
| 10 |
+
#include <c10/core/QScheme.h>
|
| 11 |
+
#include <ATen/core/Reduction.h>
|
| 12 |
+
#include <ATen/core/Tensor.h>
|
| 13 |
+
#include <tuple>
|
| 14 |
+
#include <vector>
|
| 15 |
+
#include <ATen/ops/addcdiv_meta.h>
|
| 16 |
+
|
| 17 |
+
namespace at {
|
| 18 |
+
namespace native {
|
| 19 |
+
struct TORCH_API structured_addcdiv_out : public at::meta::structured_addcdiv {
|
| 20 |
+
void impl(const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value, const at::Tensor & out);
|
| 21 |
+
};
|
| 22 |
+
} // namespace native
|
| 23 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/addr.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <optional>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/addr_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::addr(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1) -> Tensor
|
| 26 |
+
inline at::Tensor addr(const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta=1, const at::Scalar & alpha=1) {
|
| 27 |
+
return at::_ops::addr::call(self, vec1, vec2, beta, alpha);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
// aten::addr.out(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
|
| 31 |
+
inline at::Tensor & addr_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta=1, const at::Scalar & alpha=1) {
|
| 32 |
+
return at::_ops::addr_out::call(self, vec1, vec2, beta, alpha, out);
|
| 33 |
+
}
|
| 34 |
+
// aten::addr.out(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
|
| 35 |
+
inline at::Tensor & addr_outf(const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out) {
|
| 36 |
+
return at::_ops::addr_out::call(self, vec1, vec2, beta, alpha, out);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
}
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/div_compositeexplicitautograd_dispatch.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace compositeexplicitautograd {
|
| 19 |
+
|
| 20 |
+
TORCH_API at::Tensor div(const at::Tensor & self, const at::Scalar & other);
|
| 21 |
+
TORCH_API at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
|
| 22 |
+
TORCH_API at::Tensor & div_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
|
| 23 |
+
TORCH_API at::Tensor & div_(at::Tensor & self, const at::Scalar & other);
|
| 24 |
+
TORCH_API at::Tensor div(const at::Tensor & self, const at::Scalar & other, ::std::optional<c10::string_view> rounding_mode);
|
| 25 |
+
TORCH_API at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other, ::std::optional<c10::string_view> rounding_mode);
|
| 26 |
+
TORCH_API at::Tensor & div_outf(const at::Tensor & self, const at::Scalar & other, ::std::optional<c10::string_view> rounding_mode, at::Tensor & out);
|
| 27 |
+
TORCH_API at::Tensor & div_(at::Tensor & self, const at::Scalar & other, ::std::optional<c10::string_view> rounding_mode);
|
| 28 |
+
|
| 29 |
+
} // namespace compositeexplicitautograd
|
| 30 |
+
} // namespace at
|
infer_4_47_1/lib/python3.10/site-packages/torch/include/ATen/ops/fft_fft.h
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <optional>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/fft_fft_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::fft_fft(Tensor self, SymInt? n=None, int dim=-1, str? norm=None) -> Tensor
|
| 26 |
+
inline at::Tensor fft_fft(const at::Tensor & self, ::std::optional<int64_t> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 27 |
+
return at::_ops::fft_fft::call(self, n.has_value() ? ::std::make_optional(c10::SymInt(*n)) : ::std::nullopt, dim, norm);
|
| 28 |
+
}
|
| 29 |
+
namespace symint {
|
| 30 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
|
| 31 |
+
at::Tensor fft_fft(const at::Tensor & self, ::std::optional<int64_t> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 32 |
+
return at::_ops::fft_fft::call(self, n.has_value() ? ::std::make_optional(c10::SymInt(*n)) : ::std::nullopt, dim, norm);
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// aten::fft_fft(Tensor self, SymInt? n=None, int dim=-1, str? norm=None) -> Tensor
|
| 37 |
+
inline at::Tensor fft_fft_symint(const at::Tensor & self, ::std::optional<c10::SymInt> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 38 |
+
return at::_ops::fft_fft::call(self, n, dim, norm);
|
| 39 |
+
}
|
| 40 |
+
namespace symint {
|
| 41 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
|
| 42 |
+
at::Tensor fft_fft(const at::Tensor & self, ::std::optional<c10::SymInt> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 43 |
+
return at::_ops::fft_fft::call(self, n, dim, norm);
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
// aten::fft_fft.out(Tensor self, SymInt? n=None, int dim=-1, str? norm=None, *, Tensor(a!) out) -> Tensor(a!)
|
| 48 |
+
inline at::Tensor & fft_fft_out(at::Tensor & out, const at::Tensor & self, ::std::optional<int64_t> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 49 |
+
return at::_ops::fft_fft_out::call(self, n.has_value() ? ::std::make_optional(c10::SymInt(*n)) : ::std::nullopt, dim, norm, out);
|
| 50 |
+
}
|
| 51 |
+
namespace symint {
|
| 52 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
|
| 53 |
+
at::Tensor & fft_fft_out(at::Tensor & out, const at::Tensor & self, ::std::optional<int64_t> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 54 |
+
return at::_ops::fft_fft_out::call(self, n.has_value() ? ::std::make_optional(c10::SymInt(*n)) : ::std::nullopt, dim, norm, out);
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
// aten::fft_fft.out(Tensor self, SymInt? n=None, int dim=-1, str? norm=None, *, Tensor(a!) out) -> Tensor(a!)
|
| 59 |
+
inline at::Tensor & fft_fft_outf(const at::Tensor & self, ::std::optional<int64_t> n, int64_t dim, ::std::optional<c10::string_view> norm, at::Tensor & out) {
|
| 60 |
+
return at::_ops::fft_fft_out::call(self, n.has_value() ? ::std::make_optional(c10::SymInt(*n)) : ::std::nullopt, dim, norm, out);
|
| 61 |
+
}
|
| 62 |
+
namespace symint {
|
| 63 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
|
| 64 |
+
at::Tensor & fft_fft_outf(const at::Tensor & self, ::std::optional<int64_t> n, int64_t dim, ::std::optional<c10::string_view> norm, at::Tensor & out) {
|
| 65 |
+
return at::_ops::fft_fft_out::call(self, n.has_value() ? ::std::make_optional(c10::SymInt(*n)) : ::std::nullopt, dim, norm, out);
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
// aten::fft_fft.out(Tensor self, SymInt? n=None, int dim=-1, str? norm=None, *, Tensor(a!) out) -> Tensor(a!)
|
| 70 |
+
inline at::Tensor & fft_fft_symint_out(at::Tensor & out, const at::Tensor & self, ::std::optional<c10::SymInt> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 71 |
+
return at::_ops::fft_fft_out::call(self, n, dim, norm, out);
|
| 72 |
+
}
|
| 73 |
+
namespace symint {
|
| 74 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
|
| 75 |
+
at::Tensor & fft_fft_out(at::Tensor & out, const at::Tensor & self, ::std::optional<c10::SymInt> n=::std::nullopt, int64_t dim=-1, ::std::optional<c10::string_view> norm=::std::nullopt) {
|
| 76 |
+
return at::_ops::fft_fft_out::call(self, n, dim, norm, out);
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
// aten::fft_fft.out(Tensor self, SymInt? n=None, int dim=-1, str? norm=None, *, Tensor(a!) out) -> Tensor(a!)
|
| 81 |
+
inline at::Tensor & fft_fft_symint_outf(const at::Tensor & self, ::std::optional<c10::SymInt> n, int64_t dim, ::std::optional<c10::string_view> norm, at::Tensor & out) {
|
| 82 |
+
return at::_ops::fft_fft_out::call(self, n, dim, norm, out);
|
| 83 |
+
}
|
| 84 |
+
namespace symint {
|
| 85 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
|
| 86 |
+
at::Tensor & fft_fft_outf(const at::Tensor & self, ::std::optional<c10::SymInt> n, int64_t dim, ::std::optional<c10::string_view> norm, at::Tensor & out) {
|
| 87 |
+
return at::_ops::fft_fft_out::call(self, n, dim, norm, out);
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
}
|