Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- ckpts/universal/global_step80/zero/10.post_attention_layernorm.weight/exp_avg_sq.pt +3 -0
- ckpts/universal/global_step80/zero/19.attention.dense.weight/exp_avg.pt +3 -0
- ckpts/universal/global_step80/zero/19.attention.dense.weight/exp_avg_sq.pt +3 -0
- venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/INSTALLER +1 -0
- venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/License.txt +1568 -0
- venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/METADATA +35 -0
- venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/RECORD +20 -0
- venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/WHEEL +5 -0
- venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/top_level.txt +1 -0
- venv/lib/python3.10/site-packages/pytablewriter/__init__.py +133 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/__version__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_converter.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_factory.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_function.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_table_format.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_typing.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__pycache__/error.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/__version__.py +6 -0
- venv/lib/python3.10/site-packages/pytablewriter/_converter.py +11 -0
- venv/lib/python3.10/site-packages/pytablewriter/_factory.py +274 -0
- venv/lib/python3.10/site-packages/pytablewriter/_function.py +84 -0
- venv/lib/python3.10/site-packages/pytablewriter/_logger/__init__.py +4 -0
- venv/lib/python3.10/site-packages/pytablewriter/_logger/_logger.py +117 -0
- venv/lib/python3.10/site-packages/pytablewriter/_logger/_null_logger.py +44 -0
- venv/lib/python3.10/site-packages/pytablewriter/_table_format.py +353 -0
- venv/lib/python3.10/site-packages/pytablewriter/_typing.py +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/error.py +34 -0
- venv/lib/python3.10/site-packages/pytablewriter/py.typed +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__init__.py +21 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_base.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_elasticsearch.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_excel.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_interface.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_javascript.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_python.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_base.py +91 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_elasticsearch.py +27 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_excel.py +75 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_interface.py +38 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_javascript.py +143 -0
- venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_python.py +117 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__init__.py +53 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_cell.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_font.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_style.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_styler.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_styler_interface.cpython-310.pyc +0 -0
ckpts/universal/global_step80/zero/10.post_attention_layernorm.weight/exp_avg_sq.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:afba97a9cc0ee57e8f4a6cae59533d9d46eeee5568890e85f5272182eac0c314
|
3 |
+
size 9387
|
ckpts/universal/global_step80/zero/19.attention.dense.weight/exp_avg.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea702ada56e650a6ba3311f73d9451334a8810b34202670981a4feeb82760cf3
|
3 |
+
size 16778396
|
ckpts/universal/global_step80/zero/19.attention.dense.weight/exp_avg_sq.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8a58559bf9f84a41bc0bb13926ff6f8fb989de4396e66971b657abe0a06068e1
|
3 |
+
size 16778411
|
venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/License.txt
ADDED
@@ -0,0 +1,1568 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
End User License Agreement
|
2 |
+
--------------------------
|
3 |
+
|
4 |
+
|
5 |
+
Preface
|
6 |
+
-------
|
7 |
+
|
8 |
+
The Software License Agreement in Chapter 1 and the Supplement
|
9 |
+
in Chapter 2 contain license terms and conditions that govern
|
10 |
+
the use of NVIDIA software. By accepting this agreement, you
|
11 |
+
agree to comply with all the terms and conditions applicable
|
12 |
+
to the product(s) included herein.
|
13 |
+
|
14 |
+
|
15 |
+
NVIDIA Driver
|
16 |
+
|
17 |
+
|
18 |
+
Description
|
19 |
+
|
20 |
+
This package contains the operating system driver and
|
21 |
+
fundamental system software components for NVIDIA GPUs.
|
22 |
+
|
23 |
+
|
24 |
+
NVIDIA CUDA Toolkit
|
25 |
+
|
26 |
+
|
27 |
+
Description
|
28 |
+
|
29 |
+
The NVIDIA CUDA Toolkit provides command-line and graphical
|
30 |
+
tools for building, debugging and optimizing the performance
|
31 |
+
of applications accelerated by NVIDIA GPUs, runtime and math
|
32 |
+
libraries, and documentation including programming guides,
|
33 |
+
user manuals, and API references.
|
34 |
+
|
35 |
+
|
36 |
+
Default Install Location of CUDA Toolkit
|
37 |
+
|
38 |
+
Windows platform:
|
39 |
+
|
40 |
+
%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.#
|
41 |
+
|
42 |
+
Linux platform:
|
43 |
+
|
44 |
+
/usr/local/cuda-#.#
|
45 |
+
|
46 |
+
Mac platform:
|
47 |
+
|
48 |
+
/Developer/NVIDIA/CUDA-#.#
|
49 |
+
|
50 |
+
|
51 |
+
NVIDIA CUDA Samples
|
52 |
+
|
53 |
+
|
54 |
+
Description
|
55 |
+
|
56 |
+
This package includes over 100+ CUDA examples that demonstrate
|
57 |
+
various CUDA programming principles, and efficient CUDA
|
58 |
+
implementation of algorithms in specific application domains.
|
59 |
+
|
60 |
+
|
61 |
+
Default Install Location of CUDA Samples
|
62 |
+
|
63 |
+
Windows platform:
|
64 |
+
|
65 |
+
%ProgramData%\NVIDIA Corporation\CUDA Samples\v#.#
|
66 |
+
|
67 |
+
Linux platform:
|
68 |
+
|
69 |
+
/usr/local/cuda-#.#/samples
|
70 |
+
|
71 |
+
and
|
72 |
+
|
73 |
+
$HOME/NVIDIA_CUDA-#.#_Samples
|
74 |
+
|
75 |
+
Mac platform:
|
76 |
+
|
77 |
+
/Developer/NVIDIA/CUDA-#.#/samples
|
78 |
+
|
79 |
+
|
80 |
+
NVIDIA Nsight Visual Studio Edition (Windows only)
|
81 |
+
|
82 |
+
|
83 |
+
Description
|
84 |
+
|
85 |
+
NVIDIA Nsight Development Platform, Visual Studio Edition is a
|
86 |
+
development environment integrated into Microsoft Visual
|
87 |
+
Studio that provides tools for debugging, profiling, analyzing
|
88 |
+
and optimizing your GPU computing and graphics applications.
|
89 |
+
|
90 |
+
|
91 |
+
Default Install Location of Nsight Visual Studio Edition
|
92 |
+
|
93 |
+
Windows platform:
|
94 |
+
|
95 |
+
%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.#
|
96 |
+
|
97 |
+
|
98 |
+
1. License Agreement for NVIDIA Software Development Kits
|
99 |
+
---------------------------------------------------------
|
100 |
+
|
101 |
+
|
102 |
+
Release Date: July 26, 2018
|
103 |
+
---------------------------
|
104 |
+
|
105 |
+
|
106 |
+
Important NoticeRead before downloading, installing,
|
107 |
+
copying or using the licensed software:
|
108 |
+
-------------------------------------------------------
|
109 |
+
|
110 |
+
This license agreement, including exhibits attached
|
111 |
+
("Agreement”) is a legal agreement between you and NVIDIA
|
112 |
+
Corporation ("NVIDIA") and governs your use of a NVIDIA
|
113 |
+
software development kit (“SDK”).
|
114 |
+
|
115 |
+
Each SDK has its own set of software and materials, but here
|
116 |
+
is a description of the types of items that may be included in
|
117 |
+
a SDK: source code, header files, APIs, data sets and assets
|
118 |
+
(examples include images, textures, models, scenes, videos,
|
119 |
+
native API input/output files), binary software, sample code,
|
120 |
+
libraries, utility programs, programming code and
|
121 |
+
documentation.
|
122 |
+
|
123 |
+
This Agreement can be accepted only by an adult of legal age
|
124 |
+
of majority in the country in which the SDK is used.
|
125 |
+
|
126 |
+
If you are entering into this Agreement on behalf of a company
|
127 |
+
or other legal entity, you represent that you have the legal
|
128 |
+
authority to bind the entity to this Agreement, in which case
|
129 |
+
“you” will mean the entity you represent.
|
130 |
+
|
131 |
+
If you don’t have the required age or authority to accept
|
132 |
+
this Agreement, or if you don’t accept all the terms and
|
133 |
+
conditions of this Agreement, do not download, install or use
|
134 |
+
the SDK.
|
135 |
+
|
136 |
+
You agree to use the SDK only for purposes that are permitted
|
137 |
+
by (a) this Agreement, and (b) any applicable law, regulation
|
138 |
+
or generally accepted practices or guidelines in the relevant
|
139 |
+
jurisdictions.
|
140 |
+
|
141 |
+
|
142 |
+
1.1. License
|
143 |
+
|
144 |
+
|
145 |
+
1.1.1. License Grant
|
146 |
+
|
147 |
+
Subject to the terms of this Agreement, NVIDIA hereby grants
|
148 |
+
you a non-exclusive, non-transferable license, without the
|
149 |
+
right to sublicense (except as expressly provided in this
|
150 |
+
Agreement) to:
|
151 |
+
|
152 |
+
1. Install and use the SDK,
|
153 |
+
|
154 |
+
2. Modify and create derivative works of sample source code
|
155 |
+
delivered in the SDK, and
|
156 |
+
|
157 |
+
3. Distribute those portions of the SDK that are identified
|
158 |
+
in this Agreement as distributable, as incorporated in
|
159 |
+
object code format into a software application that meets
|
160 |
+
the distribution requirements indicated in this Agreement.
|
161 |
+
|
162 |
+
|
163 |
+
1.1.2. Distribution Requirements
|
164 |
+
|
165 |
+
These are the distribution requirements for you to exercise
|
166 |
+
the distribution grant:
|
167 |
+
|
168 |
+
1. Your application must have material additional
|
169 |
+
functionality, beyond the included portions of the SDK.
|
170 |
+
|
171 |
+
2. The distributable portions of the SDK shall only be
|
172 |
+
accessed by your application.
|
173 |
+
|
174 |
+
3. The following notice shall be included in modifications
|
175 |
+
and derivative works of sample source code distributed:
|
176 |
+
“This software contains source code provided by NVIDIA
|
177 |
+
Corporation.”
|
178 |
+
|
179 |
+
4. Unless a developer tool is identified in this Agreement
|
180 |
+
as distributable, it is delivered for your internal use
|
181 |
+
only.
|
182 |
+
|
183 |
+
5. The terms under which you distribute your application
|
184 |
+
must be consistent with the terms of this Agreement,
|
185 |
+
including (without limitation) terms relating to the
|
186 |
+
license grant and license restrictions and protection of
|
187 |
+
NVIDIA’s intellectual property rights. Additionally, you
|
188 |
+
agree that you will protect the privacy, security and
|
189 |
+
legal rights of your application users.
|
190 |
+
|
191 |
+
6. You agree to notify NVIDIA in writing of any known or
|
192 |
+
suspected distribution or use of the SDK not in compliance
|
193 |
+
with the requirements of this Agreement, and to enforce
|
194 |
+
the terms of your agreements with respect to distributed
|
195 |
+
SDK.
|
196 |
+
|
197 |
+
|
198 |
+
1.1.3. Authorized Users
|
199 |
+
|
200 |
+
You may allow employees and contractors of your entity or of
|
201 |
+
your subsidiary(ies) to access and use the SDK from your
|
202 |
+
secure network to perform work on your behalf.
|
203 |
+
|
204 |
+
If you are an academic institution you may allow users
|
205 |
+
enrolled or employed by the academic institution to access and
|
206 |
+
use the SDK from your secure network.
|
207 |
+
|
208 |
+
You are responsible for the compliance with the terms of this
|
209 |
+
Agreement by your authorized users. If you become aware that
|
210 |
+
your authorized users didn’t follow the terms of this
|
211 |
+
Agreement, you agree to take reasonable steps to resolve the
|
212 |
+
non-compliance and prevent new occurrences.
|
213 |
+
|
214 |
+
|
215 |
+
1.1.4. Pre-Release SDK
|
216 |
+
|
217 |
+
The SDK versions identified as alpha, beta, preview or
|
218 |
+
otherwise as pre-release, may not be fully functional, may
|
219 |
+
contain errors or design flaws, and may have reduced or
|
220 |
+
different security, privacy, accessibility, availability, and
|
221 |
+
reliability standards relative to commercial versions of
|
222 |
+
NVIDIA software and materials. Use of a pre-release SDK may
|
223 |
+
result in unexpected results, loss of data, project delays or
|
224 |
+
other unpredictable damage or loss.
|
225 |
+
|
226 |
+
You may use a pre-release SDK at your own risk, understanding
|
227 |
+
that pre-release SDKs are not intended for use in production
|
228 |
+
or business-critical systems.
|
229 |
+
|
230 |
+
NVIDIA may choose not to make available a commercial version
|
231 |
+
of any pre-release SDK. NVIDIA may also choose to abandon
|
232 |
+
development and terminate the availability of a pre-release
|
233 |
+
SDK at any time without liability.
|
234 |
+
|
235 |
+
|
236 |
+
1.1.5. Updates
|
237 |
+
|
238 |
+
NVIDIA may, at its option, make available patches, workarounds
|
239 |
+
or other updates to this SDK. Unless the updates are provided
|
240 |
+
with their separate governing terms, they are deemed part of
|
241 |
+
the SDK licensed to you as provided in this Agreement. You
|
242 |
+
agree that the form and content of the SDK that NVIDIA
|
243 |
+
provides may change without prior notice to you. While NVIDIA
|
244 |
+
generally maintains compatibility between versions, NVIDIA may
|
245 |
+
in some cases make changes that introduce incompatibilities in
|
246 |
+
future versions of the SDK.
|
247 |
+
|
248 |
+
|
249 |
+
1.1.6. Third Party Licenses
|
250 |
+
|
251 |
+
The SDK may come bundled with, or otherwise include or be
|
252 |
+
distributed with, third party software licensed by a NVIDIA
|
253 |
+
supplier and/or open source software provided under an open
|
254 |
+
source license. Use of third party software is subject to the
|
255 |
+
third-party license terms, or in the absence of third party
|
256 |
+
terms, the terms of this Agreement. Copyright to third party
|
257 |
+
software is held by the copyright holders indicated in the
|
258 |
+
third-party software or license.
|
259 |
+
|
260 |
+
|
261 |
+
1.1.7. Reservation of Rights
|
262 |
+
|
263 |
+
NVIDIA reserves all rights, title, and interest in and to the
|
264 |
+
SDK, not expressly granted to you under this Agreement.
|
265 |
+
|
266 |
+
|
267 |
+
1.2. Limitations
|
268 |
+
|
269 |
+
The following license limitations apply to your use of the
|
270 |
+
SDK:
|
271 |
+
|
272 |
+
1. You may not reverse engineer, decompile or disassemble,
|
273 |
+
or remove copyright or other proprietary notices from any
|
274 |
+
portion of the SDK or copies of the SDK.
|
275 |
+
|
276 |
+
2. Except as expressly provided in this Agreement, you may
|
277 |
+
not copy, sell, rent, sublicense, transfer, distribute,
|
278 |
+
modify, or create derivative works of any portion of the
|
279 |
+
SDK. For clarity, you may not distribute or sublicense the
|
280 |
+
SDK as a stand-alone product.
|
281 |
+
|
282 |
+
3. Unless you have an agreement with NVIDIA for this
|
283 |
+
purpose, you may not indicate that an application created
|
284 |
+
with the SDK is sponsored or endorsed by NVIDIA.
|
285 |
+
|
286 |
+
4. You may not bypass, disable, or circumvent any
|
287 |
+
encryption, security, digital rights management or
|
288 |
+
authentication mechanism in the SDK.
|
289 |
+
|
290 |
+
5. You may not use the SDK in any manner that would cause it
|
291 |
+
to become subject to an open source software license. As
|
292 |
+
examples, licenses that require as a condition of use,
|
293 |
+
modification, and/or distribution that the SDK be:
|
294 |
+
|
295 |
+
a. Disclosed or distributed in source code form;
|
296 |
+
|
297 |
+
b. Licensed for the purpose of making derivative works;
|
298 |
+
or
|
299 |
+
|
300 |
+
c. Redistributable at no charge.
|
301 |
+
|
302 |
+
6. Unless you have an agreement with NVIDIA for this
|
303 |
+
purpose, you may not use the SDK with any system or
|
304 |
+
application where the use or failure of the system or
|
305 |
+
application can reasonably be expected to threaten or
|
306 |
+
result in personal injury, death, or catastrophic loss.
|
307 |
+
Examples include use in avionics, navigation, military,
|
308 |
+
medical, life support or other life critical applications.
|
309 |
+
NVIDIA does not design, test or manufacture the SDK for
|
310 |
+
these critical uses and NVIDIA shall not be liable to you
|
311 |
+
or any third party, in whole or in part, for any claims or
|
312 |
+
damages arising from such uses.
|
313 |
+
|
314 |
+
7. You agree to defend, indemnify and hold harmless NVIDIA
|
315 |
+
and its affiliates, and their respective employees,
|
316 |
+
contractors, agents, officers and directors, from and
|
317 |
+
against any and all claims, damages, obligations, losses,
|
318 |
+
liabilities, costs or debt, fines, restitutions and
|
319 |
+
expenses (including but not limited to attorney’s fees
|
320 |
+
and costs incident to establishing the right of
|
321 |
+
indemnification) arising out of or related to your use of
|
322 |
+
the SDK outside of the scope of this Agreement, or not in
|
323 |
+
compliance with its terms.
|
324 |
+
|
325 |
+
|
326 |
+
1.3. Ownership
|
327 |
+
|
328 |
+
1. NVIDIA or its licensors hold all rights, title and
|
329 |
+
interest in and to the SDK and its modifications and
|
330 |
+
derivative works, including their respective intellectual
|
331 |
+
property rights, subject to your rights described in this
|
332 |
+
section. This SDK may include software and materials from
|
333 |
+
NVIDIA’s licensors, and these licensors are intended
|
334 |
+
third party beneficiaries that may enforce this Agreement
|
335 |
+
with respect to their intellectual property rights.
|
336 |
+
|
337 |
+
2. You hold all rights, title and interest in and to your
|
338 |
+
applications and your derivative works of the sample
|
339 |
+
source code delivered in the SDK, including their
|
340 |
+
respective intellectual property rights, subject to
|
341 |
+
NVIDIA’s rights described in this section.
|
342 |
+
|
343 |
+
3. You may, but don’t have to, provide to NVIDIA
|
344 |
+
suggestions, feature requests or other feedback regarding
|
345 |
+
the SDK, including possible enhancements or modifications
|
346 |
+
to the SDK. For any feedback that you voluntarily provide,
|
347 |
+
you hereby grant NVIDIA and its affiliates a perpetual,
|
348 |
+
non-exclusive, worldwide, irrevocable license to use,
|
349 |
+
reproduce, modify, license, sublicense (through multiple
|
350 |
+
tiers of sublicensees), and distribute (through multiple
|
351 |
+
tiers of distributors) it without the payment of any
|
352 |
+
royalties or fees to you. NVIDIA will use feedback at its
|
353 |
+
choice. NVIDIA is constantly looking for ways to improve
|
354 |
+
its products, so you may send feedback to NVIDIA through
|
355 |
+
the developer portal at https://developer.nvidia.com.
|
356 |
+
|
357 |
+
|
358 |
+
1.4. No Warranties
|
359 |
+
|
360 |
+
THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL
|
361 |
+
FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND
|
362 |
+
ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND
|
363 |
+
OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
|
364 |
+
BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
|
365 |
+
FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE
|
366 |
+
ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO
|
367 |
+
WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF
|
368 |
+
DEALING OR COURSE OF TRADE.
|
369 |
+
|
370 |
+
|
371 |
+
1.5. Limitation of Liability
|
372 |
+
|
373 |
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS
|
374 |
+
AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
375 |
+
PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS
|
376 |
+
OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF
|
377 |
+
PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION
|
378 |
+
WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF THE SDK,
|
379 |
+
WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH
|
380 |
+
OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE),
|
381 |
+
PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF
|
382 |
+
LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES
|
383 |
+
TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS
|
384 |
+
AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE
|
385 |
+
NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS
|
386 |
+
LIMIT.
|
387 |
+
|
388 |
+
These exclusions and limitations of liability shall apply
|
389 |
+
regardless if NVIDIA or its affiliates have been advised of
|
390 |
+
the possibility of such damages, and regardless of whether a
|
391 |
+
remedy fails its essential purpose. These exclusions and
|
392 |
+
limitations of liability form an essential basis of the
|
393 |
+
bargain between the parties, and, absent any of these
|
394 |
+
exclusions or limitations of liability, the provisions of this
|
395 |
+
Agreement, including, without limitation, the economic terms,
|
396 |
+
would be substantially different.
|
397 |
+
|
398 |
+
|
399 |
+
1.6. Termination
|
400 |
+
|
401 |
+
1. This Agreement will continue to apply until terminated by
|
402 |
+
either you or NVIDIA as described below.
|
403 |
+
|
404 |
+
2. If you want to terminate this Agreement, you may do so by
|
405 |
+
stopping to use the SDK.
|
406 |
+
|
407 |
+
3. NVIDIA may, at any time, terminate this Agreement if:
|
408 |
+
|
409 |
+
a. (i) you fail to comply with any term of this
|
410 |
+
Agreement and the non-compliance is not fixed within
|
411 |
+
thirty (30) days following notice from NVIDIA (or
|
412 |
+
immediately if you violate NVIDIA’s intellectual
|
413 |
+
property rights);
|
414 |
+
|
415 |
+
b. (ii) you commence or participate in any legal
|
416 |
+
proceeding against NVIDIA with respect to the SDK; or
|
417 |
+
|
418 |
+
c. (iii) NVIDIA decides to no longer provide the SDK in
|
419 |
+
a country or, in NVIDIA’s sole discretion, the
|
420 |
+
continued use of it is no longer commercially viable.
|
421 |
+
|
422 |
+
4. Upon any termination of this Agreement, you agree to
|
423 |
+
promptly discontinue use of the SDK and destroy all copies
|
424 |
+
in your possession or control. Your prior distributions in
|
425 |
+
accordance with this Agreement are not affected by the
|
426 |
+
termination of this Agreement. Upon written request, you
|
427 |
+
will certify in writing that you have complied with your
|
428 |
+
commitments under this section. Upon any termination of
|
429 |
+
this Agreement all provisions survive except for the
|
430 |
+
license grant provisions.
|
431 |
+
|
432 |
+
|
433 |
+
1.7. General
|
434 |
+
|
435 |
+
If you wish to assign this Agreement or your rights and
|
436 |
+
obligations, including by merger, consolidation, dissolution
|
437 |
+
or operation of law, contact NVIDIA to ask for permission. Any
|
438 |
+
attempted assignment not approved by NVIDIA in writing shall
|
439 |
+
be void and of no effect. NVIDIA may assign, delegate or
|
440 |
+
transfer this Agreement and its rights and obligations, and if
|
441 |
+
to a non-affiliate you will be notified.
|
442 |
+
|
443 |
+
You agree to cooperate with NVIDIA and provide reasonably
|
444 |
+
requested information to verify your compliance with this
|
445 |
+
Agreement.
|
446 |
+
|
447 |
+
This Agreement will be governed in all respects by the laws of
|
448 |
+
the United States and of the State of Delaware as those laws
|
449 |
+
are applied to contracts entered into and performed entirely
|
450 |
+
within Delaware by Delaware residents, without regard to the
|
451 |
+
conflicts of laws principles. The United Nations Convention on
|
452 |
+
Contracts for the International Sale of Goods is specifically
|
453 |
+
disclaimed. You agree to all terms of this Agreement in the
|
454 |
+
English language.
|
455 |
+
|
456 |
+
The state or federal courts residing in Santa Clara County,
|
457 |
+
California shall have exclusive jurisdiction over any dispute
|
458 |
+
or claim arising out of this Agreement. Notwithstanding this,
|
459 |
+
you agree that NVIDIA shall still be allowed to apply for
|
460 |
+
injunctive remedies or an equivalent type of urgent legal
|
461 |
+
relief in any jurisdiction.
|
462 |
+
|
463 |
+
If any court of competent jurisdiction determines that any
|
464 |
+
provision of this Agreement is illegal, invalid or
|
465 |
+
unenforceable, such provision will be construed as limited to
|
466 |
+
the extent necessary to be consistent with and fully
|
467 |
+
enforceable under the law and the remaining provisions will
|
468 |
+
remain in full force and effect. Unless otherwise specified,
|
469 |
+
remedies are cumulative.
|
470 |
+
|
471 |
+
Each party acknowledges and agrees that the other is an
|
472 |
+
independent contractor in the performance of this Agreement.
|
473 |
+
|
474 |
+
The SDK has been developed entirely at private expense and is
|
475 |
+
“commercial items” consisting of “commercial computer
|
476 |
+
software” and “commercial computer software
|
477 |
+
documentation” provided with RESTRICTED RIGHTS. Use,
|
478 |
+
duplication or disclosure by the U.S. Government or a U.S.
|
479 |
+
Government subcontractor is subject to the restrictions in
|
480 |
+
this Agreement pursuant to DFARS 227.7202-3(a) or as set forth
|
481 |
+
in subparagraphs (c)(1) and (2) of the Commercial Computer
|
482 |
+
Software - Restricted Rights clause at FAR 52.227-19, as
|
483 |
+
applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas
|
484 |
+
Expressway, Santa Clara, CA 95051.
|
485 |
+
|
486 |
+
The SDK is subject to United States export laws and
|
487 |
+
regulations. You agree that you will not ship, transfer or
|
488 |
+
export the SDK into any country, or use the SDK in any manner,
|
489 |
+
prohibited by the United States Bureau of Industry and
|
490 |
+
Security or economic sanctions regulations administered by the
|
491 |
+
U.S. Department of Treasury’s Office of Foreign Assets
|
492 |
+
Control (OFAC), or any applicable export laws, restrictions or
|
493 |
+
regulations. These laws include restrictions on destinations,
|
494 |
+
end users and end use. By accepting this Agreement, you
|
495 |
+
confirm that you are not a resident or citizen of any country
|
496 |
+
currently embargoed by the U.S. and that you are not otherwise
|
497 |
+
prohibited from receiving the SDK.
|
498 |
+
|
499 |
+
Any notice delivered by NVIDIA to you under this Agreement
|
500 |
+
will be delivered via mail, email or fax. You agree that any
|
501 |
+
notices that NVIDIA sends you electronically will satisfy any
|
502 |
+
legal communication requirements. Please direct your legal
|
503 |
+
notices or other correspondence to NVIDIA Corporation, 2788
|
504 |
+
San Tomas Expressway, Santa Clara, California 95051, United
|
505 |
+
States of America, Attention: Legal Department.
|
506 |
+
|
507 |
+
This Agreement and any exhibits incorporated into this
|
508 |
+
Agreement constitute the entire agreement of the parties with
|
509 |
+
respect to the subject matter of this Agreement and supersede
|
510 |
+
all prior negotiations or documentation exchanged between the
|
511 |
+
parties relating to this SDK license. Any additional and/or
|
512 |
+
conflicting terms on documents issued by you are null, void,
|
513 |
+
and invalid. Any amendment or waiver under this Agreement
|
514 |
+
shall be in writing and signed by representatives of both
|
515 |
+
parties.
|
516 |
+
|
517 |
+
|
518 |
+
2. CUDA Toolkit Supplement to Software License Agreement for
|
519 |
+
NVIDIA Software Development Kits
|
520 |
+
------------------------------------------------------------
|
521 |
+
|
522 |
+
|
523 |
+
Release date: August 16, 2018
|
524 |
+
-----------------------------
|
525 |
+
|
526 |
+
The terms in this supplement govern your use of the NVIDIA
|
527 |
+
CUDA Toolkit SDK under the terms of your license agreement
|
528 |
+
(“Agreement”) as modified by this supplement. Capitalized
|
529 |
+
terms used but not defined below have the meaning assigned to
|
530 |
+
them in the Agreement.
|
531 |
+
|
532 |
+
This supplement is an exhibit to the Agreement and is
|
533 |
+
incorporated as an integral part of the Agreement. In the
|
534 |
+
event of conflict between the terms in this supplement and the
|
535 |
+
terms in the Agreement, the terms in this supplement govern.
|
536 |
+
|
537 |
+
|
538 |
+
2.1. License Scope
|
539 |
+
|
540 |
+
The SDK is licensed for you to develop applications only for
|
541 |
+
use in systems with NVIDIA GPUs.
|
542 |
+
|
543 |
+
|
544 |
+
2.2. Distribution
|
545 |
+
|
546 |
+
The portions of the SDK that are distributable under the
|
547 |
+
Agreement are listed in Attachment A.
|
548 |
+
|
549 |
+
|
550 |
+
2.3. Operating Systems
|
551 |
+
|
552 |
+
Those portions of the SDK designed exclusively for use on the
|
553 |
+
Linux or FreeBSD operating systems, or other operating systems
|
554 |
+
derived from the source code to these operating systems, may
|
555 |
+
be copied and redistributed for use in accordance with this
|
556 |
+
Agreement, provided that the object code files are not
|
557 |
+
modified in any way (except for unzipping of compressed
|
558 |
+
files).
|
559 |
+
|
560 |
+
|
561 |
+
2.4. Audio and Video Encoders and Decoders
|
562 |
+
|
563 |
+
You acknowledge and agree that it is your sole responsibility
|
564 |
+
to obtain any additional third-party licenses required to
|
565 |
+
make, have made, use, have used, sell, import, and offer for
|
566 |
+
sale your products or services that include or incorporate any
|
567 |
+
third-party software and content relating to audio and/or
|
568 |
+
video encoders and decoders from, including but not limited
|
569 |
+
to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A.,
|
570 |
+
MPEG-LA, and Coding Technologies. NVIDIA does not grant to you
|
571 |
+
under this Agreement any necessary patent or other rights with
|
572 |
+
respect to any audio and/or video encoders and decoders.
|
573 |
+
|
574 |
+
|
575 |
+
2.5. Licensing
|
576 |
+
|
577 |
+
If the distribution terms in this Agreement are not suitable
|
578 |
+
for your organization, or for any questions regarding this
|
579 |
+
Agreement, please contact NVIDIA at
|
580 | |
581 |
+
|
582 |
+
|
583 |
+
2.6. Attachment A
|
584 |
+
|
585 |
+
The following portions of the SDK are distributable under the
|
586 |
+
Agreement:
|
587 |
+
|
588 |
+
Component
|
589 |
+
|
590 |
+
CUDA Runtime
|
591 |
+
|
592 |
+
Windows
|
593 |
+
|
594 |
+
cudart.dll, cudart_static.lib, cudadevrt.lib
|
595 |
+
|
596 |
+
Mac OSX
|
597 |
+
|
598 |
+
libcudart.dylib, libcudart_static.a, libcudadevrt.a
|
599 |
+
|
600 |
+
Linux
|
601 |
+
|
602 |
+
libcudart.so, libcudart_static.a, libcudadevrt.a
|
603 |
+
|
604 |
+
Android
|
605 |
+
|
606 |
+
libcudart.so, libcudart_static.a, libcudadevrt.a
|
607 |
+
|
608 |
+
Component
|
609 |
+
|
610 |
+
CUDA FFT Library
|
611 |
+
|
612 |
+
Windows
|
613 |
+
|
614 |
+
cufft.dll, cufftw.dll, cufft.lib, cufftw.lib
|
615 |
+
|
616 |
+
Mac OSX
|
617 |
+
|
618 |
+
libcufft.dylib, libcufft_static.a, libcufftw.dylib,
|
619 |
+
libcufftw_static.a
|
620 |
+
|
621 |
+
Linux
|
622 |
+
|
623 |
+
libcufft.so, libcufft_static.a, libcufftw.so,
|
624 |
+
libcufftw_static.a
|
625 |
+
|
626 |
+
Android
|
627 |
+
|
628 |
+
libcufft.so, libcufft_static.a, libcufftw.so,
|
629 |
+
libcufftw_static.a
|
630 |
+
|
631 |
+
Component
|
632 |
+
|
633 |
+
CUDA BLAS Library
|
634 |
+
|
635 |
+
Windows
|
636 |
+
|
637 |
+
cublas.dll, cublasLt.dll
|
638 |
+
|
639 |
+
Mac OSX
|
640 |
+
|
641 |
+
libcublas.dylib, libcublasLt.dylib, libcublas_static.a,
|
642 |
+
libcublasLt_static.a
|
643 |
+
|
644 |
+
Linux
|
645 |
+
|
646 |
+
libcublas.so, libcublasLt.so, libcublas_static.a,
|
647 |
+
libcublasLt_static.a
|
648 |
+
|
649 |
+
Android
|
650 |
+
|
651 |
+
libcublas.so, libcublasLt.so, libcublas_static.a,
|
652 |
+
libcublasLt_static.a
|
653 |
+
|
654 |
+
Component
|
655 |
+
|
656 |
+
NVIDIA "Drop-in" BLAS Library
|
657 |
+
|
658 |
+
Windows
|
659 |
+
|
660 |
+
nvblas.dll
|
661 |
+
|
662 |
+
Mac OSX
|
663 |
+
|
664 |
+
libnvblas.dylib
|
665 |
+
|
666 |
+
Linux
|
667 |
+
|
668 |
+
libnvblas.so
|
669 |
+
|
670 |
+
Component
|
671 |
+
|
672 |
+
CUDA Sparse Matrix Library
|
673 |
+
|
674 |
+
Windows
|
675 |
+
|
676 |
+
cusparse.dll, cusparse.lib
|
677 |
+
|
678 |
+
Mac OSX
|
679 |
+
|
680 |
+
libcusparse.dylib, libcusparse_static.a
|
681 |
+
|
682 |
+
Linux
|
683 |
+
|
684 |
+
libcusparse.so, libcusparse_static.a
|
685 |
+
|
686 |
+
Android
|
687 |
+
|
688 |
+
libcusparse.so, libcusparse_static.a
|
689 |
+
|
690 |
+
Component
|
691 |
+
|
692 |
+
CUDA Linear Solver Library
|
693 |
+
|
694 |
+
Windows
|
695 |
+
|
696 |
+
cusolver.dll, cusolver.lib
|
697 |
+
|
698 |
+
Mac OSX
|
699 |
+
|
700 |
+
libcusolver.dylib, libcusolver_static.a
|
701 |
+
|
702 |
+
Linux
|
703 |
+
|
704 |
+
libcusolver.so, libcusolver_static.a
|
705 |
+
|
706 |
+
Android
|
707 |
+
|
708 |
+
libcusolver.so, libcusolver_static.a
|
709 |
+
|
710 |
+
Component
|
711 |
+
|
712 |
+
CUDA Random Number Generation Library
|
713 |
+
|
714 |
+
Windows
|
715 |
+
|
716 |
+
curand.dll, curand.lib
|
717 |
+
|
718 |
+
Mac OSX
|
719 |
+
|
720 |
+
libcurand.dylib, libcurand_static.a
|
721 |
+
|
722 |
+
Linux
|
723 |
+
|
724 |
+
libcurand.so, libcurand_static.a
|
725 |
+
|
726 |
+
Android
|
727 |
+
|
728 |
+
libcurand.so, libcurand_static.a
|
729 |
+
|
730 |
+
Component
|
731 |
+
|
732 |
+
CUDA Accelerated Graph Library
|
733 |
+
|
734 |
+
Component
|
735 |
+
|
736 |
+
NVIDIA Performance Primitives Library
|
737 |
+
|
738 |
+
Windows
|
739 |
+
|
740 |
+
nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll,
|
741 |
+
nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll,
|
742 |
+
nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib,
|
743 |
+
nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll,
|
744 |
+
nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib
|
745 |
+
|
746 |
+
Mac OSX
|
747 |
+
|
748 |
+
libnppc.dylib, libnppc_static.a, libnppial.dylib,
|
749 |
+
libnppial_static.a, libnppicc.dylib, libnppicc_static.a,
|
750 |
+
libnppicom.dylib, libnppicom_static.a, libnppidei.dylib,
|
751 |
+
libnppidei_static.a, libnppif.dylib, libnppif_static.a,
|
752 |
+
libnppig.dylib, libnppig_static.a, libnppim.dylib,
|
753 |
+
libnppisu_static.a, libnppitc.dylib, libnppitc_static.a,
|
754 |
+
libnpps.dylib, libnpps_static.a
|
755 |
+
|
756 |
+
Linux
|
757 |
+
|
758 |
+
libnppc.so, libnppc_static.a, libnppial.so,
|
759 |
+
libnppial_static.a, libnppicc.so, libnppicc_static.a,
|
760 |
+
libnppicom.so, libnppicom_static.a, libnppidei.so,
|
761 |
+
libnppidei_static.a, libnppif.so, libnppif_static.a
|
762 |
+
libnppig.so, libnppig_static.a, libnppim.so,
|
763 |
+
libnppim_static.a, libnppist.so, libnppist_static.a,
|
764 |
+
libnppisu.so, libnppisu_static.a, libnppitc.so
|
765 |
+
libnppitc_static.a, libnpps.so, libnpps_static.a
|
766 |
+
|
767 |
+
Android
|
768 |
+
|
769 |
+
libnppc.so, libnppc_static.a, libnppial.so,
|
770 |
+
libnppial_static.a, libnppicc.so, libnppicc_static.a,
|
771 |
+
libnppicom.so, libnppicom_static.a, libnppidei.so,
|
772 |
+
libnppidei_static.a, libnppif.so, libnppif_static.a
|
773 |
+
libnppig.so, libnppig_static.a, libnppim.so,
|
774 |
+
libnppim_static.a, libnppist.so, libnppist_static.a,
|
775 |
+
libnppisu.so, libnppisu_static.a, libnppitc.so
|
776 |
+
libnppitc_static.a, libnpps.so, libnpps_static.a
|
777 |
+
|
778 |
+
Component
|
779 |
+
|
780 |
+
NVIDIA JPEG Library
|
781 |
+
|
782 |
+
Linux
|
783 |
+
|
784 |
+
libnvjpeg.so, libnvjpeg_static.a
|
785 |
+
|
786 |
+
Component
|
787 |
+
|
788 |
+
Internal common library required for statically linking to
|
789 |
+
cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP
|
790 |
+
|
791 |
+
Mac OSX
|
792 |
+
|
793 |
+
libculibos.a
|
794 |
+
|
795 |
+
Linux
|
796 |
+
|
797 |
+
libculibos.a
|
798 |
+
|
799 |
+
Component
|
800 |
+
|
801 |
+
NVIDIA Runtime Compilation Library and Header
|
802 |
+
|
803 |
+
All
|
804 |
+
|
805 |
+
nvrtc.h
|
806 |
+
|
807 |
+
Windows
|
808 |
+
|
809 |
+
nvrtc.dll, nvrtc-builtins.dll
|
810 |
+
|
811 |
+
Mac OSX
|
812 |
+
|
813 |
+
libnvrtc.dylib, libnvrtc-builtins.dylib
|
814 |
+
|
815 |
+
Linux
|
816 |
+
|
817 |
+
libnvrtc.so, libnvrtc-builtins.so
|
818 |
+
|
819 |
+
Component
|
820 |
+
|
821 |
+
NVIDIA Optimizing Compiler Library
|
822 |
+
|
823 |
+
Windows
|
824 |
+
|
825 |
+
nvvm.dll
|
826 |
+
|
827 |
+
Mac OSX
|
828 |
+
|
829 |
+
libnvvm.dylib
|
830 |
+
|
831 |
+
Linux
|
832 |
+
|
833 |
+
libnvvm.so
|
834 |
+
|
835 |
+
Component
|
836 |
+
|
837 |
+
NVIDIA Common Device Math Functions Library
|
838 |
+
|
839 |
+
Windows
|
840 |
+
|
841 |
+
libdevice.10.bc
|
842 |
+
|
843 |
+
Mac OSX
|
844 |
+
|
845 |
+
libdevice.10.bc
|
846 |
+
|
847 |
+
Linux
|
848 |
+
|
849 |
+
libdevice.10.bc
|
850 |
+
|
851 |
+
Component
|
852 |
+
|
853 |
+
CUDA Occupancy Calculation Header Library
|
854 |
+
|
855 |
+
All
|
856 |
+
|
857 |
+
cuda_occupancy.h
|
858 |
+
|
859 |
+
Component
|
860 |
+
|
861 |
+
CUDA Half Precision Headers
|
862 |
+
|
863 |
+
All
|
864 |
+
|
865 |
+
cuda_fp16.h, cuda_fp16.hpp
|
866 |
+
|
867 |
+
Component
|
868 |
+
|
869 |
+
CUDA Profiling Tools Interface (CUPTI) Library
|
870 |
+
|
871 |
+
Windows
|
872 |
+
|
873 |
+
cupti.dll
|
874 |
+
|
875 |
+
Mac OSX
|
876 |
+
|
877 |
+
libcupti.dylib
|
878 |
+
|
879 |
+
Linux
|
880 |
+
|
881 |
+
libcupti.so
|
882 |
+
|
883 |
+
Component
|
884 |
+
|
885 |
+
NVIDIA Tools Extension Library
|
886 |
+
|
887 |
+
Windows
|
888 |
+
|
889 |
+
nvToolsExt.dll, nvToolsExt.lib
|
890 |
+
|
891 |
+
Mac OSX
|
892 |
+
|
893 |
+
libnvToolsExt.dylib
|
894 |
+
|
895 |
+
Linux
|
896 |
+
|
897 |
+
libnvToolsExt.so
|
898 |
+
|
899 |
+
Component
|
900 |
+
|
901 |
+
NVIDIA CUDA Driver Libraries
|
902 |
+
|
903 |
+
Linux
|
904 |
+
|
905 |
+
libcuda.so, libnvidia-fatbinaryloader.so,
|
906 |
+
libnvidia-ptxjitcompiler.so
|
907 |
+
|
908 |
+
The NVIDIA CUDA Driver Libraries are only distributable in
|
909 |
+
applications that meet this criteria:
|
910 |
+
|
911 |
+
1. The application was developed starting from a NVIDIA CUDA
|
912 |
+
container obtained from Docker Hub or the NVIDIA GPU
|
913 |
+
Cloud, and
|
914 |
+
|
915 |
+
2. The resulting application is packaged as a Docker
|
916 |
+
container and distributed to users on Docker Hub or the
|
917 |
+
NVIDIA GPU Cloud only.
|
918 |
+
|
919 |
+
|
920 |
+
2.7. Attachment B
|
921 |
+
|
922 |
+
|
923 |
+
Additional Licensing Obligations
|
924 |
+
|
925 |
+
The following third party components included in the SOFTWARE
|
926 |
+
are licensed to Licensee pursuant to the following terms and
|
927 |
+
conditions:
|
928 |
+
|
929 |
+
1. Licensee's use of the GDB third party component is
|
930 |
+
subject to the terms and conditions of GNU GPL v3:
|
931 |
+
|
932 |
+
This product includes copyrighted third-party software licensed
|
933 |
+
under the terms of the GNU General Public License v3 ("GPL v3").
|
934 |
+
All third-party software packages are copyright by their respective
|
935 |
+
authors. GPL v3 terms and conditions are hereby incorporated into
|
936 |
+
the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt
|
937 |
+
|
938 |
+
Consistent with these licensing requirements, the software
|
939 |
+
listed below is provided under the terms of the specified
|
940 |
+
open source software licenses. To obtain source code for
|
941 |
+
software provided under licenses that require
|
942 |
+
redistribution of source code, including the GNU General
|
943 |
+
Public License (GPL) and GNU Lesser General Public License
|
944 |
+
(LGPL), contact [email protected]. This offer is
|
945 |
+
valid for a period of three (3) years from the date of the
|
946 |
+
distribution of this product by NVIDIA CORPORATION.
|
947 |
+
|
948 |
+
Component License
|
949 |
+
CUDA-GDB GPL v3
|
950 |
+
|
951 |
+
2. Licensee represents and warrants that any and all third
|
952 |
+
party licensing and/or royalty payment obligations in
|
953 |
+
connection with Licensee's use of the H.264 video codecs
|
954 |
+
are solely the responsibility of Licensee.
|
955 |
+
|
956 |
+
3. Licensee's use of the Thrust library is subject to the
|
957 |
+
terms and conditions of the Apache License Version 2.0.
|
958 |
+
All third-party software packages are copyright by their
|
959 |
+
respective authors. Apache License Version 2.0 terms and
|
960 |
+
conditions are hereby incorporated into the Agreement by
|
961 |
+
this reference.
|
962 |
+
http://www.apache.org/licenses/LICENSE-2.0.html
|
963 |
+
|
964 |
+
In addition, Licensee acknowledges the following notice:
|
965 |
+
Thrust includes source code from the Boost Iterator,
|
966 |
+
Tuple, System, and Random Number libraries.
|
967 |
+
|
968 |
+
Boost Software License - Version 1.0 - August 17th, 2003
|
969 |
+
. . . .
|
970 |
+
|
971 |
+
Permission is hereby granted, free of charge, to any person or
|
972 |
+
organization obtaining a copy of the software and accompanying
|
973 |
+
documentation covered by this license (the "Software") to use,
|
974 |
+
reproduce, display, distribute, execute, and transmit the Software,
|
975 |
+
and to prepare derivative works of the Software, and to permit
|
976 |
+
third-parties to whom the Software is furnished to do so, all
|
977 |
+
subject to the following:
|
978 |
+
|
979 |
+
The copyright notices in the Software and this entire statement,
|
980 |
+
including the above license grant, this restriction and the following
|
981 |
+
disclaimer, must be included in all copies of the Software, in whole
|
982 |
+
or in part, and all derivative works of the Software, unless such
|
983 |
+
copies or derivative works are solely in the form of machine-executable
|
984 |
+
object code generated by a source language processor.
|
985 |
+
|
986 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
987 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
988 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
989 |
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
990 |
+
ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
|
991 |
+
OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
|
992 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
993 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
994 |
+
|
995 |
+
4. Licensee's use of the LLVM third party component is
|
996 |
+
subject to the following terms and conditions:
|
997 |
+
|
998 |
+
======================================================
|
999 |
+
LLVM Release License
|
1000 |
+
======================================================
|
1001 |
+
University of Illinois/NCSA
|
1002 |
+
Open Source License
|
1003 |
+
|
1004 |
+
Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
|
1005 |
+
All rights reserved.
|
1006 |
+
|
1007 |
+
Developed by:
|
1008 |
+
|
1009 |
+
LLVM Team
|
1010 |
+
|
1011 |
+
University of Illinois at Urbana-Champaign
|
1012 |
+
|
1013 |
+
http://llvm.org
|
1014 |
+
|
1015 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
1016 |
+
of this software and associated documentation files (the "Software"), to
|
1017 |
+
deal with the Software without restriction, including without limitation the
|
1018 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
1019 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
1020 |
+
furnished to do so, subject to the following conditions:
|
1021 |
+
|
1022 |
+
* Redistributions of source code must retain the above copyright notice,
|
1023 |
+
this list of conditions and the following disclaimers.
|
1024 |
+
|
1025 |
+
* Redistributions in binary form must reproduce the above copyright
|
1026 |
+
notice, this list of conditions and the following disclaimers in the
|
1027 |
+
documentation and/or other materials provided with the distribution.
|
1028 |
+
|
1029 |
+
* Neither the names of the LLVM Team, University of Illinois at Urbana-
|
1030 |
+
Champaign, nor the names of its contributors may be used to endorse or
|
1031 |
+
promote products derived from this Software without specific prior
|
1032 |
+
written permission.
|
1033 |
+
|
1034 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1035 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1036 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
1037 |
+
THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
1038 |
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
1039 |
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
1040 |
+
DEALINGS WITH THE SOFTWARE.
|
1041 |
+
|
1042 |
+
5. Licensee's use (e.g. nvprof) of the PCRE third party
|
1043 |
+
component is subject to the following terms and
|
1044 |
+
conditions:
|
1045 |
+
|
1046 |
+
------------
|
1047 |
+
PCRE LICENCE
|
1048 |
+
------------
|
1049 |
+
PCRE is a library of functions to support regular expressions whose syntax
|
1050 |
+
and semantics are as close as possible to those of the Perl 5 language.
|
1051 |
+
Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
|
1052 |
+
specified below. The documentation for PCRE, supplied in the "doc"
|
1053 |
+
directory, is distributed under the same terms as the software itself. The
|
1054 |
+
basic library functions are written in C and are freestanding. Also
|
1055 |
+
included in the distribution is a set of C++ wrapper functions, and a just-
|
1056 |
+
in-time compiler that can be used to optimize pattern matching. These are
|
1057 |
+
both optional features that can be omitted when the library is built.
|
1058 |
+
|
1059 |
+
THE BASIC LIBRARY FUNCTIONS
|
1060 |
+
---------------------------
|
1061 |
+
Written by: Philip Hazel
|
1062 |
+
Email local part: ph10
|
1063 |
+
Email domain: cam.ac.uk
|
1064 |
+
University of Cambridge Computing Service,
|
1065 |
+
Cambridge, England.
|
1066 |
+
Copyright (c) 1997-2012 University of Cambridge
|
1067 |
+
All rights reserved.
|
1068 |
+
|
1069 |
+
PCRE JUST-IN-TIME COMPILATION SUPPORT
|
1070 |
+
-------------------------------------
|
1071 |
+
Written by: Zoltan Herczeg
|
1072 |
+
Email local part: hzmester
|
1073 |
+
Emain domain: freemail.hu
|
1074 |
+
Copyright(c) 2010-2012 Zoltan Herczeg
|
1075 |
+
All rights reserved.
|
1076 |
+
|
1077 |
+
STACK-LESS JUST-IN-TIME COMPILER
|
1078 |
+
--------------------------------
|
1079 |
+
Written by: Zoltan Herczeg
|
1080 |
+
Email local part: hzmester
|
1081 |
+
Emain domain: freemail.hu
|
1082 |
+
Copyright(c) 2009-2012 Zoltan Herczeg
|
1083 |
+
All rights reserved.
|
1084 |
+
|
1085 |
+
THE C++ WRAPPER FUNCTIONS
|
1086 |
+
-------------------------
|
1087 |
+
Contributed by: Google Inc.
|
1088 |
+
Copyright (c) 2007-2012, Google Inc.
|
1089 |
+
All rights reserved.
|
1090 |
+
|
1091 |
+
THE "BSD" LICENCE
|
1092 |
+
-----------------
|
1093 |
+
Redistribution and use in source and binary forms, with or without
|
1094 |
+
modification, are permitted provided that the following conditions are met:
|
1095 |
+
|
1096 |
+
* Redistributions of source code must retain the above copyright notice,
|
1097 |
+
this list of conditions and the following disclaimer.
|
1098 |
+
|
1099 |
+
* Redistributions in binary form must reproduce the above copyright
|
1100 |
+
notice, this list of conditions and the following disclaimer in the
|
1101 |
+
documentation and/or other materials provided with the distribution.
|
1102 |
+
|
1103 |
+
* Neither the name of the University of Cambridge nor the name of Google
|
1104 |
+
Inc. nor the names of their contributors may be used to endorse or
|
1105 |
+
promote products derived from this software without specific prior
|
1106 |
+
written permission.
|
1107 |
+
|
1108 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
1109 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
1110 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
1111 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
1112 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1113 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
1114 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
1115 |
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
1116 |
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
1117 |
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1118 |
+
POSSIBILITY OF SUCH DAMAGE.
|
1119 |
+
|
1120 |
+
6. Some of the cuBLAS library routines were written by or
|
1121 |
+
derived from code written by Vasily Volkov and are subject
|
1122 |
+
to the Modified Berkeley Software Distribution License as
|
1123 |
+
follows:
|
1124 |
+
|
1125 |
+
Copyright (c) 2007-2009, Regents of the University of California
|
1126 |
+
|
1127 |
+
All rights reserved.
|
1128 |
+
|
1129 |
+
Redistribution and use in source and binary forms, with or without
|
1130 |
+
modification, are permitted provided that the following conditions are
|
1131 |
+
met:
|
1132 |
+
* Redistributions of source code must retain the above copyright
|
1133 |
+
notice, this list of conditions and the following disclaimer.
|
1134 |
+
* Redistributions in binary form must reproduce the above
|
1135 |
+
copyright notice, this list of conditions and the following
|
1136 |
+
disclaimer in the documentation and/or other materials provided
|
1137 |
+
with the distribution.
|
1138 |
+
* Neither the name of the University of California, Berkeley nor
|
1139 |
+
the names of its contributors may be used to endorse or promote
|
1140 |
+
products derived from this software without specific prior
|
1141 |
+
written permission.
|
1142 |
+
|
1143 |
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
1144 |
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
1145 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
1146 |
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
1147 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
1148 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
1149 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
1150 |
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
1151 |
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
1152 |
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1153 |
+
POSSIBILITY OF SUCH DAMAGE.
|
1154 |
+
|
1155 |
+
7. Some of the cuBLAS library routines were written by or
|
1156 |
+
derived from code written by Davide Barbieri and are
|
1157 |
+
subject to the Modified Berkeley Software Distribution
|
1158 |
+
License as follows:
|
1159 |
+
|
1160 |
+
Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata.
|
1161 |
+
|
1162 |
+
All rights reserved.
|
1163 |
+
|
1164 |
+
Redistribution and use in source and binary forms, with or without
|
1165 |
+
modification, are permitted provided that the following conditions are
|
1166 |
+
met:
|
1167 |
+
* Redistributions of source code must retain the above copyright
|
1168 |
+
notice, this list of conditions and the following disclaimer.
|
1169 |
+
* Redistributions in binary form must reproduce the above
|
1170 |
+
copyright notice, this list of conditions and the following
|
1171 |
+
disclaimer in the documentation and/or other materials provided
|
1172 |
+
with the distribution.
|
1173 |
+
* The name of the author may not be used to endorse or promote
|
1174 |
+
products derived from this software without specific prior
|
1175 |
+
written permission.
|
1176 |
+
|
1177 |
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
1178 |
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
1179 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
1180 |
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
1181 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
1182 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
1183 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
1184 |
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
1185 |
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
1186 |
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1187 |
+
POSSIBILITY OF SUCH DAMAGE.
|
1188 |
+
|
1189 |
+
8. Some of the cuBLAS library routines were derived from
|
1190 |
+
code developed by the University of Tennessee and are
|
1191 |
+
subject to the Modified Berkeley Software Distribution
|
1192 |
+
License as follows:
|
1193 |
+
|
1194 |
+
Copyright (c) 2010 The University of Tennessee.
|
1195 |
+
|
1196 |
+
All rights reserved.
|
1197 |
+
|
1198 |
+
Redistribution and use in source and binary forms, with or without
|
1199 |
+
modification, are permitted provided that the following conditions are
|
1200 |
+
met:
|
1201 |
+
* Redistributions of source code must retain the above copyright
|
1202 |
+
notice, this list of conditions and the following disclaimer.
|
1203 |
+
* Redistributions in binary form must reproduce the above
|
1204 |
+
copyright notice, this list of conditions and the following
|
1205 |
+
disclaimer listed in this license in the documentation and/or
|
1206 |
+
other materials provided with the distribution.
|
1207 |
+
* Neither the name of the copyright holders nor the names of its
|
1208 |
+
contributors may be used to endorse or promote products derived
|
1209 |
+
from this software without specific prior written permission.
|
1210 |
+
|
1211 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1212 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1213 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1214 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1215 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1216 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1217 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1218 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1219 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1220 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1221 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1222 |
+
|
1223 |
+
9. Some of the cuBLAS library routines were written by or
|
1224 |
+
derived from code written by Jonathan Hogg and are subject
|
1225 |
+
to the Modified Berkeley Software Distribution License as
|
1226 |
+
follows:
|
1227 |
+
|
1228 |
+
Copyright (c) 2012, The Science and Technology Facilities Council (STFC).
|
1229 |
+
|
1230 |
+
All rights reserved.
|
1231 |
+
|
1232 |
+
Redistribution and use in source and binary forms, with or without
|
1233 |
+
modification, are permitted provided that the following conditions are
|
1234 |
+
met:
|
1235 |
+
* Redistributions of source code must retain the above copyright
|
1236 |
+
notice, this list of conditions and the following disclaimer.
|
1237 |
+
* Redistributions in binary form must reproduce the above
|
1238 |
+
copyright notice, this list of conditions and the following
|
1239 |
+
disclaimer in the documentation and/or other materials provided
|
1240 |
+
with the distribution.
|
1241 |
+
* Neither the name of the STFC nor the names of its contributors
|
1242 |
+
may be used to endorse or promote products derived from this
|
1243 |
+
software without specific prior written permission.
|
1244 |
+
|
1245 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1246 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1247 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1248 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE
|
1249 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1250 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
1251 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
1252 |
+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
1253 |
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
1254 |
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
1255 |
+
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1256 |
+
|
1257 |
+
10. Some of the cuBLAS library routines were written by or
|
1258 |
+
derived from code written by Ahmad M. Abdelfattah, David
|
1259 |
+
Keyes, and Hatem Ltaief, and are subject to the Apache
|
1260 |
+
License, Version 2.0, as follows:
|
1261 |
+
|
1262 |
+
-- (C) Copyright 2013 King Abdullah University of Science and Technology
|
1263 |
+
Authors:
|
1264 |
+
Ahmad Abdelfattah ([email protected])
|
1265 |
+
David Keyes ([email protected])
|
1266 |
+
Hatem Ltaief ([email protected])
|
1267 |
+
|
1268 |
+
Redistribution and use in source and binary forms, with or without
|
1269 |
+
modification, are permitted provided that the following conditions
|
1270 |
+
are met:
|
1271 |
+
|
1272 |
+
* Redistributions of source code must retain the above copyright
|
1273 |
+
notice, this list of conditions and the following disclaimer.
|
1274 |
+
* Redistributions in binary form must reproduce the above copyright
|
1275 |
+
notice, this list of conditions and the following disclaimer in the
|
1276 |
+
documentation and/or other materials provided with the distribution.
|
1277 |
+
* Neither the name of the King Abdullah University of Science and
|
1278 |
+
Technology nor the names of its contributors may be used to endorse
|
1279 |
+
or promote products derived from this software without specific prior
|
1280 |
+
written permission.
|
1281 |
+
|
1282 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1283 |
+
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1284 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1285 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1286 |
+
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1287 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1288 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1289 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1290 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1291 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1292 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
1293 |
+
|
1294 |
+
11. Some of the cuSPARSE library routines were written by or
|
1295 |
+
derived from code written by Li-Wen Chang and are subject
|
1296 |
+
to the NCSA Open Source License as follows:
|
1297 |
+
|
1298 |
+
Copyright (c) 2012, University of Illinois.
|
1299 |
+
|
1300 |
+
All rights reserved.
|
1301 |
+
|
1302 |
+
Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu
|
1303 |
+
|
1304 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
1305 |
+
a copy of this software and associated documentation files (the
|
1306 |
+
"Software"), to deal with the Software without restriction, including
|
1307 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
1308 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
1309 |
+
permit persons to whom the Software is furnished to do so, subject to
|
1310 |
+
the following conditions:
|
1311 |
+
* Redistributions of source code must retain the above copyright
|
1312 |
+
notice, this list of conditions and the following disclaimer.
|
1313 |
+
* Redistributions in binary form must reproduce the above
|
1314 |
+
copyright notice, this list of conditions and the following
|
1315 |
+
disclaimers in the documentation and/or other materials provided
|
1316 |
+
with the distribution.
|
1317 |
+
* Neither the names of IMPACT Group, University of Illinois, nor
|
1318 |
+
the names of its contributors may be used to endorse or promote
|
1319 |
+
products derived from this Software without specific prior
|
1320 |
+
written permission.
|
1321 |
+
|
1322 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
1323 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
1324 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
1325 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
|
1326 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
1327 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
1328 |
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
1329 |
+
SOFTWARE.
|
1330 |
+
|
1331 |
+
12. Some of the cuRAND library routines were written by or
|
1332 |
+
derived from code written by Mutsuo Saito and Makoto
|
1333 |
+
Matsumoto and are subject to the following license:
|
1334 |
+
|
1335 |
+
Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima
|
1336 |
+
University. All rights reserved.
|
1337 |
+
|
1338 |
+
Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima
|
1339 |
+
University and University of Tokyo. All rights reserved.
|
1340 |
+
|
1341 |
+
Redistribution and use in source and binary forms, with or without
|
1342 |
+
modification, are permitted provided that the following conditions are
|
1343 |
+
met:
|
1344 |
+
* Redistributions of source code must retain the above copyright
|
1345 |
+
notice, this list of conditions and the following disclaimer.
|
1346 |
+
* Redistributions in binary form must reproduce the above
|
1347 |
+
copyright notice, this list of conditions and the following
|
1348 |
+
disclaimer in the documentation and/or other materials provided
|
1349 |
+
with the distribution.
|
1350 |
+
* Neither the name of the Hiroshima University nor the names of
|
1351 |
+
its contributors may be used to endorse or promote products
|
1352 |
+
derived from this software without specific prior written
|
1353 |
+
permission.
|
1354 |
+
|
1355 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1356 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1357 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1358 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1359 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1360 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1361 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1362 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1363 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1364 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1365 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1366 |
+
|
1367 |
+
13. Some of the cuRAND library routines were derived from
|
1368 |
+
code developed by D. E. Shaw Research and are subject to
|
1369 |
+
the following license:
|
1370 |
+
|
1371 |
+
Copyright 2010-2011, D. E. Shaw Research.
|
1372 |
+
|
1373 |
+
All rights reserved.
|
1374 |
+
|
1375 |
+
Redistribution and use in source and binary forms, with or without
|
1376 |
+
modification, are permitted provided that the following conditions are
|
1377 |
+
met:
|
1378 |
+
* Redistributions of source code must retain the above copyright
|
1379 |
+
notice, this list of conditions, and the following disclaimer.
|
1380 |
+
* Redistributions in binary form must reproduce the above
|
1381 |
+
copyright notice, this list of conditions, and the following
|
1382 |
+
disclaimer in the documentation and/or other materials provided
|
1383 |
+
with the distribution.
|
1384 |
+
* Neither the name of D. E. Shaw Research nor the names of its
|
1385 |
+
contributors may be used to endorse or promote products derived
|
1386 |
+
from this software without specific prior written permission.
|
1387 |
+
|
1388 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1389 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1390 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1391 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1392 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1393 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1394 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1395 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1396 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1397 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1398 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1399 |
+
|
1400 |
+
14. Some of the Math library routines were written by or
|
1401 |
+
derived from code developed by Norbert Juffa and are
|
1402 |
+
subject to the following license:
|
1403 |
+
|
1404 |
+
Copyright (c) 2015-2017, Norbert Juffa
|
1405 |
+
All rights reserved.
|
1406 |
+
|
1407 |
+
Redistribution and use in source and binary forms, with or without
|
1408 |
+
modification, are permitted provided that the following conditions
|
1409 |
+
are met:
|
1410 |
+
|
1411 |
+
1. Redistributions of source code must retain the above copyright
|
1412 |
+
notice, this list of conditions and the following disclaimer.
|
1413 |
+
|
1414 |
+
2. Redistributions in binary form must reproduce the above copyright
|
1415 |
+
notice, this list of conditions and the following disclaimer in the
|
1416 |
+
documentation and/or other materials provided with the distribution.
|
1417 |
+
|
1418 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1419 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1420 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1421 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1422 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1423 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1424 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1425 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1426 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1427 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1428 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1429 |
+
|
1430 |
+
15. Licensee's use of the lz4 third party component is
|
1431 |
+
subject to the following terms and conditions:
|
1432 |
+
|
1433 |
+
Copyright (C) 2011-2013, Yann Collet.
|
1434 |
+
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
1435 |
+
|
1436 |
+
Redistribution and use in source and binary forms, with or without
|
1437 |
+
modification, are permitted provided that the following conditions are
|
1438 |
+
met:
|
1439 |
+
|
1440 |
+
* Redistributions of source code must retain the above copyright
|
1441 |
+
notice, this list of conditions and the following disclaimer.
|
1442 |
+
* Redistributions in binary form must reproduce the above
|
1443 |
+
copyright notice, this list of conditions and the following disclaimer
|
1444 |
+
in the documentation and/or other materials provided with the
|
1445 |
+
distribution.
|
1446 |
+
|
1447 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1448 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1449 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1450 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1451 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1452 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1453 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1454 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1455 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1456 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1457 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1458 |
+
|
1459 |
+
16. The NPP library uses code from the Boost Math Toolkit,
|
1460 |
+
and is subject to the following license:
|
1461 |
+
|
1462 |
+
Boost Software License - Version 1.0 - August 17th, 2003
|
1463 |
+
. . . .
|
1464 |
+
|
1465 |
+
Permission is hereby granted, free of charge, to any person or
|
1466 |
+
organization obtaining a copy of the software and accompanying
|
1467 |
+
documentation covered by this license (the "Software") to use,
|
1468 |
+
reproduce, display, distribute, execute, and transmit the Software,
|
1469 |
+
and to prepare derivative works of the Software, and to permit
|
1470 |
+
third-parties to whom the Software is furnished to do so, all
|
1471 |
+
subject to the following:
|
1472 |
+
|
1473 |
+
The copyright notices in the Software and this entire statement,
|
1474 |
+
including the above license grant, this restriction and the following
|
1475 |
+
disclaimer, must be included in all copies of the Software, in whole
|
1476 |
+
or in part, and all derivative works of the Software, unless such
|
1477 |
+
copies or derivative works are solely in the form of machine-executable
|
1478 |
+
object code generated by a source language processor.
|
1479 |
+
|
1480 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
1481 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
1482 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
1483 |
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
1484 |
+
ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
|
1485 |
+
OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
|
1486 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
1487 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
1488 |
+
|
1489 |
+
17. Portions of the Nsight Eclipse Edition is subject to the
|
1490 |
+
following license:
|
1491 |
+
|
1492 |
+
The Eclipse Foundation makes available all content in this plug-in
|
1493 |
+
("Content"). Unless otherwise indicated below, the Content is provided
|
1494 |
+
to you under the terms and conditions of the Eclipse Public License
|
1495 |
+
Version 1.0 ("EPL"). A copy of the EPL is available at http://
|
1496 |
+
www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program"
|
1497 |
+
will mean the Content.
|
1498 |
+
|
1499 |
+
If you did not receive this Content directly from the Eclipse
|
1500 |
+
Foundation, the Content is being redistributed by another party
|
1501 |
+
("Redistributor") and different terms and conditions may apply to your
|
1502 |
+
use of any object code in the Content. Check the Redistributor's
|
1503 |
+
license that was provided with the Content. If no such license exists,
|
1504 |
+
contact the Redistributor. Unless otherwise indicated below, the terms
|
1505 |
+
and conditions of the EPL still apply to any source code in the
|
1506 |
+
Content and such source code may be obtained at http://www.eclipse.org.
|
1507 |
+
|
1508 |
+
18. Some of the cuBLAS library routines uses code from
|
1509 |
+
OpenAI, which is subject to the following license:
|
1510 |
+
|
1511 |
+
License URL
|
1512 |
+
https://github.com/openai/openai-gemm/blob/master/LICENSE
|
1513 |
+
|
1514 |
+
License Text
|
1515 |
+
The MIT License
|
1516 |
+
|
1517 |
+
Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc.
|
1518 |
+
|
1519 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
1520 |
+
of this software and associated documentation files (the "Software"), to deal
|
1521 |
+
in the Software without restriction, including without limitation the rights
|
1522 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
1523 |
+
copies of the Software, and to permit persons to whom the Software is
|
1524 |
+
furnished to do so, subject to the following conditions:
|
1525 |
+
|
1526 |
+
The above copyright notice and this permission notice shall be included in
|
1527 |
+
all copies or substantial portions of the Software.
|
1528 |
+
|
1529 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1530 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1531 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1532 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1533 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1534 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1535 |
+
THE SOFTWARE.
|
1536 |
+
|
1537 |
+
19. Licensee's use of the Visual Studio Setup Configuration
|
1538 |
+
Samples is subject to the following license:
|
1539 |
+
|
1540 |
+
The MIT License (MIT)
|
1541 |
+
Copyright (C) Microsoft Corporation. All rights reserved.
|
1542 |
+
|
1543 |
+
Permission is hereby granted, free of charge, to any person
|
1544 |
+
obtaining a copy of this software and associated documentation
|
1545 |
+
files (the "Software"), to deal in the Software without restriction,
|
1546 |
+
including without limitation the rights to use, copy, modify, merge,
|
1547 |
+
publish, distribute, sublicense, and/or sell copies of the Software,
|
1548 |
+
and to permit persons to whom the Software is furnished to do so,
|
1549 |
+
subject to the following conditions:
|
1550 |
+
|
1551 |
+
The above copyright notice and this permission notice shall be included
|
1552 |
+
in all copies or substantial portions of the Software.
|
1553 |
+
|
1554 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
1555 |
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1556 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1557 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1558 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1559 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1560 |
+
|
1561 |
+
20. Licensee's use of linmath.h header for CPU functions for
|
1562 |
+
GL vector/matrix operations from lunarG is subject to the
|
1563 |
+
Apache License Version 2.0.
|
1564 |
+
|
1565 |
+
21. The DX12-CUDA sample uses the d3dx12.h header, which is
|
1566 |
+
subject to the MIT license .
|
1567 |
+
|
1568 |
+
-----------------
|
venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/METADATA
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: nvidia-cufft-cu12
|
3 |
+
Version: 11.0.2.54
|
4 |
+
Summary: CUFFT native runtime libraries
|
5 |
+
Home-page: https://developer.nvidia.com/cuda-zone
|
6 |
+
Author: Nvidia CUDA Installer Team
|
7 |
+
Author-email: [email protected]
|
8 |
+
License: NVIDIA Proprietary Software
|
9 |
+
Keywords: cuda,nvidia,runtime,machine learning,deep learning
|
10 |
+
Classifier: Development Status :: 4 - Beta
|
11 |
+
Classifier: Intended Audience :: Developers
|
12 |
+
Classifier: Intended Audience :: Education
|
13 |
+
Classifier: Intended Audience :: Science/Research
|
14 |
+
Classifier: License :: Other/Proprietary License
|
15 |
+
Classifier: Natural Language :: English
|
16 |
+
Classifier: Programming Language :: Python :: 3
|
17 |
+
Classifier: Programming Language :: Python :: 3.5
|
18 |
+
Classifier: Programming Language :: Python :: 3.6
|
19 |
+
Classifier: Programming Language :: Python :: 3.7
|
20 |
+
Classifier: Programming Language :: Python :: 3.8
|
21 |
+
Classifier: Programming Language :: Python :: 3.9
|
22 |
+
Classifier: Programming Language :: Python :: 3.10
|
23 |
+
Classifier: Programming Language :: Python :: 3.11
|
24 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
25 |
+
Classifier: Topic :: Scientific/Engineering
|
26 |
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
27 |
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
28 |
+
Classifier: Topic :: Software Development
|
29 |
+
Classifier: Topic :: Software Development :: Libraries
|
30 |
+
Classifier: Operating System :: Microsoft :: Windows
|
31 |
+
Classifier: Operating System :: POSIX :: Linux
|
32 |
+
Requires-Python: >=3
|
33 |
+
License-File: License.txt
|
34 |
+
|
35 |
+
CUFFT native runtime libraries
|
venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/RECORD
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
nvidia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2 |
+
nvidia/__pycache__/__init__.cpython-310.pyc,,
|
3 |
+
nvidia/cufft/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4 |
+
nvidia/cufft/__pycache__/__init__.cpython-310.pyc,,
|
5 |
+
nvidia/cufft/include/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6 |
+
nvidia/cufft/include/__pycache__/__init__.cpython-310.pyc,,
|
7 |
+
nvidia/cufft/include/cudalibxt.h,sha256=9GDuRiOzJuO61zRDhIpWpF7XHp8FXSOIlHJNoIMwOZQ,4105
|
8 |
+
nvidia/cufft/include/cufft.h,sha256=MHsb41y_Lj55kQTeXt5pn9cgia_7u3hSH4jQm08U8k0,12420
|
9 |
+
nvidia/cufft/include/cufftXt.h,sha256=0hetmhszhh_RDjw3vmxDvRncX-jrD0NgbWPRq-oJFeA,11746
|
10 |
+
nvidia/cufft/include/cufftw.h,sha256=DBrJQf-dnCWD-OYgdhnEzn8OiAX0U3xdteEaNdhs7mU,19412
|
11 |
+
nvidia/cufft/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12 |
+
nvidia/cufft/lib/__pycache__/__init__.cpython-310.pyc,,
|
13 |
+
nvidia/cufft/lib/libcufft.so.11,sha256=kgPaQUhKk8HaaEVnv21zJoe5sTB-MJglbLaSJdb1deQ,192713344
|
14 |
+
nvidia/cufft/lib/libcufftw.so.11,sha256=qwbZ38-viOwrz7TBa3b_C_OycoNw0hLihgf1Ph1A7_U,1614344
|
15 |
+
nvidia_cufft_cu12-11.0.2.54.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
16 |
+
nvidia_cufft_cu12-11.0.2.54.dist-info/License.txt,sha256=rW9YU_ugyg0VnQ9Y1JrkmDDC-Mk_epJki5zpCttMbM0,59262
|
17 |
+
nvidia_cufft_cu12-11.0.2.54.dist-info/METADATA,sha256=6txhpGTOdHVhh--CJT3Tk3_RD1Q3OwfmJaJYyWndqjg,1503
|
18 |
+
nvidia_cufft_cu12-11.0.2.54.dist-info/RECORD,,
|
19 |
+
nvidia_cufft_cu12-11.0.2.54.dist-info/WHEEL,sha256=-kQi_VMfvRQozZJT7HUPMfY-5vLo0LVTmAylNJ3Ft98,106
|
20 |
+
nvidia_cufft_cu12-11.0.2.54.dist-info/top_level.txt,sha256=fTkAtiFuL16nUrB9ytDDtpytz2t0B4NvYTnRzwAhO14,7
|
venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.37.1)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-manylinux1_x86_64
|
5 |
+
|
venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.0.2.54.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nvidia
|
venv/lib/python3.10/site-packages/pytablewriter/__init__.py
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
from dataproperty import LineBreakHandling
|
6 |
+
|
7 |
+
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
|
8 |
+
from ._factory import TableWriterFactory
|
9 |
+
from ._function import dumps_tabledata
|
10 |
+
from ._logger import set_logger
|
11 |
+
from ._table_format import FormatAttr, TableFormat
|
12 |
+
from .error import (
|
13 |
+
EmptyTableDataError,
|
14 |
+
EmptyTableNameError,
|
15 |
+
EmptyValueError,
|
16 |
+
NotSupportedError,
|
17 |
+
WriterNotFoundError,
|
18 |
+
)
|
19 |
+
from .style import Align, Format
|
20 |
+
from .typehint import (
|
21 |
+
Bool,
|
22 |
+
DateTime,
|
23 |
+
Dictionary,
|
24 |
+
Infinity,
|
25 |
+
Integer,
|
26 |
+
IpAddress,
|
27 |
+
List,
|
28 |
+
Nan,
|
29 |
+
NoneType,
|
30 |
+
NullString,
|
31 |
+
RealNumber,
|
32 |
+
String,
|
33 |
+
)
|
34 |
+
from .writer import (
|
35 |
+
AbstractTableWriter,
|
36 |
+
AsciiDocTableWriter,
|
37 |
+
BoldUnicodeTableWriter,
|
38 |
+
BorderlessTableWriter,
|
39 |
+
CssTableWriter,
|
40 |
+
CsvTableWriter,
|
41 |
+
ElasticsearchWriter,
|
42 |
+
ExcelXlsTableWriter,
|
43 |
+
ExcelXlsxTableWriter,
|
44 |
+
HtmlTableWriter,
|
45 |
+
JavaScriptTableWriter,
|
46 |
+
JsonLinesTableWriter,
|
47 |
+
JsonTableWriter,
|
48 |
+
LatexMatrixWriter,
|
49 |
+
LatexTableWriter,
|
50 |
+
LtsvTableWriter,
|
51 |
+
MarkdownTableWriter,
|
52 |
+
MediaWikiTableWriter,
|
53 |
+
NullTableWriter,
|
54 |
+
NumpyTableWriter,
|
55 |
+
PandasDataFramePickleWriter,
|
56 |
+
PandasDataFrameWriter,
|
57 |
+
PythonCodeTableWriter,
|
58 |
+
RstCsvTableWriter,
|
59 |
+
RstGridTableWriter,
|
60 |
+
RstSimpleTableWriter,
|
61 |
+
SpaceAlignedTableWriter,
|
62 |
+
SqliteTableWriter,
|
63 |
+
TomlTableWriter,
|
64 |
+
TsvTableWriter,
|
65 |
+
UnicodeTableWriter,
|
66 |
+
YamlTableWriter,
|
67 |
+
)
|
68 |
+
|
69 |
+
|
70 |
+
__all__ = (
|
71 |
+
"__author__",
|
72 |
+
"__copyright__",
|
73 |
+
"__email__",
|
74 |
+
"__license__",
|
75 |
+
"__version__",
|
76 |
+
"LineBreakHandling",
|
77 |
+
"TableWriterFactory",
|
78 |
+
"dumps_tabledata",
|
79 |
+
"set_logger",
|
80 |
+
"FormatAttr",
|
81 |
+
"TableFormat",
|
82 |
+
"Align",
|
83 |
+
"Format",
|
84 |
+
"Bool",
|
85 |
+
"DateTime",
|
86 |
+
"Dictionary",
|
87 |
+
"Infinity",
|
88 |
+
"Integer",
|
89 |
+
"IpAddress",
|
90 |
+
"List",
|
91 |
+
"Nan",
|
92 |
+
"NoneType",
|
93 |
+
"NullString",
|
94 |
+
"RealNumber",
|
95 |
+
"String",
|
96 |
+
"EmptyTableDataError",
|
97 |
+
"EmptyTableNameError",
|
98 |
+
"EmptyValueError",
|
99 |
+
"NotSupportedError",
|
100 |
+
"WriterNotFoundError",
|
101 |
+
"AbstractTableWriter",
|
102 |
+
"AsciiDocTableWriter",
|
103 |
+
"BoldUnicodeTableWriter",
|
104 |
+
"BorderlessTableWriter",
|
105 |
+
"CssTableWriter",
|
106 |
+
"CsvTableWriter",
|
107 |
+
"ElasticsearchWriter",
|
108 |
+
"ExcelXlsTableWriter",
|
109 |
+
"ExcelXlsxTableWriter",
|
110 |
+
"HtmlTableWriter",
|
111 |
+
"JavaScriptTableWriter",
|
112 |
+
"JsonLinesTableWriter",
|
113 |
+
"JsonTableWriter",
|
114 |
+
"LatexMatrixWriter",
|
115 |
+
"LatexTableWriter",
|
116 |
+
"LtsvTableWriter",
|
117 |
+
"MarkdownTableWriter",
|
118 |
+
"MediaWikiTableWriter",
|
119 |
+
"NullTableWriter",
|
120 |
+
"NumpyTableWriter",
|
121 |
+
"PandasDataFramePickleWriter",
|
122 |
+
"PandasDataFrameWriter",
|
123 |
+
"PythonCodeTableWriter",
|
124 |
+
"RstCsvTableWriter",
|
125 |
+
"RstGridTableWriter",
|
126 |
+
"RstSimpleTableWriter",
|
127 |
+
"SpaceAlignedTableWriter",
|
128 |
+
"SqliteTableWriter",
|
129 |
+
"TomlTableWriter",
|
130 |
+
"TsvTableWriter",
|
131 |
+
"UnicodeTableWriter",
|
132 |
+
"YamlTableWriter",
|
133 |
+
)
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (2.39 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/__version__.cpython-310.pyc
ADDED
Binary file (387 Bytes). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_converter.cpython-310.pyc
ADDED
Binary file (514 Bytes). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_factory.cpython-310.pyc
ADDED
Binary file (10.8 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_function.cpython-310.pyc
ADDED
Binary file (2.8 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_table_format.cpython-310.pyc
ADDED
Binary file (6.74 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/_typing.cpython-310.pyc
ADDED
Binary file (79.4 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__pycache__/error.cpython-310.pyc
ADDED
Binary file (1.43 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/__version__.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__author__ = "Tsuyoshi Hombashi"
|
2 |
+
__copyright__ = f"Copyright 2016, {__author__}"
|
3 |
+
__license__ = "MIT License"
|
4 |
+
__version__ = "1.2.0"
|
5 |
+
__maintainer__ = __author__
|
6 |
+
__email__ = "[email protected]"
|
venv/lib/python3.10/site-packages/pytablewriter/_converter.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import re
|
6 |
+
|
7 |
+
|
8 |
+
def strip_quote(text: str, value: str) -> str:
|
9 |
+
re_replace = re.compile(f"[\"']{value:s}[\"']", re.MULTILINE)
|
10 |
+
|
11 |
+
return re_replace.sub(value, text)
|
venv/lib/python3.10/site-packages/pytablewriter/_factory.py
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import os
|
6 |
+
from itertools import chain
|
7 |
+
from typing import Any, List
|
8 |
+
|
9 |
+
import typepy
|
10 |
+
|
11 |
+
from ._logger import logger
|
12 |
+
from ._table_format import FormatAttr, TableFormat
|
13 |
+
from .error import WriterNotFoundError
|
14 |
+
from .writer import AbstractTableWriter
|
15 |
+
|
16 |
+
|
17 |
+
class TableWriterFactory:
|
18 |
+
"""
|
19 |
+
A factory class of table writer classes.
|
20 |
+
"""
|
21 |
+
|
22 |
+
@classmethod
|
23 |
+
def create_from_file_extension(cls, file_extension: str, **kwargs: Any) -> AbstractTableWriter:
|
24 |
+
"""
|
25 |
+
Create a table writer class instance from a file extension.
|
26 |
+
Supported file extensions are as follows:
|
27 |
+
|
28 |
+
================== ===================================
|
29 |
+
Extension Writer Class
|
30 |
+
================== ===================================
|
31 |
+
``".adoc"`` :py:class:`~.AsciiDocTableWriter`
|
32 |
+
``".asciidoc"`` :py:class:`~.AsciiDocTableWriter`
|
33 |
+
``".asc"`` :py:class:`~.AsciiDocTableWriter`
|
34 |
+
``".css"`` :py:class:`~.CssTableWriter`
|
35 |
+
``".csv"`` :py:class:`~.CsvTableWriter`
|
36 |
+
``".htm"`` :py:class:`~.HtmlTableWriter`
|
37 |
+
``".html"`` :py:class:`~.HtmlTableWriter`
|
38 |
+
``".js"`` :py:class:`~.JavaScriptTableWriter`
|
39 |
+
``".json"`` :py:class:`~.JsonTableWriter`
|
40 |
+
``".jsonl"`` :py:class:`~.JsonLinesTableWriter`
|
41 |
+
``".ltsv"`` :py:class:`~.LtsvTableWriter`
|
42 |
+
``".ldjson"`` :py:class:`~.JsonLinesTableWriter`
|
43 |
+
``".md"`` :py:class:`~.MarkdownTableWriter`
|
44 |
+
``".ndjson"`` :py:class:`~.JsonLinesTableWriter`
|
45 |
+
``".py"`` :py:class:`~.PythonCodeTableWriter`
|
46 |
+
``".rst"`` :py:class:`~.RstGridTableWriter`
|
47 |
+
``".tsv"`` :py:class:`~.TsvTableWriter`
|
48 |
+
``".xls"`` :py:class:`~.ExcelXlsTableWriter`
|
49 |
+
``".xlsx"`` :py:class:`~.ExcelXlsxTableWriter`
|
50 |
+
``".sqlite"`` :py:class:`~.SqliteTableWriter`
|
51 |
+
``".sqlite3"`` :py:class:`~.SqliteTableWriter`
|
52 |
+
``".tsv"`` :py:class:`~.TsvTableWriter`
|
53 |
+
``".toml"`` :py:class:`~.TomlTableWriter`
|
54 |
+
``".yml"`` :py:class:`~.YamlTableWriter`
|
55 |
+
================== ===================================
|
56 |
+
|
57 |
+
:param str file_extension:
|
58 |
+
File extension string (case insensitive).
|
59 |
+
:param kwargs:
|
60 |
+
Keyword arguments that pass to a writer class constructor.
|
61 |
+
:return:
|
62 |
+
Writer instance that coincides with the ``file_extension``.
|
63 |
+
:rtype:
|
64 |
+
:py:class:`~pytablewriter.writer._table_writer.TableWriterInterface`
|
65 |
+
:raises pytablewriter.WriterNotFoundError:
|
66 |
+
|WriterNotFoundError_desc| the file extension.
|
67 |
+
"""
|
68 |
+
|
69 |
+
ext = os.path.splitext(file_extension)[1]
|
70 |
+
if typepy.is_null_string(ext):
|
71 |
+
file_extension = file_extension
|
72 |
+
else:
|
73 |
+
file_extension = ext
|
74 |
+
|
75 |
+
file_extension = file_extension.lstrip(".").lower()
|
76 |
+
|
77 |
+
for table_format in TableFormat:
|
78 |
+
if file_extension not in table_format.file_extensions:
|
79 |
+
continue
|
80 |
+
|
81 |
+
if table_format.format_attribute & FormatAttr.SECONDARY_EXT:
|
82 |
+
continue
|
83 |
+
|
84 |
+
logger.debug(f"create a {table_format.writer_class} instance")
|
85 |
+
|
86 |
+
return table_format.writer_class(**kwargs) # type: ignore
|
87 |
+
|
88 |
+
raise WriterNotFoundError(
|
89 |
+
"\n".join(
|
90 |
+
[
|
91 |
+
f"{file_extension:s} (unknown file extension).",
|
92 |
+
"",
|
93 |
+
"acceptable file extensions are: {}.".format(", ".join(cls.get_extensions())),
|
94 |
+
]
|
95 |
+
)
|
96 |
+
)
|
97 |
+
|
98 |
+
@classmethod
|
99 |
+
def create_from_format_name(cls, format_name: str, **kwargs: Any) -> AbstractTableWriter:
|
100 |
+
"""
|
101 |
+
Create a table writer class instance from a format name.
|
102 |
+
Supported file format names are as follows:
|
103 |
+
|
104 |
+
============================================= ===================================
|
105 |
+
Format name Writer Class
|
106 |
+
============================================= ===================================
|
107 |
+
``"adoc"`` :py:class:`~.AsciiDocTableWriter`
|
108 |
+
``"asciidoc"`` :py:class:`~.AsciiDocTableWriter`
|
109 |
+
``"css"`` :py:class:`~.CssTableWriter`
|
110 |
+
``"csv"`` :py:class:`~.CsvTableWriter`
|
111 |
+
``"elasticsearch"`` :py:class:`~.ElasticsearchWriter`
|
112 |
+
``"excel"`` :py:class:`~.ExcelXlsxTableWriter`
|
113 |
+
``"html"``/``"htm"`` :py:class:`~.HtmlTableWriter`
|
114 |
+
``"javascript"``/``"js"`` :py:class:`~.JavaScriptTableWriter`
|
115 |
+
``"json"`` :py:class:`~.JsonTableWriter`
|
116 |
+
``"json_lines"`` :py:class:`~.JsonLinesTableWriter`
|
117 |
+
``"latex_matrix"`` :py:class:`~.LatexMatrixWriter`
|
118 |
+
``"latex_table"`` :py:class:`~.LatexTableWriter`
|
119 |
+
``"ldjson"`` :py:class:`~.JsonLinesTableWriter`
|
120 |
+
``"ltsv"`` :py:class:`~.LtsvTableWriter`
|
121 |
+
``"markdown"``/``"md"`` :py:class:`~.MarkdownTableWriter`
|
122 |
+
``"mediawiki"`` :py:class:`~.MediaWikiTableWriter`
|
123 |
+
``"null"`` :py:class:`~.NullTableWriter`
|
124 |
+
``"pandas"`` :py:class:`~.PandasDataFrameWriter`
|
125 |
+
``"py"``/``"python"`` :py:class:`~.PythonCodeTableWriter`
|
126 |
+
``"rst"``/``"rst_grid"``/``"rst_grid_table"`` :py:class:`~.RstGridTableWriter`
|
127 |
+
``"rst_simple"``/``"rst_simple_table"`` :py:class:`~.RstSimpleTableWriter`
|
128 |
+
``"rst_csv"``/``"rst_csv_table"`` :py:class:`~.RstCsvTableWriter`
|
129 |
+
``"sqlite"`` :py:class:`~.SqliteTableWriter`
|
130 |
+
``"ssv"`` :py:class:`~.SpaceAlignedTableWriter`
|
131 |
+
``"tsv"`` :py:class:`~.TsvTableWriter`
|
132 |
+
``"toml"`` :py:class:`~.TomlTableWriter`
|
133 |
+
``"unicode"`` :py:class:`~.UnicodeTableWriter`
|
134 |
+
``"yaml"`` :py:class:`~.YamlTableWriter`
|
135 |
+
============================================= ===================================
|
136 |
+
|
137 |
+
:param str format_name:
|
138 |
+
Format name string (case insensitive).
|
139 |
+
:param kwargs:
|
140 |
+
Keyword arguments that pass to a writer class constructor.
|
141 |
+
:return:
|
142 |
+
Writer instance that coincides with the ``format_name``:
|
143 |
+
:rtype:
|
144 |
+
:py:class:`~pytablewriter.writer._table_writer.TableWriterInterface`
|
145 |
+
:raises pytablewriter.WriterNotFoundError:
|
146 |
+
|WriterNotFoundError_desc| for the format.
|
147 |
+
"""
|
148 |
+
|
149 |
+
format_name = format_name.casefold()
|
150 |
+
|
151 |
+
for table_format in TableFormat:
|
152 |
+
if format_name in table_format.names and not (
|
153 |
+
table_format.format_attribute & FormatAttr.SECONDARY_NAME
|
154 |
+
):
|
155 |
+
writer = table_format.writer_class(**kwargs) # type: ignore
|
156 |
+
logger.debug(f"create a {writer.FORMAT_NAME} instance")
|
157 |
+
|
158 |
+
return writer
|
159 |
+
|
160 |
+
raise WriterNotFoundError(
|
161 |
+
"\n".join(
|
162 |
+
[
|
163 |
+
f"{format_name} (unknown format name).",
|
164 |
+
"acceptable format names are: {}.".format(", ".join(cls.get_format_names())),
|
165 |
+
]
|
166 |
+
)
|
167 |
+
)
|
168 |
+
|
169 |
+
@classmethod
|
170 |
+
def get_format_names(cls) -> List[str]:
|
171 |
+
"""
|
172 |
+
:return: Available format names.
|
173 |
+
:rtype: list
|
174 |
+
|
175 |
+
:Example:
|
176 |
+
.. code:: python
|
177 |
+
|
178 |
+
>>> import pytablewriter as ptw
|
179 |
+
>>> for name in ptw.TableWriterFactory.get_format_names():
|
180 |
+
... print(name)
|
181 |
+
...
|
182 |
+
adoc
|
183 |
+
asciidoc
|
184 |
+
bold_unicode
|
185 |
+
borderless
|
186 |
+
css
|
187 |
+
csv
|
188 |
+
elasticsearch
|
189 |
+
excel
|
190 |
+
htm
|
191 |
+
html
|
192 |
+
javascript
|
193 |
+
js
|
194 |
+
json
|
195 |
+
json_lines
|
196 |
+
jsonl
|
197 |
+
latex_matrix
|
198 |
+
latex_table
|
199 |
+
ldjson
|
200 |
+
ltsv
|
201 |
+
markdown
|
202 |
+
md
|
203 |
+
mediawiki
|
204 |
+
ndjson
|
205 |
+
null
|
206 |
+
numpy
|
207 |
+
pandas
|
208 |
+
pandas_pickle
|
209 |
+
py
|
210 |
+
python
|
211 |
+
rst
|
212 |
+
rst_csv
|
213 |
+
rst_csv_table
|
214 |
+
rst_grid
|
215 |
+
rst_grid_table
|
216 |
+
rst_simple
|
217 |
+
rst_simple_table
|
218 |
+
space_aligned
|
219 |
+
sqlite
|
220 |
+
ssv
|
221 |
+
toml
|
222 |
+
tsv
|
223 |
+
unicode
|
224 |
+
yaml
|
225 |
+
|
226 |
+
"""
|
227 |
+
|
228 |
+
return sorted(list(set(chain(*(table_format.names for table_format in TableFormat)))))
|
229 |
+
|
230 |
+
@classmethod
|
231 |
+
def get_extensions(cls) -> List[str]:
|
232 |
+
"""
|
233 |
+
:return: Available file extensions.
|
234 |
+
:rtype: list
|
235 |
+
|
236 |
+
:Example:
|
237 |
+
.. code:: python
|
238 |
+
|
239 |
+
>>> import pytablewriter as ptw
|
240 |
+
>>> for name in ptw.TableWriterFactory.get_extensions():
|
241 |
+
... print(name)
|
242 |
+
...
|
243 |
+
adoc
|
244 |
+
asc
|
245 |
+
asciidoc
|
246 |
+
css
|
247 |
+
csv
|
248 |
+
htm
|
249 |
+
html
|
250 |
+
js
|
251 |
+
json
|
252 |
+
jsonl
|
253 |
+
ldjson
|
254 |
+
ltsv
|
255 |
+
md
|
256 |
+
ndjson
|
257 |
+
py
|
258 |
+
rst
|
259 |
+
sqlite
|
260 |
+
sqlite3
|
261 |
+
tex
|
262 |
+
toml
|
263 |
+
tsv
|
264 |
+
xls
|
265 |
+
xlsx
|
266 |
+
yml
|
267 |
+
"""
|
268 |
+
|
269 |
+
file_extension_set = set()
|
270 |
+
for table_format in TableFormat:
|
271 |
+
for file_extension in table_format.file_extensions:
|
272 |
+
file_extension_set.add(file_extension)
|
273 |
+
|
274 |
+
return sorted(list(file_extension_set))
|
venv/lib/python3.10/site-packages/pytablewriter/_function.py
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
from datetime import datetime
|
6 |
+
from enum import Enum
|
7 |
+
from typing import Any, Optional, Type
|
8 |
+
|
9 |
+
import dataproperty
|
10 |
+
from pathvalidate import replace_symbol
|
11 |
+
from tabledata._core import TableData
|
12 |
+
|
13 |
+
|
14 |
+
def quote_datetime_formatter(value: datetime) -> str:
|
15 |
+
return f'"{value.strftime(dataproperty.DefaultValue.DATETIME_FORMAT):s}"'
|
16 |
+
|
17 |
+
|
18 |
+
def dateutil_datetime_formatter(value: datetime) -> str:
|
19 |
+
return 'dateutil.parser.parse("{:s}")'.format(
|
20 |
+
value.strftime(dataproperty.DefaultValue.DATETIME_FORMAT)
|
21 |
+
)
|
22 |
+
|
23 |
+
|
24 |
+
def dumps_tabledata(value: TableData, format_name: str = "rst_grid_table", **kwargs: Any) -> str:
|
25 |
+
"""
|
26 |
+
:param tabledata.TableData value: Tabular data to dump.
|
27 |
+
:param str format_name:
|
28 |
+
Dumped format name of tabular data.
|
29 |
+
Available formats are described in
|
30 |
+
:py:meth:`~pytablewriter.TableWriterFactory.create_from_format_name`
|
31 |
+
|
32 |
+
:Example:
|
33 |
+
.. code:: python
|
34 |
+
|
35 |
+
>>> dumps_tabledata(value)
|
36 |
+
.. table:: sample_data
|
37 |
+
|
38 |
+
====== ====== ======
|
39 |
+
attr_a attr_b attr_c
|
40 |
+
====== ====== ======
|
41 |
+
1 4.0 a
|
42 |
+
2 2.1 bb
|
43 |
+
3 120.9 ccc
|
44 |
+
====== ====== ======
|
45 |
+
"""
|
46 |
+
|
47 |
+
from ._factory import TableWriterFactory
|
48 |
+
|
49 |
+
if not value:
|
50 |
+
raise TypeError("value must be a tabledata.TableData instance")
|
51 |
+
|
52 |
+
writer = TableWriterFactory.create_from_format_name(format_name)
|
53 |
+
|
54 |
+
for attr_name, attr_value in kwargs.items():
|
55 |
+
setattr(writer, attr_name, attr_value)
|
56 |
+
|
57 |
+
writer.from_tabledata(value)
|
58 |
+
|
59 |
+
return writer.dumps()
|
60 |
+
|
61 |
+
|
62 |
+
def normalize_enum(
|
63 |
+
value: Any, enum_class: Type[Enum], validate: bool = True, default: Optional[Enum] = None
|
64 |
+
) -> Any:
|
65 |
+
if value is None:
|
66 |
+
return default
|
67 |
+
|
68 |
+
if isinstance(value, enum_class):
|
69 |
+
return value
|
70 |
+
|
71 |
+
try:
|
72 |
+
return enum_class[replace_symbol(value.strip(), "_").upper()]
|
73 |
+
except AttributeError:
|
74 |
+
if validate:
|
75 |
+
raise TypeError(f"value must be a {enum_class} or a str: actual={type(value)}")
|
76 |
+
except KeyError:
|
77 |
+
if validate:
|
78 |
+
raise ValueError(
|
79 |
+
"invalid valid found: expected={}, actual={}".format(
|
80 |
+
"/".join(item.name for item in enum_class), value
|
81 |
+
)
|
82 |
+
)
|
83 |
+
|
84 |
+
return value
|
venv/lib/python3.10/site-packages/pytablewriter/_logger/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ._logger import WriterLogger, logger, set_logger
|
2 |
+
|
3 |
+
|
4 |
+
__all__ = ("WriterLogger", "logger", "set_logger")
|
venv/lib/python3.10/site-packages/pytablewriter/_logger/_logger.py
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
from typing import TYPE_CHECKING, List
|
6 |
+
|
7 |
+
import dataproperty
|
8 |
+
from mbstrdecoder import MultiByteStrDecoder
|
9 |
+
|
10 |
+
from ._null_logger import NullLogger # type: ignore
|
11 |
+
|
12 |
+
|
13 |
+
if TYPE_CHECKING:
|
14 |
+
from ..writer import AbstractTableWriter
|
15 |
+
|
16 |
+
MODULE_NAME = "pytablewriter"
|
17 |
+
|
18 |
+
try:
|
19 |
+
from loguru import logger
|
20 |
+
|
21 |
+
logger.disable(MODULE_NAME)
|
22 |
+
except ImportError:
|
23 |
+
logger = NullLogger()
|
24 |
+
|
25 |
+
|
26 |
+
def set_logger(is_enable: bool, propagation_depth: int = 1) -> None:
|
27 |
+
if is_enable:
|
28 |
+
logger.enable(MODULE_NAME)
|
29 |
+
else:
|
30 |
+
logger.disable(MODULE_NAME)
|
31 |
+
|
32 |
+
if propagation_depth <= 0:
|
33 |
+
return
|
34 |
+
|
35 |
+
dataproperty.set_logger(is_enable, propagation_depth - 1)
|
36 |
+
|
37 |
+
try:
|
38 |
+
import simplesqlite
|
39 |
+
|
40 |
+
simplesqlite.set_logger(is_enable, propagation_depth - 1)
|
41 |
+
except ImportError:
|
42 |
+
pass
|
43 |
+
|
44 |
+
try:
|
45 |
+
import pytablereader
|
46 |
+
|
47 |
+
pytablereader.set_logger(is_enable, propagation_depth - 1)
|
48 |
+
except ImportError:
|
49 |
+
pass
|
50 |
+
|
51 |
+
|
52 |
+
class WriterLogger:
|
53 |
+
@property
|
54 |
+
def logger(self): # type: ignore
|
55 |
+
return self.__logger
|
56 |
+
|
57 |
+
def __init__(self, writer: "AbstractTableWriter") -> None:
|
58 |
+
self.__writer = writer
|
59 |
+
self.__logger = logger
|
60 |
+
|
61 |
+
self.logger.debug(f"created WriterLogger: format={writer.format_name}")
|
62 |
+
|
63 |
+
def __enter__(self) -> "WriterLogger":
|
64 |
+
self.logging_start_write()
|
65 |
+
return self
|
66 |
+
|
67 |
+
def __exit__(self, *exc): # type: ignore
|
68 |
+
self.logging_complete_write()
|
69 |
+
return False
|
70 |
+
|
71 |
+
def logging_start_write(self) -> None:
|
72 |
+
log_entry_list = [
|
73 |
+
self.__get_format_name_message(),
|
74 |
+
self.__get_table_name_message(),
|
75 |
+
f"headers={self.__writer.headers}",
|
76 |
+
]
|
77 |
+
|
78 |
+
try:
|
79 |
+
log_entry_list.append(f"rows={len(self.__writer.value_matrix)}")
|
80 |
+
except (TypeError, AttributeError):
|
81 |
+
log_entry_list.append("rows=NaN")
|
82 |
+
|
83 |
+
log_entry_list.append(self.__get_typehint_message())
|
84 |
+
log_entry_list.extend(self.__get_extra_log_entry_list())
|
85 |
+
|
86 |
+
self.logger.debug("start write table: {}".format(", ".join(log_entry_list)))
|
87 |
+
|
88 |
+
def logging_complete_write(self) -> None:
|
89 |
+
log_entry_list = [self.__get_format_name_message(), self.__get_table_name_message()]
|
90 |
+
log_entry_list.extend(self.__get_extra_log_entry_list())
|
91 |
+
|
92 |
+
self.logger.debug("complete write table: {}".format(", ".join(log_entry_list)))
|
93 |
+
|
94 |
+
def __get_format_name_message(self) -> str:
|
95 |
+
return f"format={self.__writer.format_name:s}"
|
96 |
+
|
97 |
+
def __get_table_name_message(self) -> str:
|
98 |
+
if self.__writer.table_name:
|
99 |
+
table_name = MultiByteStrDecoder(self.__writer.table_name).unicode_str
|
100 |
+
else:
|
101 |
+
table_name = ""
|
102 |
+
|
103 |
+
return f"table-name='{table_name}'"
|
104 |
+
|
105 |
+
def __get_extra_log_entry_list(self) -> List[str]:
|
106 |
+
if self.__writer._iter_count is None:
|
107 |
+
return []
|
108 |
+
|
109 |
+
return [f"iteration={self.__writer._iter_count}/{self.__writer.iteration_length}"]
|
110 |
+
|
111 |
+
def __get_typehint_message(self) -> str:
|
112 |
+
try:
|
113 |
+
return "type-hints={}".format(
|
114 |
+
[type_hint(None).typename for type_hint in self.__writer.type_hints]
|
115 |
+
)
|
116 |
+
except (TypeError, AttributeError):
|
117 |
+
return "type-hints=[]"
|
venv/lib/python3.10/site-packages/pytablewriter/_logger/_null_logger.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# type: ignore
|
2 |
+
|
3 |
+
|
4 |
+
class NullLogger:
|
5 |
+
level_name = None
|
6 |
+
|
7 |
+
def remove(self, handler_id=None): # pragma: no cover
|
8 |
+
pass
|
9 |
+
|
10 |
+
def add(self, sink, **kwargs): # pragma: no cover
|
11 |
+
pass
|
12 |
+
|
13 |
+
def disable(self, name): # pragma: no cover
|
14 |
+
pass
|
15 |
+
|
16 |
+
def enable(self, name): # pragma: no cover
|
17 |
+
pass
|
18 |
+
|
19 |
+
def critical(self, __message, *args, **kwargs): # pragma: no cover
|
20 |
+
pass
|
21 |
+
|
22 |
+
def debug(self, __message, *args, **kwargs): # pragma: no cover
|
23 |
+
pass
|
24 |
+
|
25 |
+
def error(self, __message, *args, **kwargs): # pragma: no cover
|
26 |
+
pass
|
27 |
+
|
28 |
+
def exception(self, __message, *args, **kwargs): # pragma: no cover
|
29 |
+
pass
|
30 |
+
|
31 |
+
def info(self, __message, *args, **kwargs): # pragma: no cover
|
32 |
+
pass
|
33 |
+
|
34 |
+
def log(self, __level, __message, *args, **kwargs): # pragma: no cover
|
35 |
+
pass
|
36 |
+
|
37 |
+
def success(self, __message, *args, **kwargs): # pragma: no cover
|
38 |
+
pass
|
39 |
+
|
40 |
+
def trace(self, __message, *args, **kwargs): # pragma: no cover
|
41 |
+
pass
|
42 |
+
|
43 |
+
def warning(self, __message, *args, **kwargs): # pragma: no cover
|
44 |
+
pass
|
venv/lib/python3.10/site-packages/pytablewriter/_table_format.py
ADDED
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import enum
|
6 |
+
from typing import List, Optional, Sequence
|
7 |
+
|
8 |
+
from .writer import (
|
9 |
+
AbstractTableWriter,
|
10 |
+
AsciiDocTableWriter,
|
11 |
+
BoldUnicodeTableWriter,
|
12 |
+
BorderlessTableWriter,
|
13 |
+
CssTableWriter,
|
14 |
+
CsvTableWriter,
|
15 |
+
ElasticsearchWriter,
|
16 |
+
ExcelXlsTableWriter,
|
17 |
+
ExcelXlsxTableWriter,
|
18 |
+
HtmlTableWriter,
|
19 |
+
JavaScriptTableWriter,
|
20 |
+
JsonLinesTableWriter,
|
21 |
+
JsonTableWriter,
|
22 |
+
LatexMatrixWriter,
|
23 |
+
LatexTableWriter,
|
24 |
+
LtsvTableWriter,
|
25 |
+
MarkdownTableWriter,
|
26 |
+
MediaWikiTableWriter,
|
27 |
+
NullTableWriter,
|
28 |
+
NumpyTableWriter,
|
29 |
+
PandasDataFramePickleWriter,
|
30 |
+
PandasDataFrameWriter,
|
31 |
+
PythonCodeTableWriter,
|
32 |
+
RstCsvTableWriter,
|
33 |
+
RstGridTableWriter,
|
34 |
+
RstSimpleTableWriter,
|
35 |
+
SpaceAlignedTableWriter,
|
36 |
+
SqliteTableWriter,
|
37 |
+
TomlTableWriter,
|
38 |
+
TsvTableWriter,
|
39 |
+
UnicodeTableWriter,
|
40 |
+
YamlTableWriter,
|
41 |
+
)
|
42 |
+
|
43 |
+
|
44 |
+
class FormatAttr:
|
45 |
+
"""
|
46 |
+
Bitmaps to represent table attributes.
|
47 |
+
"""
|
48 |
+
|
49 |
+
NONE = 1 << 1
|
50 |
+
|
51 |
+
#: Can create a file with the format.
|
52 |
+
FILE = 1 << 2
|
53 |
+
|
54 |
+
#: Table format that can represent as a text.
|
55 |
+
TEXT = 1 << 3
|
56 |
+
|
57 |
+
#: Table format that can represent as a binary file.
|
58 |
+
BIN = 1 << 4
|
59 |
+
|
60 |
+
#: Can create a source code (variables definition)
|
61 |
+
#: one of the programming language.
|
62 |
+
SOURCECODE = 1 << 5
|
63 |
+
|
64 |
+
#: Can call API for external service.
|
65 |
+
API = 1 << 6
|
66 |
+
|
67 |
+
SECONDARY_EXT = 1 << 10
|
68 |
+
SECONDARY_NAME = 1 << 11
|
69 |
+
|
70 |
+
|
71 |
+
@enum.unique
|
72 |
+
class TableFormat(enum.Enum):
|
73 |
+
"""
|
74 |
+
Enum to represent table format attributes.
|
75 |
+
"""
|
76 |
+
|
77 |
+
ASCIIDOC = (
|
78 |
+
[AsciiDocTableWriter.FORMAT_NAME, "adoc"],
|
79 |
+
AsciiDocTableWriter,
|
80 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
81 |
+
["adoc", "asciidoc", "asc"],
|
82 |
+
)
|
83 |
+
CSV = ([CsvTableWriter.FORMAT_NAME], CsvTableWriter, FormatAttr.FILE | FormatAttr.TEXT, ["csv"])
|
84 |
+
CSS = (
|
85 |
+
[CssTableWriter.FORMAT_NAME],
|
86 |
+
CssTableWriter,
|
87 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
88 |
+
["css"],
|
89 |
+
)
|
90 |
+
ELASTICSEARCH = (
|
91 |
+
[ElasticsearchWriter.FORMAT_NAME], # type: ignore
|
92 |
+
ElasticsearchWriter,
|
93 |
+
FormatAttr.API,
|
94 |
+
[],
|
95 |
+
)
|
96 |
+
EXCEL_XLSX = (
|
97 |
+
[ExcelXlsxTableWriter.FORMAT_NAME],
|
98 |
+
ExcelXlsxTableWriter,
|
99 |
+
FormatAttr.FILE | FormatAttr.BIN,
|
100 |
+
["xlsx"],
|
101 |
+
)
|
102 |
+
EXCEL_XLS = (
|
103 |
+
[ExcelXlsTableWriter.FORMAT_NAME],
|
104 |
+
ExcelXlsTableWriter,
|
105 |
+
FormatAttr.FILE | FormatAttr.BIN | FormatAttr.SECONDARY_NAME,
|
106 |
+
["xls"],
|
107 |
+
)
|
108 |
+
HTML = (
|
109 |
+
[HtmlTableWriter.FORMAT_NAME, "htm"],
|
110 |
+
HtmlTableWriter,
|
111 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
112 |
+
["html", "htm"],
|
113 |
+
)
|
114 |
+
JAVASCRIPT = (
|
115 |
+
[JavaScriptTableWriter.FORMAT_NAME, "js"],
|
116 |
+
JavaScriptTableWriter,
|
117 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SOURCECODE,
|
118 |
+
["js"],
|
119 |
+
)
|
120 |
+
JSON = (
|
121 |
+
[JsonTableWriter.FORMAT_NAME],
|
122 |
+
JsonTableWriter,
|
123 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
124 |
+
["json"],
|
125 |
+
)
|
126 |
+
JSON_LINES = (
|
127 |
+
[JsonLinesTableWriter.FORMAT_NAME, "jsonl", "ldjson", "ndjson"],
|
128 |
+
JsonLinesTableWriter,
|
129 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
130 |
+
["jsonl", "ldjson", "ndjson"],
|
131 |
+
)
|
132 |
+
LATEX_MATRIX = (
|
133 |
+
[LatexMatrixWriter.FORMAT_NAME],
|
134 |
+
LatexMatrixWriter,
|
135 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
136 |
+
["tex"],
|
137 |
+
)
|
138 |
+
LATEX_TABLE = (
|
139 |
+
[LatexTableWriter.FORMAT_NAME],
|
140 |
+
LatexTableWriter,
|
141 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SECONDARY_EXT,
|
142 |
+
["tex"],
|
143 |
+
)
|
144 |
+
LTSV = (
|
145 |
+
[LtsvTableWriter.FORMAT_NAME],
|
146 |
+
LtsvTableWriter,
|
147 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
148 |
+
["ltsv"],
|
149 |
+
)
|
150 |
+
MARKDOWN = (
|
151 |
+
[MarkdownTableWriter.FORMAT_NAME, "md"],
|
152 |
+
MarkdownTableWriter,
|
153 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
154 |
+
["md"],
|
155 |
+
)
|
156 |
+
MEDIAWIKI = (
|
157 |
+
[MediaWikiTableWriter.FORMAT_NAME], # type: ignore
|
158 |
+
MediaWikiTableWriter,
|
159 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
160 |
+
[],
|
161 |
+
)
|
162 |
+
NULL = (
|
163 |
+
[NullTableWriter.FORMAT_NAME], # type: ignore
|
164 |
+
NullTableWriter,
|
165 |
+
FormatAttr.NONE,
|
166 |
+
[],
|
167 |
+
)
|
168 |
+
NUMPY = (
|
169 |
+
[NumpyTableWriter.FORMAT_NAME],
|
170 |
+
NumpyTableWriter,
|
171 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SOURCECODE | FormatAttr.SECONDARY_EXT,
|
172 |
+
["py"],
|
173 |
+
)
|
174 |
+
PANDAS = (
|
175 |
+
[PandasDataFrameWriter.FORMAT_NAME],
|
176 |
+
PandasDataFrameWriter,
|
177 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SOURCECODE | FormatAttr.SECONDARY_EXT,
|
178 |
+
["py"],
|
179 |
+
)
|
180 |
+
PANDAS_PICKLE = (
|
181 |
+
[PandasDataFramePickleWriter.FORMAT_NAME], # type: ignore
|
182 |
+
PandasDataFramePickleWriter,
|
183 |
+
FormatAttr.FILE | FormatAttr.BIN,
|
184 |
+
[],
|
185 |
+
)
|
186 |
+
PYTHON = (
|
187 |
+
[PythonCodeTableWriter.FORMAT_NAME, "py"],
|
188 |
+
PythonCodeTableWriter,
|
189 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SOURCECODE,
|
190 |
+
["py"],
|
191 |
+
)
|
192 |
+
RST_CSV_TABLE = (
|
193 |
+
[RstCsvTableWriter.FORMAT_NAME, "rst_csv"],
|
194 |
+
RstCsvTableWriter,
|
195 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SECONDARY_EXT,
|
196 |
+
["rst"],
|
197 |
+
)
|
198 |
+
RST_GRID_TABLE = (
|
199 |
+
[RstGridTableWriter.FORMAT_NAME, "rst_grid", "rst"],
|
200 |
+
RstGridTableWriter,
|
201 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
202 |
+
["rst"],
|
203 |
+
)
|
204 |
+
RST_SIMPLE_TABLE = (
|
205 |
+
[RstSimpleTableWriter.FORMAT_NAME, "rst_simple"],
|
206 |
+
RstSimpleTableWriter,
|
207 |
+
FormatAttr.FILE | FormatAttr.TEXT | FormatAttr.SECONDARY_EXT,
|
208 |
+
["rst"],
|
209 |
+
)
|
210 |
+
SPACE_ALIGNED = (
|
211 |
+
[SpaceAlignedTableWriter.FORMAT_NAME, "ssv"], # type: ignore
|
212 |
+
SpaceAlignedTableWriter,
|
213 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
214 |
+
[],
|
215 |
+
)
|
216 |
+
SQLITE = (
|
217 |
+
[SqliteTableWriter.FORMAT_NAME],
|
218 |
+
SqliteTableWriter,
|
219 |
+
FormatAttr.FILE | FormatAttr.BIN,
|
220 |
+
["sqlite", "sqlite3"],
|
221 |
+
)
|
222 |
+
TOML = (
|
223 |
+
[TomlTableWriter.FORMAT_NAME],
|
224 |
+
TomlTableWriter,
|
225 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
226 |
+
["toml"],
|
227 |
+
)
|
228 |
+
TSV = ([TsvTableWriter.FORMAT_NAME], TsvTableWriter, FormatAttr.FILE | FormatAttr.TEXT, ["tsv"])
|
229 |
+
UNICODE = (
|
230 |
+
[UnicodeTableWriter.FORMAT_NAME], # type: ignore
|
231 |
+
UnicodeTableWriter,
|
232 |
+
FormatAttr.TEXT,
|
233 |
+
[],
|
234 |
+
)
|
235 |
+
YAML = (
|
236 |
+
[YamlTableWriter.FORMAT_NAME],
|
237 |
+
YamlTableWriter,
|
238 |
+
FormatAttr.FILE | FormatAttr.TEXT,
|
239 |
+
["yml"],
|
240 |
+
)
|
241 |
+
BOLD_UNICODE = (
|
242 |
+
[BoldUnicodeTableWriter.FORMAT_NAME], # type: ignore
|
243 |
+
BoldUnicodeTableWriter,
|
244 |
+
FormatAttr.TEXT,
|
245 |
+
[],
|
246 |
+
)
|
247 |
+
BORDERLESS = (
|
248 |
+
[BorderlessTableWriter.FORMAT_NAME], # type: ignore
|
249 |
+
BorderlessTableWriter,
|
250 |
+
FormatAttr.TEXT,
|
251 |
+
[],
|
252 |
+
)
|
253 |
+
|
254 |
+
@property
|
255 |
+
def names(self) -> List[str]:
|
256 |
+
"""
|
257 |
+
List[str]: Names associated with the table format.
|
258 |
+
"""
|
259 |
+
|
260 |
+
return self.__names
|
261 |
+
|
262 |
+
@property
|
263 |
+
def writer_class(self) -> AbstractTableWriter:
|
264 |
+
"""
|
265 |
+
Type[AbstractTableWriter]: Table writer class object associated with the table format.
|
266 |
+
"""
|
267 |
+
|
268 |
+
return self.__writer_class
|
269 |
+
|
270 |
+
@property
|
271 |
+
def format_attribute(self) -> int:
|
272 |
+
"""
|
273 |
+
FormatAttr: Table attributes bitmap.
|
274 |
+
"""
|
275 |
+
|
276 |
+
return self.__format_attribute
|
277 |
+
|
278 |
+
@property
|
279 |
+
def file_extensions(self) -> List[str]:
|
280 |
+
"""
|
281 |
+
List[str]: File extensions associated with the table format.
|
282 |
+
"""
|
283 |
+
|
284 |
+
return self.__file_extensions
|
285 |
+
|
286 |
+
def __init__(
|
287 |
+
self,
|
288 |
+
names: Sequence[str],
|
289 |
+
writer_class: AbstractTableWriter,
|
290 |
+
format_attribute: int,
|
291 |
+
file_extensions: Sequence[str],
|
292 |
+
) -> None:
|
293 |
+
self.__names = list(names)
|
294 |
+
self.__writer_class = writer_class
|
295 |
+
self.__format_attribute = format_attribute
|
296 |
+
self.__file_extensions = list(file_extensions)
|
297 |
+
|
298 |
+
@classmethod
|
299 |
+
def find_all_attr(cls, format_attribute: int) -> List["TableFormat"]:
|
300 |
+
"""Searching table formats that have specific attributes.
|
301 |
+
|
302 |
+
Args:
|
303 |
+
format_attribute (FormatAttr):
|
304 |
+
Table format attributes to look for.
|
305 |
+
|
306 |
+
Returns:
|
307 |
+
List[TableFormat]: Table formats that matched the attribute.
|
308 |
+
"""
|
309 |
+
|
310 |
+
return [
|
311 |
+
table_format
|
312 |
+
for table_format in TableFormat
|
313 |
+
if table_format.format_attribute & format_attribute
|
314 |
+
]
|
315 |
+
|
316 |
+
@classmethod
|
317 |
+
def from_name(cls, format_name: str) -> Optional["TableFormat"]:
|
318 |
+
"""Get a table format from a format name.
|
319 |
+
|
320 |
+
Args:
|
321 |
+
format_name (str): Table format specifier.
|
322 |
+
|
323 |
+
Returns:
|
324 |
+
Optional[TableFormat]: A table format enum value corresponding to the ``format_name``.
|
325 |
+
"""
|
326 |
+
|
327 |
+
format_name = format_name.casefold().strip()
|
328 |
+
|
329 |
+
for table_format in TableFormat:
|
330 |
+
if format_name in table_format.names:
|
331 |
+
return table_format
|
332 |
+
|
333 |
+
return None
|
334 |
+
|
335 |
+
@classmethod
|
336 |
+
def from_file_extension(cls, file_extension: str) -> Optional["TableFormat"]:
|
337 |
+
"""Get a table format from a file extension.
|
338 |
+
|
339 |
+
Args:
|
340 |
+
file_extension (str): File extension.
|
341 |
+
|
342 |
+
Returns:
|
343 |
+
Optional[TableFormat]:
|
344 |
+
A table format enum value corresponding to the ``file_extension``.
|
345 |
+
"""
|
346 |
+
|
347 |
+
ext = file_extension.lower().strip().lstrip(".")
|
348 |
+
|
349 |
+
for table_format in TableFormat:
|
350 |
+
if ext in table_format.file_extensions:
|
351 |
+
return table_format
|
352 |
+
|
353 |
+
return None
|
venv/lib/python3.10/site-packages/pytablewriter/_typing.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
venv/lib/python3.10/site-packages/pytablewriter/error.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
|
6 |
+
class NotSupportedError(Exception):
|
7 |
+
pass
|
8 |
+
|
9 |
+
|
10 |
+
class EmptyTableNameError(Exception):
|
11 |
+
"""
|
12 |
+
Exception raised when a table writer class of the |table_name| attribute
|
13 |
+
is null and the class is not accepted null |table_name|.
|
14 |
+
"""
|
15 |
+
|
16 |
+
|
17 |
+
class EmptyValueError(Exception):
|
18 |
+
"""
|
19 |
+
Exception raised when a table writer class of the |value_matrix| attribute
|
20 |
+
is null, and the class is not accepted null |value_matrix|.
|
21 |
+
"""
|
22 |
+
|
23 |
+
|
24 |
+
class EmptyTableDataError(Exception):
|
25 |
+
"""
|
26 |
+
Exception raised when a table writer class of the |headers| and
|
27 |
+
|value_matrix| attributes are null.
|
28 |
+
"""
|
29 |
+
|
30 |
+
|
31 |
+
class WriterNotFoundError(Exception):
|
32 |
+
"""
|
33 |
+
Exception raised when appropriate loader writer found.
|
34 |
+
"""
|
venv/lib/python3.10/site-packages/pytablewriter/py.typed
ADDED
File without changes
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__init__.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
from ._elasticsearch import ElasticsearchIndexNameSanitizer
|
6 |
+
from ._excel import sanitize_excel_sheet_name, validate_excel_sheet_name
|
7 |
+
from ._javascript import JavaScriptVarNameSanitizer, sanitize_js_var_name, validate_js_var_name
|
8 |
+
from ._python import PythonVarNameSanitizer, sanitize_python_var_name, validate_python_var_name
|
9 |
+
|
10 |
+
|
11 |
+
__all__ = (
|
12 |
+
"ElasticsearchIndexNameSanitizer",
|
13 |
+
"JavaScriptVarNameSanitizer",
|
14 |
+
"PythonVarNameSanitizer",
|
15 |
+
"sanitize_excel_sheet_name",
|
16 |
+
"sanitize_js_var_name",
|
17 |
+
"sanitize_python_var_name",
|
18 |
+
"validate_excel_sheet_name",
|
19 |
+
"validate_js_var_name",
|
20 |
+
"validate_python_var_name",
|
21 |
+
)
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (745 Bytes). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_base.cpython-310.pyc
ADDED
Binary file (2.67 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_elasticsearch.cpython-310.pyc
ADDED
Binary file (1.46 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_excel.cpython-310.pyc
ADDED
Binary file (2.45 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_interface.cpython-310.pyc
ADDED
Binary file (1.8 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_javascript.cpython-310.pyc
ADDED
Binary file (3.71 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/__pycache__/_python.cpython-310.pyc
ADDED
Binary file (3.45 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_base.py
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import abc
|
6 |
+
import re
|
7 |
+
from typing import Pattern
|
8 |
+
|
9 |
+
from pathvalidate.error import ErrorReason, ValidationError
|
10 |
+
from typepy import is_null_string
|
11 |
+
|
12 |
+
from ._interface import NameSanitizer
|
13 |
+
|
14 |
+
|
15 |
+
def _preprocess(name: str) -> str:
|
16 |
+
return name.strip()
|
17 |
+
|
18 |
+
|
19 |
+
class VarNameSanitizer(NameSanitizer):
|
20 |
+
@abc.abstractproperty
|
21 |
+
def _invalid_var_name_head_re(self) -> Pattern[str]: # pragma: no cover
|
22 |
+
pass
|
23 |
+
|
24 |
+
@abc.abstractproperty
|
25 |
+
def _invalid_var_name_re(self) -> Pattern[str]: # pragma: no cover
|
26 |
+
pass
|
27 |
+
|
28 |
+
def validate(self) -> None:
|
29 |
+
self._validate(self._value)
|
30 |
+
|
31 |
+
def sanitize(self, replacement_text: str = "") -> str:
|
32 |
+
var_name = self._invalid_var_name_re.sub(replacement_text, self._str)
|
33 |
+
|
34 |
+
# delete invalid char(s) in the beginning of the variable name
|
35 |
+
is_require_remove_head = any(
|
36 |
+
[
|
37 |
+
is_null_string(replacement_text),
|
38 |
+
self._invalid_var_name_head_re.search(replacement_text) is not None,
|
39 |
+
]
|
40 |
+
)
|
41 |
+
|
42 |
+
if is_require_remove_head:
|
43 |
+
var_name = self._invalid_var_name_head_re.sub("", var_name)
|
44 |
+
else:
|
45 |
+
match = self._invalid_var_name_head_re.search(var_name)
|
46 |
+
if match is not None:
|
47 |
+
var_name = match.end() * replacement_text + self._invalid_var_name_head_re.sub(
|
48 |
+
"", var_name
|
49 |
+
)
|
50 |
+
|
51 |
+
if not var_name:
|
52 |
+
return ""
|
53 |
+
|
54 |
+
try:
|
55 |
+
self._validate(var_name)
|
56 |
+
except ValidationError as e:
|
57 |
+
if e.reason == ErrorReason.RESERVED_NAME and e.reusable_name is False:
|
58 |
+
var_name += "_"
|
59 |
+
|
60 |
+
return var_name
|
61 |
+
|
62 |
+
def _validate(self, value: str) -> None:
|
63 |
+
self._validate_null_string(value)
|
64 |
+
|
65 |
+
unicode_var_name = _preprocess(value)
|
66 |
+
|
67 |
+
if self._is_reserved_keyword(unicode_var_name):
|
68 |
+
raise ValidationError(
|
69 |
+
description=f"{unicode_var_name:s} is a reserved keyword by python",
|
70 |
+
reason=ErrorReason.RESERVED_NAME,
|
71 |
+
reusable_name=False,
|
72 |
+
reserved_name=unicode_var_name,
|
73 |
+
)
|
74 |
+
|
75 |
+
match = self._invalid_var_name_re.search(unicode_var_name)
|
76 |
+
if match is not None:
|
77 |
+
raise ValidationError(
|
78 |
+
description="invalid char found in the variable name: '{}'".format(
|
79 |
+
re.escape(match.group())
|
80 |
+
),
|
81 |
+
reason=ErrorReason.INVALID_CHARACTER,
|
82 |
+
)
|
83 |
+
|
84 |
+
match = self._invalid_var_name_head_re.search(unicode_var_name)
|
85 |
+
if match is not None:
|
86 |
+
raise ValidationError(
|
87 |
+
description="the first character of the variable name is invalid: '{}'".format(
|
88 |
+
re.escape(match.group())
|
89 |
+
),
|
90 |
+
reason=ErrorReason.INVALID_CHARACTER,
|
91 |
+
)
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_elasticsearch.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import re
|
6 |
+
from typing import ClassVar, List, Pattern
|
7 |
+
|
8 |
+
from ._base import VarNameSanitizer
|
9 |
+
|
10 |
+
|
11 |
+
class ElasticsearchIndexNameSanitizer(VarNameSanitizer):
|
12 |
+
__RE_INVALID_INDEX_NAME: ClassVar[Pattern[str]] = re.compile(
|
13 |
+
"[" + re.escape('\\/*?"<>|,"') + r"\s]+"
|
14 |
+
)
|
15 |
+
__RE_INVALID_INDEX_NAME_HEAD: ClassVar[Pattern[str]] = re.compile("^[_]+")
|
16 |
+
|
17 |
+
@property
|
18 |
+
def reserved_keywords(self) -> List[str]:
|
19 |
+
return []
|
20 |
+
|
21 |
+
@property
|
22 |
+
def _invalid_var_name_head_re(self) -> Pattern[str]:
|
23 |
+
return self.__RE_INVALID_INDEX_NAME_HEAD
|
24 |
+
|
25 |
+
@property
|
26 |
+
def _invalid_var_name_re(self) -> Pattern[str]:
|
27 |
+
return self.__RE_INVALID_INDEX_NAME
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_excel.py
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import re
|
6 |
+
|
7 |
+
from pathvalidate import validate_pathtype
|
8 |
+
from pathvalidate.error import ErrorReason, ValidationError
|
9 |
+
|
10 |
+
from ._base import _preprocess
|
11 |
+
|
12 |
+
|
13 |
+
__MAX_SHEET_NAME_LEN = 31
|
14 |
+
|
15 |
+
__INVALID_EXCEL_CHARS = "[]:*?/\\"
|
16 |
+
|
17 |
+
__RE_INVALID_EXCEL_SHEET_NAME = re.compile(f"[{re.escape(__INVALID_EXCEL_CHARS):s}]", re.UNICODE)
|
18 |
+
|
19 |
+
|
20 |
+
def validate_excel_sheet_name(sheet_name: str) -> None:
|
21 |
+
"""
|
22 |
+
:param str sheet_name: Excel sheet name to validate.
|
23 |
+
:raises pathvalidate.ValidationError (ErrorReason.INVALID_CHARACTER):
|
24 |
+
If the ``sheet_name`` includes invalid char(s):
|
25 |
+
|invalid_excel_sheet_chars|.
|
26 |
+
:raises pathvalidate.ValidationError (ErrorReason.INVALID_LENGTH):
|
27 |
+
If the ``sheet_name`` is longer than 31 characters.
|
28 |
+
"""
|
29 |
+
|
30 |
+
validate_pathtype(sheet_name)
|
31 |
+
|
32 |
+
if len(sheet_name) > __MAX_SHEET_NAME_LEN:
|
33 |
+
raise ValidationError(
|
34 |
+
description="sheet name is too long: expected<={:d}, actual={:d}".format(
|
35 |
+
__MAX_SHEET_NAME_LEN, len(sheet_name)
|
36 |
+
),
|
37 |
+
reason=ErrorReason.INVALID_LENGTH,
|
38 |
+
)
|
39 |
+
|
40 |
+
unicode_sheet_name = _preprocess(sheet_name)
|
41 |
+
match = __RE_INVALID_EXCEL_SHEET_NAME.search(unicode_sheet_name)
|
42 |
+
if match is not None:
|
43 |
+
raise ValidationError(
|
44 |
+
description="invalid char found in the sheet name: '{:s}'".format(
|
45 |
+
re.escape(match.group())
|
46 |
+
),
|
47 |
+
reason=ErrorReason.INVALID_CHARACTER,
|
48 |
+
)
|
49 |
+
|
50 |
+
|
51 |
+
def sanitize_excel_sheet_name(sheet_name: str, replacement_text: str = "") -> str:
|
52 |
+
"""
|
53 |
+
Replace invalid characters for an Excel sheet name within
|
54 |
+
the ``sheet_name`` with the ``replacement_text``.
|
55 |
+
Invalid characters are as follows:
|
56 |
+
|invalid_excel_sheet_chars|.
|
57 |
+
The ``sheet_name`` truncate to 31 characters
|
58 |
+
(max sheet name length of Excel) from the head, if the length
|
59 |
+
of the name is exceed 31 characters.
|
60 |
+
|
61 |
+
:param str sheet_name: Excel sheet name to sanitize.
|
62 |
+
:param str replacement_text: Replacement text.
|
63 |
+
:return: A replacement string.
|
64 |
+
:rtype: str
|
65 |
+
:raises ValueError: If the ``sheet_name`` is an invalid sheet name.
|
66 |
+
"""
|
67 |
+
|
68 |
+
try:
|
69 |
+
unicode_sheet_name = _preprocess(sheet_name)
|
70 |
+
except AttributeError as e:
|
71 |
+
raise ValueError(e)
|
72 |
+
|
73 |
+
modify_sheet_name = __RE_INVALID_EXCEL_SHEET_NAME.sub(replacement_text, unicode_sheet_name)
|
74 |
+
|
75 |
+
return modify_sheet_name[:__MAX_SHEET_NAME_LEN]
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_interface.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import abc
|
6 |
+
from typing import List
|
7 |
+
|
8 |
+
from pathvalidate import validate_pathtype
|
9 |
+
|
10 |
+
|
11 |
+
class NameSanitizer(metaclass=abc.ABCMeta):
|
12 |
+
@abc.abstractproperty
|
13 |
+
def reserved_keywords(self) -> List[str]: # pragma: no cover
|
14 |
+
pass
|
15 |
+
|
16 |
+
@abc.abstractmethod
|
17 |
+
def validate(self) -> None: # pragma: no cover
|
18 |
+
pass
|
19 |
+
|
20 |
+
@abc.abstractmethod
|
21 |
+
def sanitize(self, replacement_text: str = "") -> str: # pragma: no cover
|
22 |
+
pass
|
23 |
+
|
24 |
+
@property
|
25 |
+
def _str(self) -> str:
|
26 |
+
return str(self._value)
|
27 |
+
|
28 |
+
def __init__(self, value: str) -> None:
|
29 |
+
self._validate_null_string(value)
|
30 |
+
|
31 |
+
self._value = value.strip()
|
32 |
+
|
33 |
+
def _is_reserved_keyword(self, value: str) -> bool:
|
34 |
+
return value in self.reserved_keywords
|
35 |
+
|
36 |
+
@staticmethod
|
37 |
+
def _validate_null_string(text: str) -> None:
|
38 |
+
validate_pathtype(text)
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_javascript.py
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import re
|
6 |
+
from typing import List, Pattern
|
7 |
+
|
8 |
+
from ._base import VarNameSanitizer
|
9 |
+
|
10 |
+
|
11 |
+
class JavaScriptVarNameSanitizer(VarNameSanitizer):
|
12 |
+
__JS_RESERVED_KEYWORDS_ES6 = [
|
13 |
+
"break",
|
14 |
+
"case",
|
15 |
+
"catch",
|
16 |
+
"class",
|
17 |
+
"const",
|
18 |
+
"continue",
|
19 |
+
"debugger",
|
20 |
+
"default",
|
21 |
+
"delete",
|
22 |
+
"do",
|
23 |
+
"else",
|
24 |
+
"export",
|
25 |
+
"extends",
|
26 |
+
"finally",
|
27 |
+
"for",
|
28 |
+
"function",
|
29 |
+
"if",
|
30 |
+
"import",
|
31 |
+
"in",
|
32 |
+
"instanceof",
|
33 |
+
"new",
|
34 |
+
"return",
|
35 |
+
"super",
|
36 |
+
"switch",
|
37 |
+
"this",
|
38 |
+
"throw",
|
39 |
+
"try",
|
40 |
+
"typeof",
|
41 |
+
"var",
|
42 |
+
"void",
|
43 |
+
"while",
|
44 |
+
"with",
|
45 |
+
"yield",
|
46 |
+
]
|
47 |
+
__JS_RESERVED_KEYWORDS_FUTURE = [
|
48 |
+
"enum",
|
49 |
+
"implements",
|
50 |
+
"interface",
|
51 |
+
"let",
|
52 |
+
"package",
|
53 |
+
"private",
|
54 |
+
"protected",
|
55 |
+
"public",
|
56 |
+
"static",
|
57 |
+
"await",
|
58 |
+
"abstract",
|
59 |
+
"boolean",
|
60 |
+
"byte",
|
61 |
+
"char",
|
62 |
+
"double",
|
63 |
+
"final",
|
64 |
+
"float",
|
65 |
+
"goto",
|
66 |
+
"int",
|
67 |
+
"long",
|
68 |
+
"native",
|
69 |
+
"short",
|
70 |
+
"synchronized",
|
71 |
+
"throws",
|
72 |
+
"transient",
|
73 |
+
"volatile",
|
74 |
+
]
|
75 |
+
__JS_BUILTIN_CONSTANTS = ["null", "true", "false"]
|
76 |
+
|
77 |
+
__RE_INVALID_VAR_NAME = re.compile("[^a-zA-Z0-9_$]")
|
78 |
+
__RE_INVALID_VAR_NAME_HEAD = re.compile("^[^a-zA-Z$]+")
|
79 |
+
|
80 |
+
@property
|
81 |
+
def reserved_keywords(self) -> List[str]:
|
82 |
+
return (
|
83 |
+
self.__JS_RESERVED_KEYWORDS_ES6
|
84 |
+
+ self.__JS_RESERVED_KEYWORDS_FUTURE
|
85 |
+
+ self.__JS_BUILTIN_CONSTANTS
|
86 |
+
)
|
87 |
+
|
88 |
+
@property
|
89 |
+
def _invalid_var_name_head_re(self) -> Pattern[str]:
|
90 |
+
return self.__RE_INVALID_VAR_NAME_HEAD
|
91 |
+
|
92 |
+
@property
|
93 |
+
def _invalid_var_name_re(self) -> Pattern[str]:
|
94 |
+
return self.__RE_INVALID_VAR_NAME
|
95 |
+
|
96 |
+
|
97 |
+
def validate_js_var_name(var_name: str) -> None:
|
98 |
+
"""
|
99 |
+
:param str var_name: Name to validate.
|
100 |
+
:raises pathvalidate.ValidationError (ErrorReason.INVALID_CHARACTER):
|
101 |
+
If the ``var_name`` is invalid as a JavaScript identifier.
|
102 |
+
:raises pathvalidate.ValidationError (ErrorReason.RESERVED_NAME):
|
103 |
+
If the ``var_name`` is equals to
|
104 |
+
`JavaScript reserved keywords
|
105 |
+
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords>`__.
|
106 |
+
|
107 |
+
.. note::
|
108 |
+
|
109 |
+
Currently, not supported unicode variable names.
|
110 |
+
"""
|
111 |
+
|
112 |
+
JavaScriptVarNameSanitizer(var_name).validate()
|
113 |
+
|
114 |
+
|
115 |
+
def sanitize_js_var_name(var_name: str, replacement_text: str = "") -> str:
|
116 |
+
"""
|
117 |
+
Make a valid JavaScript variable name from ``var_name``.
|
118 |
+
|
119 |
+
To make a valid name:
|
120 |
+
|
121 |
+
- Replace invalid characters for a JavaScript variable name within
|
122 |
+
the ``var_name`` with the ``replacement_text``
|
123 |
+
- Delete invalid chars for the beginning of the variable name
|
124 |
+
- Append underscore (``"_"``) at the tail of the name if sanitized name
|
125 |
+
is one of the JavaScript reserved names
|
126 |
+
|
127 |
+
:JavaScriptstr filename: Name to sanitize.
|
128 |
+
:param str replacement_text: Replacement text.
|
129 |
+
:return: A replacement string.
|
130 |
+
:rtype: str
|
131 |
+
:raises ValueError: If ``var_name`` or ``replacement_text`` is invalid.
|
132 |
+
|
133 |
+
:Example:
|
134 |
+
:ref:`example-sanitize-var-name`
|
135 |
+
|
136 |
+
.. note::
|
137 |
+
Currently, not supported Unicode variable names.
|
138 |
+
|
139 |
+
.. seealso::
|
140 |
+
:py:func:`.validate_js_var_name`
|
141 |
+
"""
|
142 |
+
|
143 |
+
return JavaScriptVarNameSanitizer(var_name).sanitize(replacement_text)
|
venv/lib/python3.10/site-packages/pytablewriter/sanitizer/_python.py
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
.. codeauthor:: Tsuyoshi Hombashi <[email protected]>
|
3 |
+
"""
|
4 |
+
|
5 |
+
import re
|
6 |
+
from typing import List, Pattern
|
7 |
+
|
8 |
+
from ._base import VarNameSanitizer
|
9 |
+
|
10 |
+
|
11 |
+
class PythonVarNameSanitizer(VarNameSanitizer):
|
12 |
+
__PYTHON_RESERVED_KEYWORDS = [
|
13 |
+
"and",
|
14 |
+
"del",
|
15 |
+
"from",
|
16 |
+
"not",
|
17 |
+
"while",
|
18 |
+
"as",
|
19 |
+
"elif",
|
20 |
+
"global",
|
21 |
+
"or",
|
22 |
+
"with",
|
23 |
+
"assert",
|
24 |
+
"else",
|
25 |
+
"if",
|
26 |
+
"pass",
|
27 |
+
"yield",
|
28 |
+
"break",
|
29 |
+
"except",
|
30 |
+
"import",
|
31 |
+
"print",
|
32 |
+
"class",
|
33 |
+
"exec",
|
34 |
+
"in",
|
35 |
+
"raise",
|
36 |
+
"continue",
|
37 |
+
"finally",
|
38 |
+
"is",
|
39 |
+
"return",
|
40 |
+
"def",
|
41 |
+
"for",
|
42 |
+
"lambda",
|
43 |
+
"try",
|
44 |
+
]
|
45 |
+
__PYTHON_BUILTIN_CONSTANTS = [
|
46 |
+
"False",
|
47 |
+
"True",
|
48 |
+
"None",
|
49 |
+
"NotImplemented",
|
50 |
+
"Ellipsis",
|
51 |
+
"__debug__",
|
52 |
+
]
|
53 |
+
|
54 |
+
__RE_INVALID_VAR_NAME = re.compile("[^a-zA-Z0-9_]")
|
55 |
+
__RE_INVALID_VAR_NAME_HEAD = re.compile("^[^a-zA-Z]+")
|
56 |
+
|
57 |
+
@property
|
58 |
+
def reserved_keywords(self) -> List[str]:
|
59 |
+
return self.__PYTHON_RESERVED_KEYWORDS + self.__PYTHON_BUILTIN_CONSTANTS
|
60 |
+
|
61 |
+
@property
|
62 |
+
def _invalid_var_name_head_re(self) -> Pattern[str]:
|
63 |
+
return self.__RE_INVALID_VAR_NAME_HEAD
|
64 |
+
|
65 |
+
@property
|
66 |
+
def _invalid_var_name_re(self) -> Pattern[str]:
|
67 |
+
return self.__RE_INVALID_VAR_NAME
|
68 |
+
|
69 |
+
|
70 |
+
def validate_python_var_name(var_name: str) -> None:
|
71 |
+
"""
|
72 |
+
:param str var_name: Name to validate.
|
73 |
+
:raises pathvalidate.ValidationError (ErrorReason.INVALID_CHARACTER):
|
74 |
+
If the ``var_name`` is invalid as
|
75 |
+
`Python identifier
|
76 |
+
<https://docs.python.org/3/reference/lexical_analysis.html#identifiers>`__.
|
77 |
+
:raises pathvalidate.ValidationError (ErrorReason.RESERVED_NAME):
|
78 |
+
If the ``var_name`` is equals to
|
79 |
+
`Python reserved keywords
|
80 |
+
<https://docs.python.org/3/reference/lexical_analysis.html#keywords>`__
|
81 |
+
or
|
82 |
+
`Python built-in constants
|
83 |
+
<https://docs.python.org/3/library/constants.html>`__.
|
84 |
+
|
85 |
+
:Example:
|
86 |
+
:ref:`example-validate-var-name`
|
87 |
+
"""
|
88 |
+
|
89 |
+
PythonVarNameSanitizer(var_name).validate()
|
90 |
+
|
91 |
+
|
92 |
+
def sanitize_python_var_name(var_name: str, replacement_text: str = "") -> str:
|
93 |
+
"""
|
94 |
+
Make a valid Python variable name from ``var_name``.
|
95 |
+
|
96 |
+
To make a valid name:
|
97 |
+
|
98 |
+
- Replace invalid characters for a Python variable name within
|
99 |
+
the ``var_name`` with the ``replacement_text``
|
100 |
+
- Delete invalid chars for the beginning of the variable name
|
101 |
+
- Append underscore (``"_"``) at the tail of the name if sanitized name
|
102 |
+
is one of the Python reserved names
|
103 |
+
|
104 |
+
:param str filename: Name to sanitize.
|
105 |
+
:param str replacement_text: Replacement text.
|
106 |
+
:return: A replacement string.
|
107 |
+
:rtype: str
|
108 |
+
:raises ValueError: If ``var_name`` or ``replacement_text`` is invalid.
|
109 |
+
|
110 |
+
:Example:
|
111 |
+
:ref:`example-sanitize-var-name`
|
112 |
+
|
113 |
+
.. seealso::
|
114 |
+
:py:func:`.validate_python_var_name`
|
115 |
+
"""
|
116 |
+
|
117 |
+
return PythonVarNameSanitizer(var_name).sanitize(replacement_text)
|
venv/lib/python3.10/site-packages/pytablewriter/style/__init__.py
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from dataproperty import Align, Format
|
2 |
+
|
3 |
+
from ._cell import Cell
|
4 |
+
from ._font import FontSize, FontStyle, FontWeight
|
5 |
+
from ._style import DecorationLine, Style, ThousandSeparator, VerticalAlign
|
6 |
+
from ._styler import (
|
7 |
+
GFMarkdownStyler,
|
8 |
+
HtmlStyler,
|
9 |
+
LatexStyler,
|
10 |
+
MarkdownStyler,
|
11 |
+
NullStyler,
|
12 |
+
ReStructuredTextStyler,
|
13 |
+
TextStyler,
|
14 |
+
get_align_char,
|
15 |
+
)
|
16 |
+
from ._styler_interface import StylerInterface
|
17 |
+
from ._theme import (
|
18 |
+
CheckStyleFilterKeywordArgsFunc,
|
19 |
+
ColSeparatorStyleFilterFunc,
|
20 |
+
StyleFilterFunc,
|
21 |
+
Theme,
|
22 |
+
fetch_theme,
|
23 |
+
list_themes,
|
24 |
+
)
|
25 |
+
|
26 |
+
|
27 |
+
__all__ = (
|
28 |
+
"Align",
|
29 |
+
"Format",
|
30 |
+
"Cell",
|
31 |
+
"FontSize",
|
32 |
+
"FontStyle",
|
33 |
+
"FontWeight",
|
34 |
+
"Style",
|
35 |
+
"ThousandSeparator",
|
36 |
+
"VerticalAlign",
|
37 |
+
"DecorationLine",
|
38 |
+
"GFMarkdownStyler",
|
39 |
+
"HtmlStyler",
|
40 |
+
"LatexStyler",
|
41 |
+
"MarkdownStyler",
|
42 |
+
"NullStyler",
|
43 |
+
"ReStructuredTextStyler",
|
44 |
+
"StylerInterface",
|
45 |
+
"TextStyler",
|
46 |
+
"CheckStyleFilterKeywordArgsFunc",
|
47 |
+
"ColSeparatorStyleFilterFunc",
|
48 |
+
"StyleFilterFunc",
|
49 |
+
"Theme",
|
50 |
+
"get_align_char",
|
51 |
+
"fetch_theme",
|
52 |
+
"list_themes",
|
53 |
+
)
|
venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (1.08 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_cell.cpython-310.pyc
ADDED
Binary file (887 Bytes). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_font.cpython-310.pyc
ADDED
Binary file (890 Bytes). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_style.cpython-310.pyc
ADDED
Binary file (11.7 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_styler.cpython-310.pyc
ADDED
Binary file (10.7 kB). View file
|
|
venv/lib/python3.10/site-packages/pytablewriter/style/__pycache__/_styler_interface.cpython-310.pyc
ADDED
Binary file (1.38 kB). View file
|
|