Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +5 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/__pycache__/_pydecimal.cpython-38.pyc +3 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/INSTALLER +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/LICENSE.rst +21 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/METADATA +187 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/RECORD +13 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/REQUESTED +0 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/WHEEL +6 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/top_level.txt +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/SimpleITK.py +0 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/__init__.py +21 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/_version.py +54 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/extra.py +444 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/async_timeout/__init__.py +247 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/async_timeout/py.typed +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/INSTALLER +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/LICENSE +504 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/METADATA +98 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/RECORD +92 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/REQUESTED +0 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/WHEEL +6 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/entry_points.txt +3 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/top_level.txt +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/__init__.py +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/extract.py +85 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/lazy_wheel.py +265 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/s3.py +83 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/transmute.py +161 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/einops_exts/einops_exts.py +63 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/einops_exts/torch.py +19 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/__init__.py +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/deform_grid.py +455 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/tf.py +72 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/torch.py +66 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/INSTALLER +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/LICENSE +201 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/METADATA +152 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/RECORD +13 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/REQUESTED +0 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/WHEEL +8 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/top_level.txt +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/INSTALLER +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/LICENSE +242 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/METADATA +144 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/RECORD +117 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/REQUESTED +0 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/WHEEL +6 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/top_level.txt +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/networkx-2.8.5.dist-info/INSTALLER +1 -0
- my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/networkx-2.8.5.dist-info/REQUESTED +0 -0
.gitattributes
CHANGED
|
@@ -196,3 +196,8 @@ my_container_sandbox/workspace/anaconda3/bin/lzcat filter=lfs diff=lfs merge=lfs
|
|
| 196 |
my_container_sandbox/workspace/anaconda3/bin/xz filter=lfs diff=lfs merge=lfs -text
|
| 197 |
my_container_sandbox/workspace/anaconda3/bin/lzma filter=lfs diff=lfs merge=lfs -text
|
| 198 |
my_container_sandbox/workspace/anaconda3/bin/xzcat filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
my_container_sandbox/workspace/anaconda3/bin/xz filter=lfs diff=lfs merge=lfs -text
|
| 197 |
my_container_sandbox/workspace/anaconda3/bin/lzma filter=lfs diff=lfs merge=lfs -text
|
| 198 |
my_container_sandbox/workspace/anaconda3/bin/xzcat filter=lfs diff=lfs merge=lfs -text
|
| 199 |
+
my_container_sandbox/workspace/anaconda3/pkgs/openssl-1.1.1w-h7f8727e_0.conda filter=lfs diff=lfs merge=lfs -text
|
| 200 |
+
my_container_sandbox/workspace/anaconda3/pkgs/zstandard-0.19.0-py38h5eee18b_0.conda filter=lfs diff=lfs merge=lfs -text
|
| 201 |
+
my_container_sandbox/workspace/anaconda3/pkgs/pip-24.0-pyhd8ed1ab_0.conda filter=lfs diff=lfs merge=lfs -text
|
| 202 |
+
my_container_sandbox/workspace/anaconda3/pkgs/conda-package-handling-1.7.3-py39h27cfd23_1.conda filter=lfs diff=lfs merge=lfs -text
|
| 203 |
+
my_container_sandbox/workspace/anaconda3/lib/python3.8/__pycache__/_pydecimal.cpython-38.pyc filter=lfs diff=lfs merge=lfs -text
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/__pycache__/_pydecimal.cpython-38.pyc
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d89188cfdff49c07cab8161529efbf255799c22d5cb41f125008315a2dd60e8
|
| 3 |
+
size 160730
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/LICENSE.rst
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2017 Laurent LAPORTE
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/METADATA
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: Deprecated
|
| 3 |
+
Version: 1.2.13
|
| 4 |
+
Summary: Python @deprecated decorator to deprecate old python classes, functions or methods.
|
| 5 |
+
Home-page: https://github.com/tantale/deprecated
|
| 6 |
+
Author: Laurent LAPORTE
|
| 7 |
+
Author-email: tantale.solutions@gmail.com
|
| 8 |
+
License: MIT
|
| 9 |
+
Project-URL: Documentation, https://deprecated.readthedocs.io/en/latest/
|
| 10 |
+
Project-URL: Source, https://github.com/tantale/deprecated
|
| 11 |
+
Project-URL: Bug Tracker, https://github.com/tantale/deprecated/issues
|
| 12 |
+
Keywords: deprecate,deprecated,deprecation,warning,warn,decorator
|
| 13 |
+
Platform: any
|
| 14 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 15 |
+
Classifier: Environment :: Web Environment
|
| 16 |
+
Classifier: Intended Audience :: Developers
|
| 17 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 18 |
+
Classifier: Operating System :: OS Independent
|
| 19 |
+
Classifier: Programming Language :: Python
|
| 20 |
+
Classifier: Programming Language :: Python :: 2
|
| 21 |
+
Classifier: Programming Language :: Python :: 2.7
|
| 22 |
+
Classifier: Programming Language :: Python :: 3
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.4
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.5
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.6
|
| 26 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 27 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 28 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 29 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 30 |
+
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
|
| 31 |
+
Description-Content-Type: text/x-rst
|
| 32 |
+
License-File: LICENSE.rst
|
| 33 |
+
Requires-Dist: wrapt (<2,>=1.10)
|
| 34 |
+
Provides-Extra: dev
|
| 35 |
+
Requires-Dist: tox ; extra == 'dev'
|
| 36 |
+
Requires-Dist: bump2version (<1) ; extra == 'dev'
|
| 37 |
+
Requires-Dist: sphinx (<2) ; extra == 'dev'
|
| 38 |
+
Requires-Dist: importlib-metadata (<3) ; (python_version < "3") and extra == 'dev'
|
| 39 |
+
Requires-Dist: importlib-resources (<4) ; (python_version < "3") and extra == 'dev'
|
| 40 |
+
Requires-Dist: configparser (<5) ; (python_version < "3") and extra == 'dev'
|
| 41 |
+
Requires-Dist: sphinxcontrib-websupport (<2) ; (python_version < "3") and extra == 'dev'
|
| 42 |
+
Requires-Dist: zipp (<2) ; (python_version < "3") and extra == 'dev'
|
| 43 |
+
Requires-Dist: PyTest (<5) ; (python_version < "3.6") and extra == 'dev'
|
| 44 |
+
Requires-Dist: PyTest-Cov (<2.6) ; (python_version < "3.6") and extra == 'dev'
|
| 45 |
+
Requires-Dist: PyTest ; (python_version >= "3.6") and extra == 'dev'
|
| 46 |
+
Requires-Dist: PyTest-Cov ; (python_version >= "3.6") and extra == 'dev'
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
Deprecated Library
|
| 50 |
+
------------------
|
| 51 |
+
|
| 52 |
+
Deprecated is Easy to Use
|
| 53 |
+
`````````````````````````
|
| 54 |
+
|
| 55 |
+
If you need to mark a function or a method as deprecated,
|
| 56 |
+
you can use the ``@deprecated`` decorator:
|
| 57 |
+
|
| 58 |
+
Save in a hello.py:
|
| 59 |
+
|
| 60 |
+
.. code:: python
|
| 61 |
+
|
| 62 |
+
from deprecated import deprecated
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
@deprecated(version='1.2.1', reason="You should use another function")
|
| 66 |
+
def some_old_function(x, y):
|
| 67 |
+
return x + y
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
class SomeClass(object):
|
| 71 |
+
@deprecated(version='1.3.0', reason="This method is deprecated")
|
| 72 |
+
def some_old_method(self, x, y):
|
| 73 |
+
return x + y
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
some_old_function(12, 34)
|
| 77 |
+
obj = SomeClass()
|
| 78 |
+
obj.some_old_method(5, 8)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
And Easy to Setup
|
| 82 |
+
`````````````````
|
| 83 |
+
|
| 84 |
+
And run it:
|
| 85 |
+
|
| 86 |
+
.. code:: bash
|
| 87 |
+
|
| 88 |
+
$ pip install Deprecated
|
| 89 |
+
$ python hello.py
|
| 90 |
+
hello.py:15: DeprecationWarning: Call to deprecated function (or staticmethod) some_old_function.
|
| 91 |
+
(You should use another function) -- Deprecated since version 1.2.0.
|
| 92 |
+
some_old_function(12, 34)
|
| 93 |
+
hello.py:17: DeprecationWarning: Call to deprecated method some_old_method.
|
| 94 |
+
(This method is deprecated) -- Deprecated since version 1.3.0.
|
| 95 |
+
obj.some_old_method(5, 8)
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
You can document your code
|
| 99 |
+
``````````````````````````
|
| 100 |
+
|
| 101 |
+
Have you ever wonder how to document that some functions, classes, methods, etc. are deprecated?
|
| 102 |
+
This is now possible with the integrated Sphinx directives:
|
| 103 |
+
|
| 104 |
+
For instance, in hello_sphinx.py:
|
| 105 |
+
|
| 106 |
+
.. code:: python
|
| 107 |
+
|
| 108 |
+
from deprecated.sphinx import deprecated
|
| 109 |
+
from deprecated.sphinx import versionadded
|
| 110 |
+
from deprecated.sphinx import versionchanged
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
@versionadded(version='1.0', reason="This function is new")
|
| 114 |
+
def function_one():
|
| 115 |
+
'''This is the function one'''
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
@versionchanged(version='1.0', reason="This function is modified")
|
| 119 |
+
def function_two():
|
| 120 |
+
'''This is the function two'''
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
@deprecated(version='1.0', reason="This function will be removed soon")
|
| 124 |
+
def function_three():
|
| 125 |
+
'''This is the function three'''
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
function_one()
|
| 129 |
+
function_two()
|
| 130 |
+
function_three() # warns
|
| 131 |
+
|
| 132 |
+
help(function_one)
|
| 133 |
+
help(function_two)
|
| 134 |
+
help(function_three)
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
The result it immediate
|
| 138 |
+
```````````````````````
|
| 139 |
+
|
| 140 |
+
Run it:
|
| 141 |
+
|
| 142 |
+
.. code:: bash
|
| 143 |
+
|
| 144 |
+
$ python hello_sphinx.py
|
| 145 |
+
|
| 146 |
+
hello_sphinx.py:23: DeprecationWarning: Call to deprecated function (or staticmethod) function_three.
|
| 147 |
+
(This function will be removed soon) -- Deprecated since version 1.0.
|
| 148 |
+
function_three() # warns
|
| 149 |
+
|
| 150 |
+
Help on function function_one in module __main__:
|
| 151 |
+
|
| 152 |
+
function_one()
|
| 153 |
+
This is the function one
|
| 154 |
+
|
| 155 |
+
.. versionadded:: 1.0
|
| 156 |
+
This function is new
|
| 157 |
+
|
| 158 |
+
Help on function function_two in module __main__:
|
| 159 |
+
|
| 160 |
+
function_two()
|
| 161 |
+
This is the function two
|
| 162 |
+
|
| 163 |
+
.. versionchanged:: 1.0
|
| 164 |
+
This function is modified
|
| 165 |
+
|
| 166 |
+
Help on function function_three in module __main__:
|
| 167 |
+
|
| 168 |
+
function_three()
|
| 169 |
+
This is the function three
|
| 170 |
+
|
| 171 |
+
.. deprecated:: 1.0
|
| 172 |
+
This function will be removed soon
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
Links
|
| 176 |
+
`````
|
| 177 |
+
|
| 178 |
+
* `Python package index (PyPi) <https://pypi.python.org/pypi/deprecated>`_
|
| 179 |
+
* `GitHub website <https://github.com/tantale/deprecated>`_
|
| 180 |
+
* `Read The Docs <https://readthedocs.org/projects/deprecated>`_
|
| 181 |
+
* `EBook on Lulu.com <http://www.lulu.com/commerce/index.php?fBuyContent=21305117>`_
|
| 182 |
+
* `StackOverFlow Q&A <https://stackoverflow.com/a/40301488/1513933>`_
|
| 183 |
+
* `Development version
|
| 184 |
+
<https://github.com/tantale/deprecated/zipball/master#egg=Deprecated-dev>`_
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/RECORD
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Deprecated-1.2.13.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
Deprecated-1.2.13.dist-info/LICENSE.rst,sha256=HoPt0VvkGbXVveNy4yXlJ_9PmRX1SOfHUxS0H2aZ6Dw,1081
|
| 3 |
+
Deprecated-1.2.13.dist-info/METADATA,sha256=3yaMBaEEx4K_RPhU7Bmb8P_UprR9-67MvES0XRGK7go,5817
|
| 4 |
+
Deprecated-1.2.13.dist-info/RECORD,,
|
| 5 |
+
Deprecated-1.2.13.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
Deprecated-1.2.13.dist-info/WHEEL,sha256=8zNYZbwQSXoB9IfXOjPfeNwvAsALAjffgk27FqvCWbo,110
|
| 7 |
+
Deprecated-1.2.13.dist-info/top_level.txt,sha256=nHbOYawKPQQE5lQl-toUB1JBRJjUyn_m_Mb8RVJ0RjA,11
|
| 8 |
+
deprecated/__init__.py,sha256=YA_PiKdeI1jWCt2FxdMLc9wFZ_DDZFl0OlI6jf6mdeo,349
|
| 9 |
+
deprecated/__pycache__/__init__.cpython-38.pyc,,
|
| 10 |
+
deprecated/__pycache__/classic.cpython-38.pyc,,
|
| 11 |
+
deprecated/__pycache__/sphinx.cpython-38.pyc,,
|
| 12 |
+
deprecated/classic.py,sha256=QugmUi7IhBvp2nDvMtyWqFDPRR43-9nfSZG1ZJSDpFM,9880
|
| 13 |
+
deprecated/sphinx.py,sha256=zrgb7gbK4iixgRbO_AXusI8_Gi4JwrQJZHs3RZArdfE,9988
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/REQUESTED
ADDED
|
File without changes
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.33.6)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py2-none-any
|
| 5 |
+
Tag: py3-none-any
|
| 6 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/Deprecated-1.2.13.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
deprecated
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/SimpleITK.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ========================================================================
|
| 2 |
+
#
|
| 3 |
+
# Copyright NumFOCUS
|
| 4 |
+
#
|
| 5 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
# you may not use this file except in compliance with the License.
|
| 7 |
+
# You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
#
|
| 17 |
+
# ========================================================================
|
| 18 |
+
from SimpleITK.SimpleITK import *
|
| 19 |
+
from SimpleITK.extra import *
|
| 20 |
+
|
| 21 |
+
from SimpleITK._version import __version__
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/_version.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ========================================================================
|
| 2 |
+
#
|
| 3 |
+
# Copyright NumFOCUS
|
| 4 |
+
#
|
| 5 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
# you may not use this file except in compliance with the License.
|
| 7 |
+
# You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
#
|
| 17 |
+
# ========================================================================
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def _get_pep386version():
|
| 21 |
+
"""Uses configured CMake version variable to construct a pep 386 compliant version string."""
|
| 22 |
+
|
| 23 |
+
sitk_major = "2"
|
| 24 |
+
sitk_minor = "1"
|
| 25 |
+
sitk_patch = "1"
|
| 26 |
+
sitk_tweak = "2"
|
| 27 |
+
sitk_rc = ""
|
| 28 |
+
sitk_post = ""
|
| 29 |
+
sitk_dev = ""
|
| 30 |
+
sitk_hash = "5627c"
|
| 31 |
+
|
| 32 |
+
version = sitk_major + "." + sitk_minor
|
| 33 |
+
|
| 34 |
+
if sitk_patch:
|
| 35 |
+
version += "." + sitk_patch
|
| 36 |
+
if sitk_tweak:
|
| 37 |
+
version += "." + sitk_tweak
|
| 38 |
+
|
| 39 |
+
if sitk_rc:
|
| 40 |
+
version += sitk_rc
|
| 41 |
+
|
| 42 |
+
if sitk_post:
|
| 43 |
+
version += ".post" + sitk_post
|
| 44 |
+
elif sitk_dev:
|
| 45 |
+
version += ".dev" + sitk_dev
|
| 46 |
+
|
| 47 |
+
# Local Version Identifier
|
| 48 |
+
if sitk_hash and "ON" not in ['1', 'ON']:
|
| 49 |
+
version += "+g" + sitk_hash
|
| 50 |
+
|
| 51 |
+
return version
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
__version__ = _get_pep386version()
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/SimpleITK/extra.py
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ========================================================================
|
| 2 |
+
#
|
| 3 |
+
# Copyright NumFOCUS
|
| 4 |
+
#
|
| 5 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
# you may not use this file except in compliance with the License.
|
| 7 |
+
# You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
#
|
| 17 |
+
# ========================================================================
|
| 18 |
+
|
| 19 |
+
from SimpleITK.SimpleITK import *
|
| 20 |
+
from SimpleITK.SimpleITK import _GetMemoryViewFromImage
|
| 21 |
+
from SimpleITK.SimpleITK import _SetImageFromArray
|
| 22 |
+
|
| 23 |
+
from typing import List, Union
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def Resample(image1, *args, **kwargs):
|
| 27 |
+
"""
|
| 28 |
+
Resample ( Image image1,
|
| 29 |
+
Transform transform = itk::simple::Transform(),
|
| 30 |
+
InterpolatorEnum interpolator = itk::simple::sitkLinear,
|
| 31 |
+
double defaultPixelValue = 0.0,
|
| 32 |
+
PixelIDValueEnum outputPixelType = itk::simple::sitkUnknown,
|
| 33 |
+
bool useNearestNeighborExtrapolator = false);
|
| 34 |
+
|
| 35 |
+
Resample ( Image image1,
|
| 36 |
+
Image referenceImage,
|
| 37 |
+
Transform transform = itk::simple::Transform(),
|
| 38 |
+
InterpolatorEnum interpolator = itk::simple::sitkLinear,
|
| 39 |
+
double defaultPixelValue = 0.0,
|
| 40 |
+
PixelIDValueEnum outputPixelType = sitkUnknown,
|
| 41 |
+
bool useNearestNeighborExtrapolator = false);
|
| 42 |
+
|
| 43 |
+
Resample ( const Image& image1,
|
| 44 |
+
VectorUInt32 size,
|
| 45 |
+
Transform transform = itk::simple::Transform(),
|
| 46 |
+
InterpolatorEnum interpolator = itk::simple::sitkLinear,
|
| 47 |
+
VectorDouble outputOrigin = std::vector<double>(3, 0.0),
|
| 48 |
+
VectorDouble outputSpacing = std::vector<double>(3, 1.0),
|
| 49 |
+
VectorDouble outputDirection = std::vector<double>(),
|
| 50 |
+
double defaultPixelValue = 0.0,
|
| 51 |
+
PixelIDValueEnum outputPixelType = sitkUnknown,
|
| 52 |
+
bool useNearestNeighborExtrapolator = false);
|
| 53 |
+
|
| 54 |
+
itk::simple::ResampleImageFilter procedural interface.
|
| 55 |
+
|
| 56 |
+
This is a custom overloaded python method, which fully supports the 3 signatures with positional and keyword
|
| 57 |
+
arguments. The second positional parameters without a default value are used to determine which overloaded
|
| 58 |
+
procedure signature to invoke.
|
| 59 |
+
|
| 60 |
+
"""
|
| 61 |
+
|
| 62 |
+
def _r_image(referenceImage,
|
| 63 |
+
transform=Transform(),
|
| 64 |
+
interpolator=sitkLinear,
|
| 65 |
+
defaultPixelValue=0.0,
|
| 66 |
+
outputPixelType=sitkUnknown,
|
| 67 |
+
useNearestNeighborExtrapolator=False):
|
| 68 |
+
resampler = ResampleImageFilter()
|
| 69 |
+
resampler.SetReferenceImage(referenceImage)
|
| 70 |
+
resampler.SetTransform(transform)
|
| 71 |
+
resampler.SetInterpolator(interpolator)
|
| 72 |
+
resampler.SetDefaultPixelValue(defaultPixelValue)
|
| 73 |
+
resampler.SetOutputPixelType(outputPixelType)
|
| 74 |
+
resampler.SetUseNearestNeighborExtrapolator(useNearestNeighborExtrapolator)
|
| 75 |
+
return resampler.Execute(image1)
|
| 76 |
+
|
| 77 |
+
def _r(size,
|
| 78 |
+
transform=Transform(),
|
| 79 |
+
interpolator=sitkLinear,
|
| 80 |
+
outputOrigin=(0.0, 0.0, 0.0),
|
| 81 |
+
outputSpacing=(1.0, 1.0, 1.0),
|
| 82 |
+
outputDirection=(),
|
| 83 |
+
defaultPixelValue=0.0,
|
| 84 |
+
outputPixelType=sitkUnknown,
|
| 85 |
+
useNearestNeighborExtrapolator=False):
|
| 86 |
+
resampler = ResampleImageFilter()
|
| 87 |
+
resampler.SetSize(size)
|
| 88 |
+
resampler.SetTransform(transform)
|
| 89 |
+
resampler.SetInterpolator(interpolator)
|
| 90 |
+
resampler.SetOutputOrigin(outputOrigin)
|
| 91 |
+
resampler.SetOutputSpacing(outputSpacing)
|
| 92 |
+
resampler.SetOutputDirection(outputDirection)
|
| 93 |
+
resampler.SetDefaultPixelValue(defaultPixelValue)
|
| 94 |
+
resampler.SetOutputPixelType(outputPixelType)
|
| 95 |
+
resampler.SetUseNearestNeighborExtrapolator(useNearestNeighborExtrapolator)
|
| 96 |
+
return resampler.Execute(image1)
|
| 97 |
+
|
| 98 |
+
if args:
|
| 99 |
+
if isinstance(args[0], Image):
|
| 100 |
+
return _r_image(*args, **kwargs)
|
| 101 |
+
if not isinstance(args[0], Transform):
|
| 102 |
+
try:
|
| 103 |
+
iter(args[0])
|
| 104 |
+
return _r(*args, **kwargs)
|
| 105 |
+
except TypeError as e:
|
| 106 |
+
pass
|
| 107 |
+
|
| 108 |
+
if "referenceImage" in kwargs:
|
| 109 |
+
return _r_image(*args, **kwargs)
|
| 110 |
+
if "size" in kwargs:
|
| 111 |
+
return _r(*args, **kwargs)
|
| 112 |
+
|
| 113 |
+
return _r_image(image1, *args, **kwargs)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
HAVE_NUMPY = True
|
| 117 |
+
try:
|
| 118 |
+
import numpy
|
| 119 |
+
except ImportError:
|
| 120 |
+
HAVE_NUMPY = False
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
def _get_numpy_dtype(sitkImage):
|
| 124 |
+
"""Given a SimpleITK image, returns the numpy.dtype which describes the data"""
|
| 125 |
+
|
| 126 |
+
if not HAVE_NUMPY:
|
| 127 |
+
raise ImportError('Numpy not available.')
|
| 128 |
+
|
| 129 |
+
# this is a mapping from sitk's pixel id to numpy's dtype
|
| 130 |
+
_sitk_np = {sitkUInt8: numpy.uint8,
|
| 131 |
+
sitkUInt16: numpy.uint16,
|
| 132 |
+
sitkUInt32: numpy.uint32,
|
| 133 |
+
sitkUInt64: numpy.uint64,
|
| 134 |
+
sitkInt8: numpy.int8,
|
| 135 |
+
sitkInt16: numpy.int16,
|
| 136 |
+
sitkInt32: numpy.int32,
|
| 137 |
+
sitkInt64: numpy.int64,
|
| 138 |
+
sitkFloat32: numpy.float32,
|
| 139 |
+
sitkFloat64: numpy.float64,
|
| 140 |
+
sitkComplexFloat32: numpy.complex64,
|
| 141 |
+
sitkComplexFloat64: numpy.complex128,
|
| 142 |
+
sitkVectorUInt8: numpy.uint8,
|
| 143 |
+
sitkVectorInt8: numpy.int8,
|
| 144 |
+
sitkVectorUInt16: numpy.uint16,
|
| 145 |
+
sitkVectorInt16: numpy.int16,
|
| 146 |
+
sitkVectorUInt32: numpy.uint32,
|
| 147 |
+
sitkVectorInt32: numpy.int32,
|
| 148 |
+
sitkVectorUInt64: numpy.uint64,
|
| 149 |
+
sitkVectorInt64: numpy.int64,
|
| 150 |
+
sitkVectorFloat32: numpy.float32,
|
| 151 |
+
sitkVectorFloat64: numpy.float64,
|
| 152 |
+
sitkLabelUInt8: numpy.uint8,
|
| 153 |
+
sitkLabelUInt16: numpy.uint16,
|
| 154 |
+
sitkLabelUInt32: numpy.uint32,
|
| 155 |
+
sitkLabelUInt64: numpy.uint64
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
return _sitk_np[sitkImage.GetPixelIDValue()]
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
def _get_sitk_pixelid(numpy_array_type):
|
| 162 |
+
"""Returns a SimpleITK PixelID given a numpy array."""
|
| 163 |
+
|
| 164 |
+
if not HAVE_NUMPY:
|
| 165 |
+
raise ImportError('Numpy not available.')
|
| 166 |
+
|
| 167 |
+
# This is a Mapping from numpy array types to sitks pixel types.
|
| 168 |
+
_np_sitk = {numpy.character: sitkUInt8,
|
| 169 |
+
numpy.uint8: sitkUInt8,
|
| 170 |
+
numpy.uint16: sitkUInt16,
|
| 171 |
+
numpy.uint32: sitkUInt32,
|
| 172 |
+
numpy.uint64: sitkUInt64,
|
| 173 |
+
numpy.int8: sitkInt8,
|
| 174 |
+
numpy.int16: sitkInt16,
|
| 175 |
+
numpy.int32: sitkInt32,
|
| 176 |
+
numpy.int64: sitkInt64,
|
| 177 |
+
numpy.float32: sitkFloat32,
|
| 178 |
+
numpy.float64: sitkFloat64,
|
| 179 |
+
numpy.complex64: sitkComplexFloat32,
|
| 180 |
+
numpy.complex128: sitkComplexFloat64
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
try:
|
| 184 |
+
return _np_sitk[numpy_array_type.dtype]
|
| 185 |
+
except KeyError:
|
| 186 |
+
for key in _np_sitk:
|
| 187 |
+
if numpy.issubdtype(numpy_array_type.dtype, key):
|
| 188 |
+
return _np_sitk[key]
|
| 189 |
+
raise TypeError('dtype: {0} is not supported.'.format(numpy_array_type.dtype))
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
def _get_sitk_vector_pixelid(numpy_array_type):
|
| 193 |
+
"""Returns a SimpleITK vector PixelID given a numpy array."""
|
| 194 |
+
|
| 195 |
+
if not HAVE_NUMPY:
|
| 196 |
+
raise ImportError('Numpy not available.')
|
| 197 |
+
|
| 198 |
+
# This is a Mapping from numpy array types to sitks pixel types.
|
| 199 |
+
_np_sitk = {numpy.character: sitkVectorUInt8,
|
| 200 |
+
numpy.uint8: sitkVectorUInt8,
|
| 201 |
+
numpy.uint16: sitkVectorUInt16,
|
| 202 |
+
numpy.uint32: sitkVectorUInt32,
|
| 203 |
+
numpy.uint64: sitkVectorUInt64,
|
| 204 |
+
numpy.int8: sitkVectorInt8,
|
| 205 |
+
numpy.int16: sitkVectorInt16,
|
| 206 |
+
numpy.int32: sitkVectorInt32,
|
| 207 |
+
numpy.int64: sitkVectorInt64,
|
| 208 |
+
numpy.float32: sitkVectorFloat32,
|
| 209 |
+
numpy.float64: sitkVectorFloat64,
|
| 210 |
+
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
try:
|
| 214 |
+
return _np_sitk[numpy_array_type.dtype]
|
| 215 |
+
except KeyError:
|
| 216 |
+
for key in _np_sitk:
|
| 217 |
+
if numpy.issubdtype(numpy_array_type.dtype, key):
|
| 218 |
+
return _np_sitk[key]
|
| 219 |
+
raise TypeError('dtype: {0} is not supported as an array.'.format(numpy_array_type.dtype))
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
# SimplyITK <-> Numpy Array conversion support.
|
| 223 |
+
|
| 224 |
+
def GetArrayViewFromImage(image):
|
| 225 |
+
"""Get a NumPy ndarray view of a SimpleITK Image.
|
| 226 |
+
|
| 227 |
+
Returns a Numpy ndarray object as a "view" of the SimpleITK's Image buffer. This reduces pixel buffer copies, but
|
| 228 |
+
requires that the SimpleITK image object is kept around while the buffer is being used.
|
| 229 |
+
"""
|
| 230 |
+
|
| 231 |
+
if not HAVE_NUMPY:
|
| 232 |
+
raise ImportError('NumPy not available.')
|
| 233 |
+
|
| 234 |
+
pixel_id = image.GetPixelIDValue()
|
| 235 |
+
assert pixel_id != sitkUnknown, "An SimpleITK image of Unknown pixel type should not exists!"
|
| 236 |
+
|
| 237 |
+
dtype = _get_numpy_dtype(image)
|
| 238 |
+
|
| 239 |
+
shape = image.GetSize()
|
| 240 |
+
if image.GetNumberOfComponentsPerPixel() > 1:
|
| 241 |
+
shape = (image.GetNumberOfComponentsPerPixel(), ) + shape
|
| 242 |
+
|
| 243 |
+
image.MakeUnique()
|
| 244 |
+
|
| 245 |
+
image_memory_view = _GetMemoryViewFromImage(image)
|
| 246 |
+
array_view = numpy.asarray(image_memory_view).view(dtype = dtype)
|
| 247 |
+
array_view.shape = shape[::-1]
|
| 248 |
+
|
| 249 |
+
return array_view
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
def GetArrayFromImage(image):
|
| 253 |
+
"""Get a NumPy ndarray from a SimpleITK Image.
|
| 254 |
+
|
| 255 |
+
This is a deep copy of the image buffer and is completely safe and without potential side effects.
|
| 256 |
+
"""
|
| 257 |
+
|
| 258 |
+
# TODO: If the image is already not unique then a second copy may be made before the numpy copy is done.
|
| 259 |
+
array_view = GetArrayViewFromImage(image)
|
| 260 |
+
|
| 261 |
+
# perform deep copy of the image buffer
|
| 262 |
+
return numpy.array(array_view, copy=True)
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
def GetImageFromArray(arr, isVector=None):
|
| 266 |
+
""" Get a SimpleITK Image from a numpy array.
|
| 267 |
+
|
| 268 |
+
If isVector is True, then the Image will have a Vector pixel type, and the last dimension of the array will be
|
| 269 |
+
considered the component index. By default when isVector is None, 4D arrays
|
| 270 |
+
are automatically considered 3D vector images, but 3D arrays are 3D images.
|
| 271 |
+
"""
|
| 272 |
+
|
| 273 |
+
if not HAVE_NUMPY:
|
| 274 |
+
raise ImportError('Numpy not available.')
|
| 275 |
+
|
| 276 |
+
z = numpy.asarray(arr)
|
| 277 |
+
|
| 278 |
+
if isVector is None:
|
| 279 |
+
if z.ndim == 4 and z.dtype != numpy.complex64 and z.dtype != numpy.complex128:
|
| 280 |
+
isVector = True
|
| 281 |
+
|
| 282 |
+
if isVector:
|
| 283 |
+
id = _get_sitk_vector_pixelid(z)
|
| 284 |
+
if z.ndim > 2:
|
| 285 |
+
number_of_components = z.shape[-1]
|
| 286 |
+
shape = z.shape[-2::-1]
|
| 287 |
+
else:
|
| 288 |
+
number_of_components = 1
|
| 289 |
+
shape = z.shape[::-1]
|
| 290 |
+
else:
|
| 291 |
+
number_of_components = 1
|
| 292 |
+
id = _get_sitk_pixelid(z)
|
| 293 |
+
shape = z.shape[::-1]
|
| 294 |
+
|
| 295 |
+
# SimpleITK throws an exception if the image dimension is not supported
|
| 296 |
+
img = Image(shape, id, number_of_components)
|
| 297 |
+
|
| 298 |
+
_SetImageFromArray(z.tobytes(), img)
|
| 299 |
+
|
| 300 |
+
return img
|
| 301 |
+
|
| 302 |
+
|
| 303 |
+
def ReadImage(fileName: Union[str, List[str]],
|
| 304 |
+
outputPixelType: "PixelIDValueEnum" = sitkUnknown,
|
| 305 |
+
imageIO: str = "") \
|
| 306 |
+
-> Image:
|
| 307 |
+
r"""ReadImage is a procedural interface to the ImageFileReader class which is convenient for most image reading
|
| 308 |
+
tasks.
|
| 309 |
+
|
| 310 |
+
This method can read a single image or a list of images into a volume.
|
| 311 |
+
|
| 312 |
+
Parameters
|
| 313 |
+
----------
|
| 314 |
+
fileName
|
| 315 |
+
A single or a list of file names. the filename of an Image e.g. "cthead.mha"
|
| 316 |
+
outputPixelType
|
| 317 |
+
The pixel type of the returned Image. By default the value is sitkUnknown, which enable the output pixel type to
|
| 318 |
+
be same as the file. If the pixel type is specified then the itk::ConvertPixelBuffer will be used to convert the
|
| 319 |
+
pixels.
|
| 320 |
+
imageIO
|
| 321 |
+
The name of the ITK ImageIO to use to read the file. An option to override the automatically detected ImageIO used
|
| 322 |
+
to read the image. The available ImageIOs are listed by the GetRegisteredImageIOs method. If the ImageIO can not
|
| 323 |
+
be constructed an exception will be generated. If the ImageIO can not read the file an exception will be
|
| 324 |
+
generated.
|
| 325 |
+
|
| 326 |
+
Returns
|
| 327 |
+
-------
|
| 328 |
+
The provided image file name(s) read into an Image.
|
| 329 |
+
|
| 330 |
+
Also See
|
| 331 |
+
--------
|
| 332 |
+
itk::simple::ImageFileReader for reading a single file.
|
| 333 |
+
itk::simple::ImageSeriesReader for reading a series and meta-data dictionaries.
|
| 334 |
+
|
| 335 |
+
"""
|
| 336 |
+
|
| 337 |
+
if isinstance(fileName, str):
|
| 338 |
+
reader = ImageFileReader()
|
| 339 |
+
reader.SetFileName(fileName)
|
| 340 |
+
else:
|
| 341 |
+
reader = ImageSeriesReader()
|
| 342 |
+
reader.SetFileNames(fileName)
|
| 343 |
+
|
| 344 |
+
reader.SetImageIO(imageIO)
|
| 345 |
+
reader.SetOutputPixelType(outputPixelType)
|
| 346 |
+
return reader.Execute()
|
| 347 |
+
|
| 348 |
+
|
| 349 |
+
def WriteImage(image: "Image",
|
| 350 |
+
fileName: Union[str, List[str]],
|
| 351 |
+
useCompression: bool = False,
|
| 352 |
+
compressionLevel=-1,
|
| 353 |
+
*,
|
| 354 |
+
imageIO: str = "",
|
| 355 |
+
compressor: str = "") -> "None":
|
| 356 |
+
r"""
|
| 357 |
+
WriteImage is a procedural interface to the ImageFileWriter and ImageSeriesWriter classes which is convenient for
|
| 358 |
+
many image writing tasks.
|
| 359 |
+
|
| 360 |
+
For an input image of N dimensions, a series of N-1 dimensional (slices) images can be written by providing a list
|
| 361 |
+
if file names equal to the number of slices in the input image.
|
| 362 |
+
|
| 363 |
+
Parameters
|
| 364 |
+
----------
|
| 365 |
+
image
|
| 366 |
+
the input image to be written
|
| 367 |
+
fileName
|
| 368 |
+
a single or a list of file names to be written
|
| 369 |
+
useCompression
|
| 370 |
+
request to compress the written file
|
| 371 |
+
compressionLevel
|
| 372 |
+
a hint for the amount of compression to be applied during writing
|
| 373 |
+
imageIO
|
| 374 |
+
the name of the ImageIO to perform the writing
|
| 375 |
+
compressor
|
| 376 |
+
a hint for the compression algorithm to use
|
| 377 |
+
|
| 378 |
+
Also See
|
| 379 |
+
--------
|
| 380 |
+
itk::simple::ImageFileWriter for writing a single file.
|
| 381 |
+
itk::simple::ImageSeriesWriter for writing a series of files
|
| 382 |
+
"""
|
| 383 |
+
if isinstance(fileName, str):
|
| 384 |
+
writer = ImageFileWriter()
|
| 385 |
+
writer.SetFileName(fileName)
|
| 386 |
+
else:
|
| 387 |
+
writer = ImageSeriesWriter()
|
| 388 |
+
writer.SetFileNames(fileName)
|
| 389 |
+
|
| 390 |
+
writer.SetUseCompression(useCompression)
|
| 391 |
+
writer.SetCompressionLevel(compressionLevel)
|
| 392 |
+
writer.SetImageIO(imageIO)
|
| 393 |
+
writer.SetCompressor(compressor)
|
| 394 |
+
return writer.Execute(image)
|
| 395 |
+
|
| 396 |
+
|
| 397 |
+
def SmoothingRecursiveGaussian(image1, sigma=[1]*3, normalizeAcrossScale=False):
|
| 398 |
+
"""Computes the smoothing of an image by convolution with
|
| 399 |
+
the Gaussian kernels implemented as IIR filters.
|
| 400 |
+
|
| 401 |
+
This function directly calls the execute method of SmoothingRecursiveGaussianImageFilter
|
| 402 |
+
in order to support a procedural API.
|
| 403 |
+
|
| 404 |
+
Also See
|
| 405 |
+
--------
|
| 406 |
+
itk::simple::SmoothingRecursiveGaussianImageFilter for the object oriented interface
|
| 407 |
+
"""
|
| 408 |
+
|
| 409 |
+
f = SmoothingRecursiveGaussianImageFilter()
|
| 410 |
+
f.SetSigma(sigma)
|
| 411 |
+
f.SetNormalizeAcrossScale(normalizeAcrossScale)
|
| 412 |
+
return f.Execute(image1)
|
| 413 |
+
|
| 414 |
+
|
| 415 |
+
def DiscreteGaussian(image1, variance=[1] * 3, maximumKernelWidth=32, maximumError=0.01, useImageSpacing=True):
|
| 416 |
+
"""Blurs an image by separable convolution with discrete
|
| 417 |
+
gaussian kernels. This filter performs Gaussian blurring by
|
| 418 |
+
separable convolution of an image and a discrete Gaussian
|
| 419 |
+
operator (kernel).
|
| 420 |
+
|
| 421 |
+
This function directly calls the execute method of DiscreteGaussianImageFilter
|
| 422 |
+
in order to support a procedural API.
|
| 423 |
+
|
| 424 |
+
Also See
|
| 425 |
+
--------
|
| 426 |
+
\sa itk::simple::DiscreteGaussianImageFilter for the object oriented interface
|
| 427 |
+
"""
|
| 428 |
+
f = DiscreteGaussianImageFilter()
|
| 429 |
+
f.SetVariance(variance)
|
| 430 |
+
f.SetMaximumKernelWidth(maximumKernelWidth)
|
| 431 |
+
f.SetMaximumError(maximumError)
|
| 432 |
+
f.SetUseImageSpacing(useImageSpacing)
|
| 433 |
+
return f.Execute(image1)
|
| 434 |
+
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
__all__ = ["Resample",
|
| 438 |
+
"GetArrayViewFromImage",
|
| 439 |
+
"GetArrayFromImage",
|
| 440 |
+
"GetImageFromArray",
|
| 441 |
+
"ReadImage",
|
| 442 |
+
"WriteImage",
|
| 443 |
+
"SmoothingRecursiveGaussian",
|
| 444 |
+
"DiscreteGaussian"]
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/async_timeout/__init__.py
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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+
import sys
|
| 4 |
+
import warnings
|
| 5 |
+
from types import TracebackType
|
| 6 |
+
from typing import Any, Optional, Type
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
if sys.version_info >= (3, 8):
|
| 10 |
+
from typing import final
|
| 11 |
+
else:
|
| 12 |
+
from typing_extensions import final
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
__version__ = "4.0.2"
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
__all__ = ("timeout", "timeout_at", "Timeout")
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def timeout(delay: Optional[float]) -> "Timeout":
|
| 22 |
+
"""timeout context manager.
|
| 23 |
+
|
| 24 |
+
Useful in cases when you want to apply timeout logic around block
|
| 25 |
+
of code or in cases when asyncio.wait_for is not suitable. For example:
|
| 26 |
+
|
| 27 |
+
>>> async with timeout(0.001):
|
| 28 |
+
... async with aiohttp.get('https://github.com') as r:
|
| 29 |
+
... await r.text()
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
delay - value in seconds or None to disable timeout logic
|
| 33 |
+
"""
|
| 34 |
+
loop = _get_running_loop()
|
| 35 |
+
if delay is not None:
|
| 36 |
+
deadline = loop.time() + delay # type: Optional[float]
|
| 37 |
+
else:
|
| 38 |
+
deadline = None
|
| 39 |
+
return Timeout(deadline, loop)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def timeout_at(deadline: Optional[float]) -> "Timeout":
|
| 43 |
+
"""Schedule the timeout at absolute time.
|
| 44 |
+
|
| 45 |
+
deadline argument points on the time in the same clock system
|
| 46 |
+
as loop.time().
|
| 47 |
+
|
| 48 |
+
Please note: it is not POSIX time but a time with
|
| 49 |
+
undefined starting base, e.g. the time of the system power on.
|
| 50 |
+
|
| 51 |
+
>>> async with timeout_at(loop.time() + 10):
|
| 52 |
+
... async with aiohttp.get('https://github.com') as r:
|
| 53 |
+
... await r.text()
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
"""
|
| 57 |
+
loop = _get_running_loop()
|
| 58 |
+
return Timeout(deadline, loop)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
class _State(enum.Enum):
|
| 62 |
+
INIT = "INIT"
|
| 63 |
+
ENTER = "ENTER"
|
| 64 |
+
TIMEOUT = "TIMEOUT"
|
| 65 |
+
EXIT = "EXIT"
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
@final
|
| 69 |
+
class Timeout:
|
| 70 |
+
# Internal class, please don't instantiate it directly
|
| 71 |
+
# Use timeout() and timeout_at() public factories instead.
|
| 72 |
+
#
|
| 73 |
+
# Implementation note: `async with timeout()` is preferred
|
| 74 |
+
# over `with timeout()`.
|
| 75 |
+
# While technically the Timeout class implementation
|
| 76 |
+
# doesn't need to be async at all,
|
| 77 |
+
# the `async with` statement explicitly points that
|
| 78 |
+
# the context manager should be used from async function context.
|
| 79 |
+
#
|
| 80 |
+
# This design allows to avoid many silly misusages.
|
| 81 |
+
#
|
| 82 |
+
# TimeoutError is raised immadiatelly when scheduled
|
| 83 |
+
# if the deadline is passed.
|
| 84 |
+
# The purpose is to time out as sson as possible
|
| 85 |
+
# without waiting for the next await expression.
|
| 86 |
+
|
| 87 |
+
__slots__ = ("_deadline", "_loop", "_state", "_timeout_handler")
|
| 88 |
+
|
| 89 |
+
def __init__(
|
| 90 |
+
self, deadline: Optional[float], loop: asyncio.AbstractEventLoop
|
| 91 |
+
) -> None:
|
| 92 |
+
self._loop = loop
|
| 93 |
+
self._state = _State.INIT
|
| 94 |
+
|
| 95 |
+
self._timeout_handler = None # type: Optional[asyncio.Handle]
|
| 96 |
+
if deadline is None:
|
| 97 |
+
self._deadline = None # type: Optional[float]
|
| 98 |
+
else:
|
| 99 |
+
self.update(deadline)
|
| 100 |
+
|
| 101 |
+
def __enter__(self) -> "Timeout":
|
| 102 |
+
warnings.warn(
|
| 103 |
+
"with timeout() is deprecated, use async with timeout() instead",
|
| 104 |
+
DeprecationWarning,
|
| 105 |
+
stacklevel=2,
|
| 106 |
+
)
|
| 107 |
+
self._do_enter()
|
| 108 |
+
return self
|
| 109 |
+
|
| 110 |
+
def __exit__(
|
| 111 |
+
self,
|
| 112 |
+
exc_type: Optional[Type[BaseException]],
|
| 113 |
+
exc_val: Optional[BaseException],
|
| 114 |
+
exc_tb: Optional[TracebackType],
|
| 115 |
+
) -> Optional[bool]:
|
| 116 |
+
self._do_exit(exc_type)
|
| 117 |
+
return None
|
| 118 |
+
|
| 119 |
+
async def __aenter__(self) -> "Timeout":
|
| 120 |
+
self._do_enter()
|
| 121 |
+
return self
|
| 122 |
+
|
| 123 |
+
async def __aexit__(
|
| 124 |
+
self,
|
| 125 |
+
exc_type: Optional[Type[BaseException]],
|
| 126 |
+
exc_val: Optional[BaseException],
|
| 127 |
+
exc_tb: Optional[TracebackType],
|
| 128 |
+
) -> Optional[bool]:
|
| 129 |
+
self._do_exit(exc_type)
|
| 130 |
+
return None
|
| 131 |
+
|
| 132 |
+
@property
|
| 133 |
+
def expired(self) -> bool:
|
| 134 |
+
"""Is timeout expired during execution?"""
|
| 135 |
+
return self._state == _State.TIMEOUT
|
| 136 |
+
|
| 137 |
+
@property
|
| 138 |
+
def deadline(self) -> Optional[float]:
|
| 139 |
+
return self._deadline
|
| 140 |
+
|
| 141 |
+
def reject(self) -> None:
|
| 142 |
+
"""Reject scheduled timeout if any."""
|
| 143 |
+
# cancel is maybe better name but
|
| 144 |
+
# task.cancel() raises CancelledError in asyncio world.
|
| 145 |
+
if self._state not in (_State.INIT, _State.ENTER):
|
| 146 |
+
raise RuntimeError(f"invalid state {self._state.value}")
|
| 147 |
+
self._reject()
|
| 148 |
+
|
| 149 |
+
def _reject(self) -> None:
|
| 150 |
+
if self._timeout_handler is not None:
|
| 151 |
+
self._timeout_handler.cancel()
|
| 152 |
+
self._timeout_handler = None
|
| 153 |
+
|
| 154 |
+
def shift(self, delay: float) -> None:
|
| 155 |
+
"""Advance timeout on delay seconds.
|
| 156 |
+
|
| 157 |
+
The delay can be negative.
|
| 158 |
+
|
| 159 |
+
Raise RuntimeError if shift is called when deadline is not scheduled
|
| 160 |
+
"""
|
| 161 |
+
deadline = self._deadline
|
| 162 |
+
if deadline is None:
|
| 163 |
+
raise RuntimeError("cannot shift timeout if deadline is not scheduled")
|
| 164 |
+
self.update(deadline + delay)
|
| 165 |
+
|
| 166 |
+
def update(self, deadline: float) -> None:
|
| 167 |
+
"""Set deadline to absolute value.
|
| 168 |
+
|
| 169 |
+
deadline argument points on the time in the same clock system
|
| 170 |
+
as loop.time().
|
| 171 |
+
|
| 172 |
+
If new deadline is in the past the timeout is raised immediatelly.
|
| 173 |
+
|
| 174 |
+
Please note: it is not POSIX time but a time with
|
| 175 |
+
undefined starting base, e.g. the time of the system power on.
|
| 176 |
+
"""
|
| 177 |
+
if self._state == _State.EXIT:
|
| 178 |
+
raise RuntimeError("cannot reschedule after exit from context manager")
|
| 179 |
+
if self._state == _State.TIMEOUT:
|
| 180 |
+
raise RuntimeError("cannot reschedule expired timeout")
|
| 181 |
+
if self._timeout_handler is not None:
|
| 182 |
+
self._timeout_handler.cancel()
|
| 183 |
+
self._deadline = deadline
|
| 184 |
+
if self._state != _State.INIT:
|
| 185 |
+
self._reschedule()
|
| 186 |
+
|
| 187 |
+
def _reschedule(self) -> None:
|
| 188 |
+
assert self._state == _State.ENTER
|
| 189 |
+
deadline = self._deadline
|
| 190 |
+
if deadline is None:
|
| 191 |
+
return
|
| 192 |
+
|
| 193 |
+
now = self._loop.time()
|
| 194 |
+
if self._timeout_handler is not None:
|
| 195 |
+
self._timeout_handler.cancel()
|
| 196 |
+
|
| 197 |
+
task = _current_task(self._loop)
|
| 198 |
+
if deadline <= now:
|
| 199 |
+
self._timeout_handler = self._loop.call_soon(self._on_timeout, task)
|
| 200 |
+
else:
|
| 201 |
+
self._timeout_handler = self._loop.call_at(deadline, self._on_timeout, task)
|
| 202 |
+
|
| 203 |
+
def _do_enter(self) -> None:
|
| 204 |
+
if self._state != _State.INIT:
|
| 205 |
+
raise RuntimeError(f"invalid state {self._state.value}")
|
| 206 |
+
self._state = _State.ENTER
|
| 207 |
+
self._reschedule()
|
| 208 |
+
|
| 209 |
+
def _do_exit(self, exc_type: Optional[Type[BaseException]]) -> None:
|
| 210 |
+
if exc_type is asyncio.CancelledError and self._state == _State.TIMEOUT:
|
| 211 |
+
self._timeout_handler = None
|
| 212 |
+
raise asyncio.TimeoutError
|
| 213 |
+
# timeout has not expired
|
| 214 |
+
self._state = _State.EXIT
|
| 215 |
+
self._reject()
|
| 216 |
+
return None
|
| 217 |
+
|
| 218 |
+
def _on_timeout(self, task: "asyncio.Task[None]") -> None:
|
| 219 |
+
task.cancel()
|
| 220 |
+
self._state = _State.TIMEOUT
|
| 221 |
+
# drop the reference early
|
| 222 |
+
self._timeout_handler = None
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
if sys.version_info >= (3, 7):
|
| 226 |
+
|
| 227 |
+
def _current_task(loop: asyncio.AbstractEventLoop) -> "Optional[asyncio.Task[Any]]":
|
| 228 |
+
return asyncio.current_task(loop=loop)
|
| 229 |
+
|
| 230 |
+
else:
|
| 231 |
+
|
| 232 |
+
def _current_task(loop: asyncio.AbstractEventLoop) -> "Optional[asyncio.Task[Any]]":
|
| 233 |
+
return asyncio.Task.current_task(loop=loop)
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
if sys.version_info >= (3, 7):
|
| 237 |
+
|
| 238 |
+
def _get_running_loop() -> asyncio.AbstractEventLoop:
|
| 239 |
+
return asyncio.get_running_loop()
|
| 240 |
+
|
| 241 |
+
else:
|
| 242 |
+
|
| 243 |
+
def _get_running_loop() -> asyncio.AbstractEventLoop:
|
| 244 |
+
loop = asyncio.get_event_loop()
|
| 245 |
+
if not loop.is_running():
|
| 246 |
+
raise RuntimeError("no running event loop")
|
| 247 |
+
return loop
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/async_timeout/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Placeholder
|
my_container_sandbox/workspace/anaconda3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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU LESSER GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 2.1, February 1999
|
| 3 |
+
|
| 4 |
+
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
| 5 |
+
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| 6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 7 |
+
of this license document, but changing it is not allowed.
|
| 8 |
+
|
| 9 |
+
[This is the first released version of the Lesser GPL. It also counts
|
| 10 |
+
as the successor of the GNU Library Public License, version 2, hence
|
| 11 |
+
the version number 2.1.]
|
| 12 |
+
|
| 13 |
+
Preamble
|
| 14 |
+
|
| 15 |
+
The licenses for most software are designed to take away your
|
| 16 |
+
freedom to share and change it. By contrast, the GNU General Public
|
| 17 |
+
Licenses are intended to guarantee your freedom to share and change
|
| 18 |
+
free software--to make sure the software is free for all its users.
|
| 19 |
+
|
| 20 |
+
This license, the Lesser General Public License, applies to some
|
| 21 |
+
specially designated software packages--typically libraries--of the
|
| 22 |
+
Free Software Foundation and other authors who decide to use it. You
|
| 23 |
+
can use it too, but we suggest you first think carefully about whether
|
| 24 |
+
this license or the ordinary General Public License is the better
|
| 25 |
+
strategy to use in any particular case, based on the explanations below.
|
| 26 |
+
|
| 27 |
+
When we speak of free software, we are referring to freedom of use,
|
| 28 |
+
not price. Our General Public Licenses are designed to make sure that
|
| 29 |
+
you have the freedom to distribute copies of free software (and charge
|
| 30 |
+
for this service if you wish); that you receive source code or can get
|
| 31 |
+
it if you want it; that you can change the software and use pieces of
|
| 32 |
+
it in new free programs; and that you are informed that you can do
|
| 33 |
+
these things.
|
| 34 |
+
|
| 35 |
+
To protect your rights, we need to make restrictions that forbid
|
| 36 |
+
distributors to deny you these rights or to ask you to surrender these
|
| 37 |
+
rights. These restrictions translate to certain responsibilities for
|
| 38 |
+
you if you distribute copies of the library or if you modify it.
|
| 39 |
+
|
| 40 |
+
For example, if you distribute copies of the library, whether gratis
|
| 41 |
+
or for a fee, you must give the recipients all the rights that we gave
|
| 42 |
+
you. You must make sure that they, too, receive or can get the source
|
| 43 |
+
code. If you link other code with the library, you must provide
|
| 44 |
+
complete object files to the recipients, so that they can relink them
|
| 45 |
+
with the library after making changes to the library and recompiling
|
| 46 |
+
it. And you must show them these terms so they know their rights.
|
| 47 |
+
|
| 48 |
+
We protect your rights with a two-step method: (1) we copyright the
|
| 49 |
+
library, and (2) we offer you this license, which gives you legal
|
| 50 |
+
permission to copy, distribute and/or modify the library.
|
| 51 |
+
|
| 52 |
+
To protect each distributor, we want to make it very clear that
|
| 53 |
+
there is no warranty for the free library. Also, if the library is
|
| 54 |
+
modified by someone else and passed on, the recipients should know
|
| 55 |
+
that what they have is not the original version, so that the original
|
| 56 |
+
author's reputation will not be affected by problems that might be
|
| 57 |
+
introduced by others.
|
| 58 |
+
|
| 59 |
+
Finally, software patents pose a constant threat to the existence of
|
| 60 |
+
any free program. We wish to make sure that a company cannot
|
| 61 |
+
effectively restrict the users of a free program by obtaining a
|
| 62 |
+
restrictive license from a patent holder. Therefore, we insist that
|
| 63 |
+
any patent license obtained for a version of the library must be
|
| 64 |
+
consistent with the full freedom of use specified in this license.
|
| 65 |
+
|
| 66 |
+
Most GNU software, including some libraries, is covered by the
|
| 67 |
+
ordinary GNU General Public License. This license, the GNU Lesser
|
| 68 |
+
General Public License, applies to certain designated libraries, and
|
| 69 |
+
is quite different from the ordinary General Public License. We use
|
| 70 |
+
this license for certain libraries in order to permit linking those
|
| 71 |
+
libraries into non-free programs.
|
| 72 |
+
|
| 73 |
+
When a program is linked with a library, whether statically or using
|
| 74 |
+
a shared library, the combination of the two is legally speaking a
|
| 75 |
+
combined work, a derivative of the original library. The ordinary
|
| 76 |
+
General Public License therefore permits such linking only if the
|
| 77 |
+
entire combination fits its criteria of freedom. The Lesser General
|
| 78 |
+
Public License permits more lax criteria for linking other code with
|
| 79 |
+
the library.
|
| 80 |
+
|
| 81 |
+
We call this license the "Lesser" General Public License because it
|
| 82 |
+
does Less to protect the user's freedom than the ordinary General
|
| 83 |
+
Public License. It also provides other free software developers Less
|
| 84 |
+
of an advantage over competing non-free programs. These disadvantages
|
| 85 |
+
are the reason we use the ordinary General Public License for many
|
| 86 |
+
libraries. However, the Lesser license provides advantages in certain
|
| 87 |
+
special circumstances.
|
| 88 |
+
|
| 89 |
+
For example, on rare occasions, there may be a special need to
|
| 90 |
+
encourage the widest possible use of a certain library, so that it becomes
|
| 91 |
+
a de-facto standard. To achieve this, non-free programs must be
|
| 92 |
+
allowed to use the library. A more frequent case is that a free
|
| 93 |
+
library does the same job as widely used non-free libraries. In this
|
| 94 |
+
case, there is little to gain by limiting the free library to free
|
| 95 |
+
software only, so we use the Lesser General Public License.
|
| 96 |
+
|
| 97 |
+
In other cases, permission to use a particular library in non-free
|
| 98 |
+
programs enables a greater number of people to use a large body of
|
| 99 |
+
free software. For example, permission to use the GNU C Library in
|
| 100 |
+
non-free programs enables many more people to use the whole GNU
|
| 101 |
+
operating system, as well as its variant, the GNU/Linux operating
|
| 102 |
+
system.
|
| 103 |
+
|
| 104 |
+
Although the Lesser General Public License is Less protective of the
|
| 105 |
+
users' freedom, it does ensure that the user of a program that is
|
| 106 |
+
linked with the Library has the freedom and the wherewithal to run
|
| 107 |
+
that program using a modified version of the Library.
|
| 108 |
+
|
| 109 |
+
The precise terms and conditions for copying, distribution and
|
| 110 |
+
modification follow. Pay close attention to the difference between a
|
| 111 |
+
"work based on the library" and a "work that uses the library". The
|
| 112 |
+
former contains code derived from the library, whereas the latter must
|
| 113 |
+
be combined with the library in order to run.
|
| 114 |
+
|
| 115 |
+
GNU LESSER GENERAL PUBLIC LICENSE
|
| 116 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
| 117 |
+
|
| 118 |
+
0. This License Agreement applies to any software library or other
|
| 119 |
+
program which contains a notice placed by the copyright holder or
|
| 120 |
+
other authorized party saying it may be distributed under the terms of
|
| 121 |
+
this Lesser General Public License (also called "this License").
|
| 122 |
+
Each licensee is addressed as "you".
|
| 123 |
+
|
| 124 |
+
A "library" means a collection of software functions and/or data
|
| 125 |
+
prepared so as to be conveniently linked with application programs
|
| 126 |
+
(which use some of those functions and data) to form executables.
|
| 127 |
+
|
| 128 |
+
The "Library", below, refers to any such software library or work
|
| 129 |
+
which has been distributed under these terms. A "work based on the
|
| 130 |
+
Library" means either the Library or any derivative work under
|
| 131 |
+
copyright law: that is to say, a work containing the Library or a
|
| 132 |
+
portion of it, either verbatim or with modifications and/or translated
|
| 133 |
+
straightforwardly into another language. (Hereinafter, translation is
|
| 134 |
+
included without limitation in the term "modification".)
|
| 135 |
+
|
| 136 |
+
"Source code" for a work means the preferred form of the work for
|
| 137 |
+
making modifications to it. For a library, complete source code means
|
| 138 |
+
all the source code for all modules it contains, plus any associated
|
| 139 |
+
interface definition files, plus the scripts used to control compilation
|
| 140 |
+
and installation of the library.
|
| 141 |
+
|
| 142 |
+
Activities other than copying, distribution and modification are not
|
| 143 |
+
covered by this License; they are outside its scope. The act of
|
| 144 |
+
running a program using the Library is not restricted, and output from
|
| 145 |
+
such a program is covered only if its contents constitute a work based
|
| 146 |
+
on the Library (independent of the use of the Library in a tool for
|
| 147 |
+
writing it). Whether that is true depends on what the Library does
|
| 148 |
+
and what the program that uses the Library does.
|
| 149 |
+
|
| 150 |
+
1. You may copy and distribute verbatim copies of the Library's
|
| 151 |
+
complete source code as you receive it, in any medium, provided that
|
| 152 |
+
you conspicuously and appropriately publish on each copy an
|
| 153 |
+
appropriate copyright notice and disclaimer of warranty; keep intact
|
| 154 |
+
all the notices that refer to this License and to the absence of any
|
| 155 |
+
warranty; and distribute a copy of this License along with the
|
| 156 |
+
Library.
|
| 157 |
+
|
| 158 |
+
You may charge a fee for the physical act of transferring a copy,
|
| 159 |
+
and you may at your option offer warranty protection in exchange for a
|
| 160 |
+
fee.
|
| 161 |
+
|
| 162 |
+
2. You may modify your copy or copies of the Library or any portion
|
| 163 |
+
of it, thus forming a work based on the Library, and copy and
|
| 164 |
+
distribute such modifications or work under the terms of Section 1
|
| 165 |
+
above, provided that you also meet all of these conditions:
|
| 166 |
+
|
| 167 |
+
a) The modified work must itself be a software library.
|
| 168 |
+
|
| 169 |
+
b) You must cause the files modified to carry prominent notices
|
| 170 |
+
stating that you changed the files and the date of any change.
|
| 171 |
+
|
| 172 |
+
c) You must cause the whole of the work to be licensed at no
|
| 173 |
+
charge to all third parties under the terms of this License.
|
| 174 |
+
|
| 175 |
+
d) If a facility in the modified Library refers to a function or a
|
| 176 |
+
table of data to be supplied by an application program that uses
|
| 177 |
+
the facility, other than as an argument passed when the facility
|
| 178 |
+
is invoked, then you must make a good faith effort to ensure that,
|
| 179 |
+
in the event an application does not supply such function or
|
| 180 |
+
table, the facility still operates, and performs whatever part of
|
| 181 |
+
its purpose remains meaningful.
|
| 182 |
+
|
| 183 |
+
(For example, a function in a library to compute square roots has
|
| 184 |
+
a purpose that is entirely well-defined independent of the
|
| 185 |
+
application. Therefore, Subsection 2d requires that any
|
| 186 |
+
application-supplied function or table used by this function must
|
| 187 |
+
be optional: if the application does not supply it, the square
|
| 188 |
+
root function must still compute square roots.)
|
| 189 |
+
|
| 190 |
+
These requirements apply to the modified work as a whole. If
|
| 191 |
+
identifiable sections of that work are not derived from the Library,
|
| 192 |
+
and can be reasonably considered independent and separate works in
|
| 193 |
+
themselves, then this License, and its terms, do not apply to those
|
| 194 |
+
sections when you distribute them as separate works. But when you
|
| 195 |
+
distribute the same sections as part of a whole which is a work based
|
| 196 |
+
on the Library, the distribution of the whole must be on the terms of
|
| 197 |
+
this License, whose permissions for other licensees extend to the
|
| 198 |
+
entire whole, and thus to each and every part regardless of who wrote
|
| 199 |
+
it.
|
| 200 |
+
|
| 201 |
+
Thus, it is not the intent of this section to claim rights or contest
|
| 202 |
+
your rights to work written entirely by you; rather, the intent is to
|
| 203 |
+
exercise the right to control the distribution of derivative or
|
| 204 |
+
collective works based on the Library.
|
| 205 |
+
|
| 206 |
+
In addition, mere aggregation of another work not based on the Library
|
| 207 |
+
with the Library (or with a work based on the Library) on a volume of
|
| 208 |
+
a storage or distribution medium does not bring the other work under
|
| 209 |
+
the scope of this License.
|
| 210 |
+
|
| 211 |
+
3. You may opt to apply the terms of the ordinary GNU General Public
|
| 212 |
+
License instead of this License to a given copy of the Library. To do
|
| 213 |
+
this, you must alter all the notices that refer to this License, so
|
| 214 |
+
that they refer to the ordinary GNU General Public License, version 2,
|
| 215 |
+
instead of to this License. (If a newer version than version 2 of the
|
| 216 |
+
ordinary GNU General Public License has appeared, then you can specify
|
| 217 |
+
that version instead if you wish.) Do not make any other change in
|
| 218 |
+
these notices.
|
| 219 |
+
|
| 220 |
+
Once this change is made in a given copy, it is irreversible for
|
| 221 |
+
that copy, so the ordinary GNU General Public License applies to all
|
| 222 |
+
subsequent copies and derivative works made from that copy.
|
| 223 |
+
|
| 224 |
+
This option is useful when you wish to copy part of the code of
|
| 225 |
+
the Library into a program that is not a library.
|
| 226 |
+
|
| 227 |
+
4. You may copy and distribute the Library (or a portion or
|
| 228 |
+
derivative of it, under Section 2) in object code or executable form
|
| 229 |
+
under the terms of Sections 1 and 2 above provided that you accompany
|
| 230 |
+
it with the complete corresponding machine-readable source code, which
|
| 231 |
+
must be distributed under the terms of Sections 1 and 2 above on a
|
| 232 |
+
medium customarily used for software interchange.
|
| 233 |
+
|
| 234 |
+
If distribution of object code is made by offering access to copy
|
| 235 |
+
from a designated place, then offering equivalent access to copy the
|
| 236 |
+
source code from the same place satisfies the requirement to
|
| 237 |
+
distribute the source code, even though third parties are not
|
| 238 |
+
compelled to copy the source along with the object code.
|
| 239 |
+
|
| 240 |
+
5. A program that contains no derivative of any portion of the
|
| 241 |
+
Library, but is designed to work with the Library by being compiled or
|
| 242 |
+
linked with it, is called a "work that uses the Library". Such a
|
| 243 |
+
work, in isolation, is not a derivative work of the Library, and
|
| 244 |
+
therefore falls outside the scope of this License.
|
| 245 |
+
|
| 246 |
+
However, linking a "work that uses the Library" with the Library
|
| 247 |
+
creates an executable that is a derivative of the Library (because it
|
| 248 |
+
contains portions of the Library), rather than a "work that uses the
|
| 249 |
+
library". The executable is therefore covered by this License.
|
| 250 |
+
Section 6 states terms for distribution of such executables.
|
| 251 |
+
|
| 252 |
+
When a "work that uses the Library" uses material from a header file
|
| 253 |
+
that is part of the Library, the object code for the work may be a
|
| 254 |
+
derivative work of the Library even though the source code is not.
|
| 255 |
+
Whether this is true is especially significant if the work can be
|
| 256 |
+
linked without the Library, or if the work is itself a library. The
|
| 257 |
+
threshold for this to be true is not precisely defined by law.
|
| 258 |
+
|
| 259 |
+
If such an object file uses only numerical parameters, data
|
| 260 |
+
structure layouts and accessors, and small macros and small inline
|
| 261 |
+
functions (ten lines or less in length), then the use of the object
|
| 262 |
+
file is unrestricted, regardless of whether it is legally a derivative
|
| 263 |
+
work. (Executables containing this object code plus portions of the
|
| 264 |
+
Library will still fall under Section 6.)
|
| 265 |
+
|
| 266 |
+
Otherwise, if the work is a derivative of the Library, you may
|
| 267 |
+
distribute the object code for the work under the terms of Section 6.
|
| 268 |
+
Any executables containing that work also fall under Section 6,
|
| 269 |
+
whether or not they are linked directly with the Library itself.
|
| 270 |
+
|
| 271 |
+
6. As an exception to the Sections above, you may also combine or
|
| 272 |
+
link a "work that uses the Library" with the Library to produce a
|
| 273 |
+
work containing portions of the Library, and distribute that work
|
| 274 |
+
under terms of your choice, provided that the terms permit
|
| 275 |
+
modification of the work for the customer's own use and reverse
|
| 276 |
+
engineering for debugging such modifications.
|
| 277 |
+
|
| 278 |
+
You must give prominent notice with each copy of the work that the
|
| 279 |
+
Library is used in it and that the Library and its use are covered by
|
| 280 |
+
this License. You must supply a copy of this License. If the work
|
| 281 |
+
during execution displays copyright notices, you must include the
|
| 282 |
+
copyright notice for the Library among them, as well as a reference
|
| 283 |
+
directing the user to the copy of this License. Also, you must do one
|
| 284 |
+
of these things:
|
| 285 |
+
|
| 286 |
+
a) Accompany the work with the complete corresponding
|
| 287 |
+
machine-readable source code for the Library including whatever
|
| 288 |
+
changes were used in the work (which must be distributed under
|
| 289 |
+
Sections 1 and 2 above); and, if the work is an executable linked
|
| 290 |
+
with the Library, with the complete machine-readable "work that
|
| 291 |
+
uses the Library", as object code and/or source code, so that the
|
| 292 |
+
user can modify the Library and then relink to produce a modified
|
| 293 |
+
executable containing the modified Library. (It is understood
|
| 294 |
+
that the user who changes the contents of definitions files in the
|
| 295 |
+
Library will not necessarily be able to recompile the application
|
| 296 |
+
to use the modified definitions.)
|
| 297 |
+
|
| 298 |
+
b) Use a suitable shared library mechanism for linking with the
|
| 299 |
+
Library. A suitable mechanism is one that (1) uses at run time a
|
| 300 |
+
copy of the library already present on the user's computer system,
|
| 301 |
+
rather than copying library functions into the executable, and (2)
|
| 302 |
+
will operate properly with a modified version of the library, if
|
| 303 |
+
the user installs one, as long as the modified version is
|
| 304 |
+
interface-compatible with the version that the work was made with.
|
| 305 |
+
|
| 306 |
+
c) Accompany the work with a written offer, valid for at
|
| 307 |
+
least three years, to give the same user the materials
|
| 308 |
+
specified in Subsection 6a, above, for a charge no more
|
| 309 |
+
than the cost of performing this distribution.
|
| 310 |
+
|
| 311 |
+
d) If distribution of the work is made by offering access to copy
|
| 312 |
+
from a designated place, offer equivalent access to copy the above
|
| 313 |
+
specified materials from the same place.
|
| 314 |
+
|
| 315 |
+
e) Verify that the user has already received a copy of these
|
| 316 |
+
materials or that you have already sent this user a copy.
|
| 317 |
+
|
| 318 |
+
For an executable, the required form of the "work that uses the
|
| 319 |
+
Library" must include any data and utility programs needed for
|
| 320 |
+
reproducing the executable from it. However, as a special exception,
|
| 321 |
+
the materials to be distributed need not include anything that is
|
| 322 |
+
normally distributed (in either source or binary form) with the major
|
| 323 |
+
components (compiler, kernel, and so on) of the operating system on
|
| 324 |
+
which the executable runs, unless that component itself accompanies
|
| 325 |
+
the executable.
|
| 326 |
+
|
| 327 |
+
It may happen that this requirement contradicts the license
|
| 328 |
+
restrictions of other proprietary libraries that do not normally
|
| 329 |
+
accompany the operating system. Such a contradiction means you cannot
|
| 330 |
+
use both them and the Library together in an executable that you
|
| 331 |
+
distribute.
|
| 332 |
+
|
| 333 |
+
7. You may place library facilities that are a work based on the
|
| 334 |
+
Library side-by-side in a single library together with other library
|
| 335 |
+
facilities not covered by this License, and distribute such a combined
|
| 336 |
+
library, provided that the separate distribution of the work based on
|
| 337 |
+
the Library and of the other library facilities is otherwise
|
| 338 |
+
permitted, and provided that you do these two things:
|
| 339 |
+
|
| 340 |
+
a) Accompany the combined library with a copy of the same work
|
| 341 |
+
based on the Library, uncombined with any other library
|
| 342 |
+
facilities. This must be distributed under the terms of the
|
| 343 |
+
Sections above.
|
| 344 |
+
|
| 345 |
+
b) Give prominent notice with the combined library of the fact
|
| 346 |
+
that part of it is a work based on the Library, and explaining
|
| 347 |
+
where to find the accompanying uncombined form of the same work.
|
| 348 |
+
|
| 349 |
+
8. You may not copy, modify, sublicense, link with, or distribute
|
| 350 |
+
the Library except as expressly provided under this License. Any
|
| 351 |
+
attempt otherwise to copy, modify, sublicense, link with, or
|
| 352 |
+
distribute the Library is void, and will automatically terminate your
|
| 353 |
+
rights under this License. However, parties who have received copies,
|
| 354 |
+
or rights, from you under this License will not have their licenses
|
| 355 |
+
terminated so long as such parties remain in full compliance.
|
| 356 |
+
|
| 357 |
+
9. You are not required to accept this License, since you have not
|
| 358 |
+
signed it. However, nothing else grants you permission to modify or
|
| 359 |
+
distribute the Library or its derivative works. These actions are
|
| 360 |
+
prohibited by law if you do not accept this License. Therefore, by
|
| 361 |
+
modifying or distributing the Library (or any work based on the
|
| 362 |
+
Library), you indicate your acceptance of this License to do so, and
|
| 363 |
+
all its terms and conditions for copying, distributing or modifying
|
| 364 |
+
the Library or works based on it.
|
| 365 |
+
|
| 366 |
+
10. Each time you redistribute the Library (or any work based on the
|
| 367 |
+
Library), the recipient automatically receives a license from the
|
| 368 |
+
original licensor to copy, distribute, link with or modify the Library
|
| 369 |
+
subject to these terms and conditions. You may not impose any further
|
| 370 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
| 371 |
+
You are not responsible for enforcing compliance by third parties with
|
| 372 |
+
this License.
|
| 373 |
+
|
| 374 |
+
11. If, as a consequence of a court judgment or allegation of patent
|
| 375 |
+
infringement or for any other reason (not limited to patent issues),
|
| 376 |
+
conditions are imposed on you (whether by court order, agreement or
|
| 377 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 378 |
+
excuse you from the conditions of this License. If you cannot
|
| 379 |
+
distribute so as to satisfy simultaneously your obligations under this
|
| 380 |
+
License and any other pertinent obligations, then as a consequence you
|
| 381 |
+
may not distribute the Library at all. For example, if a patent
|
| 382 |
+
license would not permit royalty-free redistribution of the Library by
|
| 383 |
+
all those who receive copies directly or indirectly through you, then
|
| 384 |
+
the only way you could satisfy both it and this License would be to
|
| 385 |
+
refrain entirely from distribution of the Library.
|
| 386 |
+
|
| 387 |
+
If any portion of this section is held invalid or unenforceable under any
|
| 388 |
+
particular circumstance, the balance of the section is intended to apply,
|
| 389 |
+
and the section as a whole is intended to apply in other circumstances.
|
| 390 |
+
|
| 391 |
+
It is not the purpose of this section to induce you to infringe any
|
| 392 |
+
patents or other property right claims or to contest validity of any
|
| 393 |
+
such claims; this section has the sole purpose of protecting the
|
| 394 |
+
integrity of the free software distribution system which is
|
| 395 |
+
implemented by public license practices. Many people have made
|
| 396 |
+
generous contributions to the wide range of software distributed
|
| 397 |
+
through that system in reliance on consistent application of that
|
| 398 |
+
system; it is up to the author/donor to decide if he or she is willing
|
| 399 |
+
to distribute software through any other system and a licensee cannot
|
| 400 |
+
impose that choice.
|
| 401 |
+
|
| 402 |
+
This section is intended to make thoroughly clear what is believed to
|
| 403 |
+
be a consequence of the rest of this License.
|
| 404 |
+
|
| 405 |
+
12. If the distribution and/or use of the Library is restricted in
|
| 406 |
+
certain countries either by patents or by copyrighted interfaces, the
|
| 407 |
+
original copyright holder who places the Library under this License may add
|
| 408 |
+
an explicit geographical distribution limitation excluding those countries,
|
| 409 |
+
so that distribution is permitted only in or among countries not thus
|
| 410 |
+
excluded. In such case, this License incorporates the limitation as if
|
| 411 |
+
written in the body of this License.
|
| 412 |
+
|
| 413 |
+
13. The Free Software Foundation may publish revised and/or new
|
| 414 |
+
versions of the Lesser General Public License from time to time.
|
| 415 |
+
Such new versions will be similar in spirit to the present version,
|
| 416 |
+
but may differ in detail to address new problems or concerns.
|
| 417 |
+
|
| 418 |
+
Each version is given a distinguishing version number. If the Library
|
| 419 |
+
specifies a version number of this License which applies to it and
|
| 420 |
+
"any later version", you have the option of following the terms and
|
| 421 |
+
conditions either of that version or of any later version published by
|
| 422 |
+
the Free Software Foundation. If the Library does not specify a
|
| 423 |
+
license version number, you may choose any version ever published by
|
| 424 |
+
the Free Software Foundation.
|
| 425 |
+
|
| 426 |
+
14. If you wish to incorporate parts of the Library into other free
|
| 427 |
+
programs whose distribution conditions are incompatible with these,
|
| 428 |
+
write to the author to ask for permission. For software which is
|
| 429 |
+
copyrighted by the Free Software Foundation, write to the Free
|
| 430 |
+
Software Foundation; we sometimes make exceptions for this. Our
|
| 431 |
+
decision will be guided by the two goals of preserving the free status
|
| 432 |
+
of all derivatives of our free software and of promoting the sharing
|
| 433 |
+
and reuse of software generally.
|
| 434 |
+
|
| 435 |
+
NO WARRANTY
|
| 436 |
+
|
| 437 |
+
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
| 438 |
+
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
| 439 |
+
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
| 440 |
+
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
| 441 |
+
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
| 442 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 443 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
| 444 |
+
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
| 445 |
+
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 446 |
+
|
| 447 |
+
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
| 448 |
+
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
| 449 |
+
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
| 450 |
+
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
| 451 |
+
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
| 452 |
+
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
| 453 |
+
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
| 454 |
+
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
| 455 |
+
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
| 456 |
+
DAMAGES.
|
| 457 |
+
|
| 458 |
+
END OF TERMS AND CONDITIONS
|
| 459 |
+
|
| 460 |
+
How to Apply These Terms to Your New Libraries
|
| 461 |
+
|
| 462 |
+
If you develop a new library, and you want it to be of the greatest
|
| 463 |
+
possible use to the public, we recommend making it free software that
|
| 464 |
+
everyone can redistribute and change. You can do so by permitting
|
| 465 |
+
redistribution under these terms (or, alternatively, under the terms of the
|
| 466 |
+
ordinary General Public License).
|
| 467 |
+
|
| 468 |
+
To apply these terms, attach the following notices to the library. It is
|
| 469 |
+
safest to attach them to the start of each source file to most effectively
|
| 470 |
+
convey the exclusion of warranty; and each file should have at least the
|
| 471 |
+
"copyright" line and a pointer to where the full notice is found.
|
| 472 |
+
|
| 473 |
+
<one line to give the library's name and a brief idea of what it does.>
|
| 474 |
+
Copyright (C) <year> <name of author>
|
| 475 |
+
|
| 476 |
+
This library is free software; you can redistribute it and/or
|
| 477 |
+
modify it under the terms of the GNU Lesser General Public
|
| 478 |
+
License as published by the Free Software Foundation; either
|
| 479 |
+
version 2.1 of the License, or (at your option) any later version.
|
| 480 |
+
|
| 481 |
+
This library is distributed in the hope that it will be useful,
|
| 482 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 483 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 484 |
+
Lesser General Public License for more details.
|
| 485 |
+
|
| 486 |
+
You should have received a copy of the GNU Lesser General Public
|
| 487 |
+
License along with this library; if not, write to the Free Software
|
| 488 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| 489 |
+
|
| 490 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 491 |
+
|
| 492 |
+
You should also get your employer (if you work as a programmer) or your
|
| 493 |
+
school, if any, to sign a "copyright disclaimer" for the library, if
|
| 494 |
+
necessary. Here is a sample; alter the names:
|
| 495 |
+
|
| 496 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
| 497 |
+
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
| 498 |
+
|
| 499 |
+
<signature of Ty Coon>, 1 April 1990
|
| 500 |
+
Ty Coon, President of Vice
|
| 501 |
+
|
| 502 |
+
That's all there is to it!
|
| 503 |
+
|
| 504 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/METADATA
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: chardet
|
| 3 |
+
Version: 3.0.4
|
| 4 |
+
Summary: Universal encoding detector for Python 2 and 3
|
| 5 |
+
Home-page: https://github.com/chardet/chardet
|
| 6 |
+
Author: Mark Pilgrim
|
| 7 |
+
Author-email: mark@diveintomark.org
|
| 8 |
+
Maintainer: Daniel Blanchard
|
| 9 |
+
Maintainer-email: dan.blanchard@gmail.com
|
| 10 |
+
License: LGPL
|
| 11 |
+
Keywords: encoding,i18n,xml
|
| 12 |
+
Platform: UNKNOWN
|
| 13 |
+
Classifier: Development Status :: 4 - Beta
|
| 14 |
+
Classifier: Intended Audience :: Developers
|
| 15 |
+
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
|
| 16 |
+
Classifier: Operating System :: OS Independent
|
| 17 |
+
Classifier: Programming Language :: Python
|
| 18 |
+
Classifier: Programming Language :: Python :: 2
|
| 19 |
+
Classifier: Programming Language :: Python :: 2.6
|
| 20 |
+
Classifier: Programming Language :: Python :: 2.7
|
| 21 |
+
Classifier: Programming Language :: Python :: 3
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.3
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.4
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.5
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.6
|
| 26 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 27 |
+
Classifier: Topic :: Text Processing :: Linguistic
|
| 28 |
+
|
| 29 |
+
Chardet: The Universal Character Encoding Detector
|
| 30 |
+
--------------------------------------------------
|
| 31 |
+
|
| 32 |
+
.. image:: https://img.shields.io/travis/chardet/chardet/stable.svg
|
| 33 |
+
:alt: Build status
|
| 34 |
+
:target: https://travis-ci.org/chardet/chardet
|
| 35 |
+
|
| 36 |
+
.. image:: https://img.shields.io/coveralls/chardet/chardet/stable.svg
|
| 37 |
+
:target: https://coveralls.io/r/chardet/chardet
|
| 38 |
+
|
| 39 |
+
.. image:: https://img.shields.io/pypi/v/chardet.svg
|
| 40 |
+
:target: https://warehouse.python.org/project/chardet/
|
| 41 |
+
:alt: Latest version on PyPI
|
| 42 |
+
|
| 43 |
+
.. image:: https://img.shields.io/pypi/l/chardet.svg
|
| 44 |
+
:alt: License
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
Detects
|
| 48 |
+
- ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
|
| 49 |
+
- Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified Chinese)
|
| 50 |
+
- EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP (Japanese)
|
| 51 |
+
- EUC-KR, ISO-2022-KR (Korean)
|
| 52 |
+
- KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
|
| 53 |
+
- ISO-8859-5, windows-1251 (Bulgarian)
|
| 54 |
+
- ISO-8859-1, windows-1252 (Western European languages)
|
| 55 |
+
- ISO-8859-7, windows-1253 (Greek)
|
| 56 |
+
- ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
|
| 57 |
+
- TIS-620 (Thai)
|
| 58 |
+
|
| 59 |
+
.. note::
|
| 60 |
+
Our ISO-8859-2 and windows-1250 (Hungarian) probers have been temporarily
|
| 61 |
+
disabled until we can retrain the models.
|
| 62 |
+
|
| 63 |
+
Requires Python 2.6, 2.7, or 3.3+.
|
| 64 |
+
|
| 65 |
+
Installation
|
| 66 |
+
------------
|
| 67 |
+
|
| 68 |
+
Install from `PyPI <https://pypi.python.org/pypi/chardet>`_::
|
| 69 |
+
|
| 70 |
+
pip install chardet
|
| 71 |
+
|
| 72 |
+
Documentation
|
| 73 |
+
-------------
|
| 74 |
+
|
| 75 |
+
For users, docs are now available at https://chardet.readthedocs.io/.
|
| 76 |
+
|
| 77 |
+
Command-line Tool
|
| 78 |
+
-----------------
|
| 79 |
+
|
| 80 |
+
chardet comes with a command-line script which reports on the encodings of one
|
| 81 |
+
or more files::
|
| 82 |
+
|
| 83 |
+
% chardetect somefile someotherfile
|
| 84 |
+
somefile: windows-1252 with confidence 0.5
|
| 85 |
+
someotherfile: ascii with confidence 1.0
|
| 86 |
+
|
| 87 |
+
About
|
| 88 |
+
-----
|
| 89 |
+
|
| 90 |
+
This is a continuation of Mark Pilgrim's excellent chardet. Previously, two
|
| 91 |
+
versions needed to be maintained: one that supported python 2.x and one that
|
| 92 |
+
supported python 3.x. We've recently merged with `Ian Cordasco <https://github.com/sigmavirus24>`_'s
|
| 93 |
+
`charade <https://github.com/sigmavirus24/charade>`_ fork, so now we have one
|
| 94 |
+
coherent version that works for Python 2.6+.
|
| 95 |
+
|
| 96 |
+
:maintainer: Dan Blanchard
|
| 97 |
+
|
| 98 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/RECORD
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../bin/chardetect,sha256=IBU6XTHWxPKYdNWqDMkfnUU1W6iwrl05aLkq3XXRd6c,504
|
| 2 |
+
chardet-3.0.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 3 |
+
chardet-3.0.4.dist-info/LICENSE,sha256=YJXp_6d33SKDn3gBqoRbMcntB_PWv4om3F0t7IzMDvM,26432
|
| 4 |
+
chardet-3.0.4.dist-info/METADATA,sha256=o6XNN41EUioeDnklH1-8haOSjI60AkAaI823ANFkOM4,3304
|
| 5 |
+
chardet-3.0.4.dist-info/RECORD,,
|
| 6 |
+
chardet-3.0.4.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 7 |
+
chardet-3.0.4.dist-info/WHEEL,sha256=ADKeyaGyKF5DwBNE0sRE5pvW-bSkFMJfBuhzZ3rceP4,110
|
| 8 |
+
chardet-3.0.4.dist-info/direct_url.json,sha256=qEwic9I8vtAPxfIV8-WqN9NPBGZglzNUP-pS2ukdfMs,103
|
| 9 |
+
chardet-3.0.4.dist-info/entry_points.txt,sha256=fAMmhu5eJ-zAJ-smfqQwRClQ3-nozOCmvJ6-E8lgGJo,60
|
| 10 |
+
chardet-3.0.4.dist-info/top_level.txt,sha256=AowzBbZy4x8EirABDdJSLJZMkJ_53iIag8xfKR6D7kI,8
|
| 11 |
+
chardet/__init__.py,sha256=YsP5wQlsHJ2auF1RZJfypiSrCA7_bQiRm3ES_NI76-Y,1559
|
| 12 |
+
chardet/__pycache__/__init__.cpython-38.pyc,,
|
| 13 |
+
chardet/__pycache__/big5freq.cpython-38.pyc,,
|
| 14 |
+
chardet/__pycache__/big5prober.cpython-38.pyc,,
|
| 15 |
+
chardet/__pycache__/chardistribution.cpython-38.pyc,,
|
| 16 |
+
chardet/__pycache__/charsetgroupprober.cpython-38.pyc,,
|
| 17 |
+
chardet/__pycache__/charsetprober.cpython-38.pyc,,
|
| 18 |
+
chardet/__pycache__/codingstatemachine.cpython-38.pyc,,
|
| 19 |
+
chardet/__pycache__/compat.cpython-38.pyc,,
|
| 20 |
+
chardet/__pycache__/cp949prober.cpython-38.pyc,,
|
| 21 |
+
chardet/__pycache__/enums.cpython-38.pyc,,
|
| 22 |
+
chardet/__pycache__/escprober.cpython-38.pyc,,
|
| 23 |
+
chardet/__pycache__/escsm.cpython-38.pyc,,
|
| 24 |
+
chardet/__pycache__/eucjpprober.cpython-38.pyc,,
|
| 25 |
+
chardet/__pycache__/euckrfreq.cpython-38.pyc,,
|
| 26 |
+
chardet/__pycache__/euckrprober.cpython-38.pyc,,
|
| 27 |
+
chardet/__pycache__/euctwfreq.cpython-38.pyc,,
|
| 28 |
+
chardet/__pycache__/euctwprober.cpython-38.pyc,,
|
| 29 |
+
chardet/__pycache__/gb2312freq.cpython-38.pyc,,
|
| 30 |
+
chardet/__pycache__/gb2312prober.cpython-38.pyc,,
|
| 31 |
+
chardet/__pycache__/hebrewprober.cpython-38.pyc,,
|
| 32 |
+
chardet/__pycache__/jisfreq.cpython-38.pyc,,
|
| 33 |
+
chardet/__pycache__/jpcntx.cpython-38.pyc,,
|
| 34 |
+
chardet/__pycache__/langbulgarianmodel.cpython-38.pyc,,
|
| 35 |
+
chardet/__pycache__/langcyrillicmodel.cpython-38.pyc,,
|
| 36 |
+
chardet/__pycache__/langgreekmodel.cpython-38.pyc,,
|
| 37 |
+
chardet/__pycache__/langhebrewmodel.cpython-38.pyc,,
|
| 38 |
+
chardet/__pycache__/langhungarianmodel.cpython-38.pyc,,
|
| 39 |
+
chardet/__pycache__/langthaimodel.cpython-38.pyc,,
|
| 40 |
+
chardet/__pycache__/langturkishmodel.cpython-38.pyc,,
|
| 41 |
+
chardet/__pycache__/latin1prober.cpython-38.pyc,,
|
| 42 |
+
chardet/__pycache__/mbcharsetprober.cpython-38.pyc,,
|
| 43 |
+
chardet/__pycache__/mbcsgroupprober.cpython-38.pyc,,
|
| 44 |
+
chardet/__pycache__/mbcssm.cpython-38.pyc,,
|
| 45 |
+
chardet/__pycache__/sbcharsetprober.cpython-38.pyc,,
|
| 46 |
+
chardet/__pycache__/sbcsgroupprober.cpython-38.pyc,,
|
| 47 |
+
chardet/__pycache__/sjisprober.cpython-38.pyc,,
|
| 48 |
+
chardet/__pycache__/universaldetector.cpython-38.pyc,,
|
| 49 |
+
chardet/__pycache__/utf8prober.cpython-38.pyc,,
|
| 50 |
+
chardet/__pycache__/version.cpython-38.pyc,,
|
| 51 |
+
chardet/big5freq.py,sha256=D_zK5GyzoVsRes0HkLJziltFQX0bKCLOrFe9_xDvO_8,31254
|
| 52 |
+
chardet/big5prober.py,sha256=kBxHbdetBpPe7xrlb-e990iot64g_eGSLd32lB7_h3M,1757
|
| 53 |
+
chardet/chardistribution.py,sha256=3woWS62KrGooKyqz4zQSnjFbJpa6V7g02daAibTwcl8,9411
|
| 54 |
+
chardet/charsetgroupprober.py,sha256=6bDu8YIiRuScX4ca9Igb0U69TA2PGXXDej6Cc4_9kO4,3787
|
| 55 |
+
chardet/charsetprober.py,sha256=KSmwJErjypyj0bRZmC5F5eM7c8YQgLYIjZXintZNstg,5110
|
| 56 |
+
chardet/cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
| 57 |
+
chardet/cli/__pycache__/__init__.cpython-38.pyc,,
|
| 58 |
+
chardet/cli/__pycache__/chardetect.cpython-38.pyc,,
|
| 59 |
+
chardet/cli/chardetect.py,sha256=YBO8L4mXo0WR6_-Fjh_8QxPBoEBNqB9oNxNrdc54AQs,2738
|
| 60 |
+
chardet/codingstatemachine.py,sha256=VYp_6cyyki5sHgXDSZnXW4q1oelHc3cu9AyQTX7uug8,3590
|
| 61 |
+
chardet/compat.py,sha256=PKTzHkSbtbHDqS9PyujMbX74q1a8mMpeQTDVsQhZMRw,1134
|
| 62 |
+
chardet/cp949prober.py,sha256=TZ434QX8zzBsnUvL_8wm4AQVTZ2ZkqEEQL_lNw9f9ow,1855
|
| 63 |
+
chardet/enums.py,sha256=Aimwdb9as1dJKZaFNUH2OhWIVBVd6ZkJJ_WK5sNY8cU,1661
|
| 64 |
+
chardet/escprober.py,sha256=kkyqVg1Yw3DIOAMJ2bdlyQgUFQhuHAW8dUGskToNWSc,3950
|
| 65 |
+
chardet/escsm.py,sha256=RuXlgNvTIDarndvllNCk5WZBIpdCxQ0kcd9EAuxUh84,10510
|
| 66 |
+
chardet/eucjpprober.py,sha256=iD8Jdp0ISRjgjiVN7f0e8xGeQJ5GM2oeZ1dA8nbSeUw,3749
|
| 67 |
+
chardet/euckrfreq.py,sha256=-7GdmvgWez4-eO4SuXpa7tBiDi5vRXQ8WvdFAzVaSfo,13546
|
| 68 |
+
chardet/euckrprober.py,sha256=MqFMTQXxW4HbzIpZ9lKDHB3GN8SP4yiHenTmf8g_PxY,1748
|
| 69 |
+
chardet/euctwfreq.py,sha256=No1WyduFOgB5VITUA7PLyC5oJRNzRyMbBxaKI1l16MA,31621
|
| 70 |
+
chardet/euctwprober.py,sha256=13p6EP4yRaxqnP4iHtxHOJ6R2zxHq1_m8hTRjzVZ95c,1747
|
| 71 |
+
chardet/gb2312freq.py,sha256=JX8lsweKLmnCwmk8UHEQsLgkr_rP_kEbvivC4qPOrlc,20715
|
| 72 |
+
chardet/gb2312prober.py,sha256=gGvIWi9WhDjE-xQXHvNIyrnLvEbMAYgyUSZ65HUfylw,1754
|
| 73 |
+
chardet/hebrewprober.py,sha256=c3SZ-K7hvyzGY6JRAZxJgwJ_sUS9k0WYkvMY00YBYFo,13838
|
| 74 |
+
chardet/jisfreq.py,sha256=vpmJv2Bu0J8gnMVRPHMFefTRvo_ha1mryLig8CBwgOg,25777
|
| 75 |
+
chardet/jpcntx.py,sha256=PYlNqRUQT8LM3cT5FmHGP0iiscFlTWED92MALvBungo,19643
|
| 76 |
+
chardet/langbulgarianmodel.py,sha256=1HqQS9Pbtnj1xQgxitJMvw8X6kKr5OockNCZWfEQrPE,12839
|
| 77 |
+
chardet/langcyrillicmodel.py,sha256=LODajvsetH87yYDDQKA2CULXUH87tI223dhfjh9Zx9c,17948
|
| 78 |
+
chardet/langgreekmodel.py,sha256=8YAW7bU8YwSJap0kIJSbPMw1BEqzGjWzqcqf0WgUKAA,12688
|
| 79 |
+
chardet/langhebrewmodel.py,sha256=JSnqmE5E62tDLTPTvLpQsg5gOMO4PbdWRvV7Avkc0HA,11345
|
| 80 |
+
chardet/langhungarianmodel.py,sha256=RhapYSG5l0ZaO-VV4Fan5sW0WRGQqhwBM61yx3yxyOA,12592
|
| 81 |
+
chardet/langthaimodel.py,sha256=8l0173Gu_W6G8mxmQOTEF4ls2YdE7FxWf3QkSxEGXJQ,11290
|
| 82 |
+
chardet/langturkishmodel.py,sha256=W22eRNJsqI6uWAfwXSKVWWnCerYqrI8dZQTm_M0lRFk,11102
|
| 83 |
+
chardet/latin1prober.py,sha256=S2IoORhFk39FEFOlSFWtgVybRiP6h7BlLldHVclNkU8,5370
|
| 84 |
+
chardet/mbcharsetprober.py,sha256=AR95eFH9vuqSfvLQZN-L5ijea25NOBCoXqw8s5O9xLQ,3413
|
| 85 |
+
chardet/mbcsgroupprober.py,sha256=h6TRnnYq2OxG1WdD5JOyxcdVpn7dG0q-vB8nWr5mbh4,2012
|
| 86 |
+
chardet/mbcssm.py,sha256=SY32wVIF3HzcjY3BaEspy9metbNSKxIIB0RKPn7tjpI,25481
|
| 87 |
+
chardet/sbcharsetprober.py,sha256=LDSpCldDCFlYwUkGkwD2oFxLlPWIWXT09akH_2PiY74,5657
|
| 88 |
+
chardet/sbcsgroupprober.py,sha256=1IprcCB_k1qfmnxGC6MBbxELlKqD3scW6S8YIwdeyXA,3546
|
| 89 |
+
chardet/sjisprober.py,sha256=IIt-lZj0WJqK4rmUZzKZP4GJlE8KUEtFYVuY96ek5MQ,3774
|
| 90 |
+
chardet/universaldetector.py,sha256=qL0174lSZE442eB21nnktT9_VcAye07laFWUeUrjttY,12485
|
| 91 |
+
chardet/utf8prober.py,sha256=IdD8v3zWOsB8OLiyPi-y_fqwipRFxV9Nc1eKBLSuIEw,2766
|
| 92 |
+
chardet/version.py,sha256=sp3B08mrDXB-pf3K9fqJ_zeDHOCLC8RrngQyDFap_7g,242
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/REQUESTED
ADDED
|
File without changes
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.35.1)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py2-none-any
|
| 5 |
+
Tag: py3-none-any
|
| 6 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[console_scripts]
|
| 2 |
+
chardetect = chardet.cli.chardetect:main
|
| 3 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/chardet-3.0.4.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
chardet
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__version__ = "0.9.0"
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/extract.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Extract package to directory, with checks against tar members extracting outside
|
| 3 |
+
the target directory.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import os
|
| 9 |
+
import tarfile
|
| 10 |
+
from errno import ELOOP
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
from typing import Generator
|
| 13 |
+
|
| 14 |
+
from . import exceptions, package_streaming
|
| 15 |
+
|
| 16 |
+
__all__ = ["extract_stream", "extract"]
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def extract_stream(
|
| 20 |
+
stream: Generator[tuple[tarfile.TarFile, tarfile.TarInfo], None, None],
|
| 21 |
+
dest_dir: Path | str,
|
| 22 |
+
):
|
| 23 |
+
"""
|
| 24 |
+
Pipe ``stream_conda_component`` output here to extract every member into
|
| 25 |
+
dest_dir.
|
| 26 |
+
|
| 27 |
+
For ``.conda`` will need to be called twice (for info and pkg components);
|
| 28 |
+
for ``.tar.bz2`` every member is extracted.
|
| 29 |
+
"""
|
| 30 |
+
dest_dir = os.path.realpath(dest_dir)
|
| 31 |
+
|
| 32 |
+
def is_within_dest_dir(name):
|
| 33 |
+
abs_target = os.path.realpath(os.path.join(dest_dir, name))
|
| 34 |
+
prefix = os.path.commonpath((dest_dir, abs_target))
|
| 35 |
+
return prefix == dest_dir
|
| 36 |
+
|
| 37 |
+
for tar_file, _ in stream:
|
| 38 |
+
# careful not to seek backwards
|
| 39 |
+
def checked_members():
|
| 40 |
+
# from conda_package_handling
|
| 41 |
+
for member in tar_file:
|
| 42 |
+
if not is_within_dest_dir(member.name):
|
| 43 |
+
raise exceptions.SafetyError(f"contains unsafe path: {member.name}")
|
| 44 |
+
yield member
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
tar_file.extractall(path=dest_dir, members=checked_members())
|
| 48 |
+
except OSError as e:
|
| 49 |
+
if e.errno == ELOOP:
|
| 50 |
+
raise exceptions.CaseInsensitiveFileSystemError() from e
|
| 51 |
+
raise
|
| 52 |
+
|
| 53 |
+
# next iteraton of for loop raises GeneratorExit in stream
|
| 54 |
+
stream.close()
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def extract(filename, dest_dir=None, fileobj=None):
|
| 58 |
+
"""
|
| 59 |
+
Extract all components of conda package to dest_dir.
|
| 60 |
+
|
| 61 |
+
fileobj: must be seekable if provided, if a ``.conda`` package.
|
| 62 |
+
"""
|
| 63 |
+
assert dest_dir, "dest_dir is required"
|
| 64 |
+
if str(filename).endswith(".conda"):
|
| 65 |
+
components = [
|
| 66 |
+
package_streaming.CondaComponent.pkg,
|
| 67 |
+
package_streaming.CondaComponent.info,
|
| 68 |
+
]
|
| 69 |
+
else: # .tar.bz2 doesn't filter by component
|
| 70 |
+
components = [package_streaming.CondaComponent.pkg]
|
| 71 |
+
|
| 72 |
+
closefd = False
|
| 73 |
+
if not fileobj:
|
| 74 |
+
fileobj = open(filename, "rb")
|
| 75 |
+
closefd = True
|
| 76 |
+
|
| 77 |
+
try:
|
| 78 |
+
for component in components:
|
| 79 |
+
stream = package_streaming.stream_conda_component(
|
| 80 |
+
filename, fileobj, component=component
|
| 81 |
+
)
|
| 82 |
+
extract_stream(stream, dest_dir)
|
| 83 |
+
finally:
|
| 84 |
+
if closefd:
|
| 85 |
+
fileobj.close()
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/lazy_wheel.py
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Lazy ZIP over HTTP"""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import logging
|
| 6 |
+
import zipfile
|
| 7 |
+
from bisect import bisect_left, bisect_right
|
| 8 |
+
from contextlib import contextmanager
|
| 9 |
+
from tempfile import NamedTemporaryFile
|
| 10 |
+
from typing import Any, Iterator
|
| 11 |
+
from zipfile import BadZipfile, ZipFile
|
| 12 |
+
|
| 13 |
+
from requests import Session
|
| 14 |
+
from requests.models import CONTENT_CHUNK_SIZE, Response
|
| 15 |
+
|
| 16 |
+
# from pip 22.0.3 with fixes & remove imports from pip
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
log = logging.getLogger(__name__)
|
| 20 |
+
|
| 21 |
+
# If-Match (etag) to detect file changed during fetch would also be nice
|
| 22 |
+
HEADERS = {"Accept-Encoding": "identity"}
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class HTTPRangeRequestUnsupported(Exception):
|
| 26 |
+
pass
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class LazyZipOverHTTP:
|
| 30 |
+
"""File-like object mapped to a ZIP file over HTTP.
|
| 31 |
+
|
| 32 |
+
This uses HTTP range requests to lazily fetch the file's content,
|
| 33 |
+
which is supposed to be fed to ZipFile. If such requests are not
|
| 34 |
+
supported by the server, raise HTTPRangeRequestUnsupported
|
| 35 |
+
during initialization.
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
def __init__(
|
| 39 |
+
self, url: str, session: Session, chunk_size: int = CONTENT_CHUNK_SIZE
|
| 40 |
+
) -> None:
|
| 41 |
+
# if CONTENT_CHUNK_SIZE is bigger than the file:
|
| 42 |
+
# In [8]: response.headers["Content-Range"]
|
| 43 |
+
# Out[8]: 'bytes 0-3133374/3133375'
|
| 44 |
+
|
| 45 |
+
self._request_count = 0
|
| 46 |
+
|
| 47 |
+
self._session, self._url, self._chunk_size = session, url, chunk_size
|
| 48 |
+
|
| 49 |
+
# initial range request for the end of the file
|
| 50 |
+
tail = self._stream_response(start="", end=CONTENT_CHUNK_SIZE)
|
| 51 |
+
# e.g. {'accept-ranges': 'bytes', 'content-length': '10240',
|
| 52 |
+
# 'content-range': 'bytes 12824-23063/23064', 'last-modified': 'Sat, 16
|
| 53 |
+
# Apr 2022 13:03:02 GMT', 'date': 'Thu, 21 Apr 2022 11:34:04 GMT'}
|
| 54 |
+
|
| 55 |
+
if tail.status_code != 206:
|
| 56 |
+
raise HTTPRangeRequestUnsupported("range request is not supported")
|
| 57 |
+
|
| 58 |
+
# lowercase content-range to support s3
|
| 59 |
+
self._length = int(tail.headers["content-range"].partition("/")[-1])
|
| 60 |
+
self._file = NamedTemporaryFile()
|
| 61 |
+
self.truncate(self._length)
|
| 62 |
+
|
| 63 |
+
# length is also in Content-Length and Content-Range header
|
| 64 |
+
with self._stay():
|
| 65 |
+
content_length = int(tail.headers["content-length"])
|
| 66 |
+
if hasattr(tail, "content"):
|
| 67 |
+
assert content_length == len(tail.content)
|
| 68 |
+
self.seek(self._length - content_length)
|
| 69 |
+
for chunk in tail.iter_content(self._chunk_size):
|
| 70 |
+
self._file.write(chunk)
|
| 71 |
+
self._left: list[int] = [self._length - content_length]
|
| 72 |
+
self._right: list[int] = [self._length - 1]
|
| 73 |
+
|
| 74 |
+
@property
|
| 75 |
+
def mode(self) -> str:
|
| 76 |
+
"""Opening mode, which is always rb."""
|
| 77 |
+
return "rb"
|
| 78 |
+
|
| 79 |
+
@property
|
| 80 |
+
def name(self) -> str:
|
| 81 |
+
"""Path to the underlying file."""
|
| 82 |
+
return self._file.name
|
| 83 |
+
|
| 84 |
+
def seekable(self) -> bool:
|
| 85 |
+
"""Return whether random access is supported, which is True."""
|
| 86 |
+
return True
|
| 87 |
+
|
| 88 |
+
def close(self) -> None:
|
| 89 |
+
"""Close the file."""
|
| 90 |
+
self._file.close()
|
| 91 |
+
|
| 92 |
+
@property
|
| 93 |
+
def closed(self) -> bool:
|
| 94 |
+
"""Whether the file is closed."""
|
| 95 |
+
return self._file.closed
|
| 96 |
+
|
| 97 |
+
def read(self, size: int = -1) -> bytes:
|
| 98 |
+
"""Read up to size bytes from the object and return them.
|
| 99 |
+
|
| 100 |
+
As a convenience, if size is unspecified or -1,
|
| 101 |
+
all bytes until EOF are returned. Fewer than
|
| 102 |
+
size bytes may be returned if EOF is reached.
|
| 103 |
+
"""
|
| 104 |
+
# BUG does not download correctly if size is unspecified
|
| 105 |
+
download_size = size
|
| 106 |
+
start, length = self.tell(), self._length
|
| 107 |
+
stop = length if size < 0 else min(start + download_size, length)
|
| 108 |
+
start = max(0, stop - download_size)
|
| 109 |
+
self._download(start, stop - 1)
|
| 110 |
+
return self._file.read(size)
|
| 111 |
+
|
| 112 |
+
def readable(self) -> bool:
|
| 113 |
+
"""Return whether the file is readable, which is True."""
|
| 114 |
+
return True
|
| 115 |
+
|
| 116 |
+
def seek(self, offset: int, whence: int = 0) -> int:
|
| 117 |
+
"""Change stream position and return the new absolute position.
|
| 118 |
+
|
| 119 |
+
Seek to offset relative position indicated by whence:
|
| 120 |
+
* 0: Start of stream (the default). pos should be >= 0;
|
| 121 |
+
* 1: Current position - pos may be negative;
|
| 122 |
+
* 2: End of stream - pos usually negative.
|
| 123 |
+
"""
|
| 124 |
+
return self._file.seek(offset, whence)
|
| 125 |
+
|
| 126 |
+
def tell(self) -> int:
|
| 127 |
+
"""Return the current position."""
|
| 128 |
+
return self._file.tell()
|
| 129 |
+
|
| 130 |
+
def truncate(self, size: int | None = None) -> int:
|
| 131 |
+
"""Resize the stream to the given size in bytes.
|
| 132 |
+
|
| 133 |
+
If size is unspecified resize to the current position.
|
| 134 |
+
The current stream position isn't changed.
|
| 135 |
+
|
| 136 |
+
Return the new file size.
|
| 137 |
+
"""
|
| 138 |
+
return self._file.truncate(size)
|
| 139 |
+
|
| 140 |
+
def writable(self) -> bool:
|
| 141 |
+
"""Return False."""
|
| 142 |
+
return False
|
| 143 |
+
|
| 144 |
+
def __enter__(self) -> LazyZipOverHTTP:
|
| 145 |
+
self._file.__enter__()
|
| 146 |
+
return self
|
| 147 |
+
|
| 148 |
+
def __exit__(self, *exc: Any) -> bool | None:
|
| 149 |
+
return self._file.__exit__(*exc)
|
| 150 |
+
|
| 151 |
+
@contextmanager
|
| 152 |
+
def _stay(self) -> Iterator[None]:
|
| 153 |
+
"""Return a context manager keeping the position.
|
| 154 |
+
|
| 155 |
+
At the end of the block, seek back to original position.
|
| 156 |
+
"""
|
| 157 |
+
pos = self.tell()
|
| 158 |
+
try:
|
| 159 |
+
yield
|
| 160 |
+
finally:
|
| 161 |
+
self.seek(pos)
|
| 162 |
+
|
| 163 |
+
def _check_zip(self) -> None:
|
| 164 |
+
"""Check and download until the file is a valid ZIP."""
|
| 165 |
+
end = self._length - 1
|
| 166 |
+
for start in reversed(range(0, end, self._chunk_size)):
|
| 167 |
+
self._download(start, end)
|
| 168 |
+
with self._stay():
|
| 169 |
+
try:
|
| 170 |
+
# For read-only ZIP files, ZipFile only needs
|
| 171 |
+
# methods read, seek, seekable and tell.
|
| 172 |
+
ZipFile(self) # type: ignore
|
| 173 |
+
except BadZipfile:
|
| 174 |
+
pass
|
| 175 |
+
else:
|
| 176 |
+
break
|
| 177 |
+
|
| 178 |
+
def _stream_response(
|
| 179 |
+
self, start: int | str, end: int, base_headers: dict[str, str] = HEADERS
|
| 180 |
+
) -> Response:
|
| 181 |
+
"""Return HTTP response to a range request from start to end.
|
| 182 |
+
|
| 183 |
+
:param start: if "", request ``end` bytes from end of file."""
|
| 184 |
+
headers = base_headers.copy()
|
| 185 |
+
headers["Range"] = f"bytes={start}-{end}"
|
| 186 |
+
log.debug("%s", headers["Range"])
|
| 187 |
+
# TODO: Get range requests to be correctly cached
|
| 188 |
+
headers["Cache-Control"] = "no-cache"
|
| 189 |
+
self._request_count += 1
|
| 190 |
+
response = self._session.get(self._url, headers=headers, stream=True)
|
| 191 |
+
response.raise_for_status()
|
| 192 |
+
return response
|
| 193 |
+
|
| 194 |
+
def _merge(
|
| 195 |
+
self, start: int, end: int, left: int, right: int
|
| 196 |
+
) -> Iterator[tuple[int, int]]:
|
| 197 |
+
"""Return an iterator of intervals to be fetched.
|
| 198 |
+
|
| 199 |
+
Args:
|
| 200 |
+
start (int): Start of needed interval
|
| 201 |
+
end (int): End of needed interval
|
| 202 |
+
left (int): Index of first overlapping downloaded data
|
| 203 |
+
right (int): Index after last overlapping downloaded data
|
| 204 |
+
"""
|
| 205 |
+
lslice, rslice = self._left[left:right], self._right[left:right]
|
| 206 |
+
i = start = min([start] + lslice[:1])
|
| 207 |
+
end = max([end] + rslice[-1:])
|
| 208 |
+
for j, k in zip(lslice, rslice):
|
| 209 |
+
if j > i:
|
| 210 |
+
yield i, j - 1
|
| 211 |
+
i = k + 1
|
| 212 |
+
if i <= end:
|
| 213 |
+
yield i, end
|
| 214 |
+
self._left[left:right], self._right[left:right] = [start], [end]
|
| 215 |
+
|
| 216 |
+
def _download(self, start: int, end: int) -> None:
|
| 217 |
+
"""Download bytes from start to end inclusively."""
|
| 218 |
+
with self._stay():
|
| 219 |
+
left = bisect_left(self._right, start)
|
| 220 |
+
right = bisect_right(self._left, end)
|
| 221 |
+
for start, end in self._merge(start, end, left, right):
|
| 222 |
+
response = self._stream_response(start, end)
|
| 223 |
+
self.seek(start)
|
| 224 |
+
for chunk in response.iter_content(self._chunk_size):
|
| 225 |
+
self._file.write(chunk)
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
class LazyConda(LazyZipOverHTTP):
|
| 229 |
+
def prefetch(self, conda_file_id):
|
| 230 |
+
"""
|
| 231 |
+
Conda fork specific. Prefetch the `.info` range from the remote archive.
|
| 232 |
+
Reduces number of Range requests to 2 or 3 (1 or 2 for the directory, 1
|
| 233 |
+
for the file).
|
| 234 |
+
|
| 235 |
+
conda_file_id: name of .conda without path or `.conda` extension
|
| 236 |
+
"""
|
| 237 |
+
target_file = f"info-{conda_file_id}.tar.zst"
|
| 238 |
+
with self._stay(): # not strictly necessary
|
| 239 |
+
# try to read entire conda info in one request
|
| 240 |
+
zf = zipfile.ZipFile(self)
|
| 241 |
+
infolist = zf.infolist()
|
| 242 |
+
for i, info in enumerate(infolist):
|
| 243 |
+
if info.filename == target_file:
|
| 244 |
+
# could be incorrect if zipfile was concatenated to another
|
| 245 |
+
# file (not likely for .conda)
|
| 246 |
+
start = info.header_offset
|
| 247 |
+
try:
|
| 248 |
+
end = infolist[i + 1].header_offset
|
| 249 |
+
# or info.header_offset
|
| 250 |
+
# + len(info.filename)
|
| 251 |
+
# + len(info.extra)
|
| 252 |
+
# + info.compress_size
|
| 253 |
+
# (unless Zip64)
|
| 254 |
+
except IndexError:
|
| 255 |
+
end = zf.start_dir
|
| 256 |
+
self.seek(start)
|
| 257 |
+
self.read(end - start)
|
| 258 |
+
log.debug(
|
| 259 |
+
"prefetch %s-%s",
|
| 260 |
+
info.header_offset,
|
| 261 |
+
end,
|
| 262 |
+
)
|
| 263 |
+
break
|
| 264 |
+
else:
|
| 265 |
+
log.debug("no zip prefetch")
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/s3.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Adapt s3 to package_streaming
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import typing
|
| 8 |
+
from contextlib import closing
|
| 9 |
+
from typing import Any
|
| 10 |
+
|
| 11 |
+
from . import package_streaming
|
| 12 |
+
|
| 13 |
+
if typing.TYPE_CHECKING: # pragma: no cover
|
| 14 |
+
from mypy_boto3_s3 import Client
|
| 15 |
+
from mypy_boto3_s3.type_defs import GetObjectOutputTypeDef
|
| 16 |
+
else:
|
| 17 |
+
Client = GetObjectOutputTypeDef = None
|
| 18 |
+
|
| 19 |
+
from .url import conda_reader_for_url
|
| 20 |
+
|
| 21 |
+
__all__ = ["stream_conda_info", "conda_reader_for_s3"]
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
class ResponseFacade:
|
| 25 |
+
def __init__(self, response: GetObjectOutputTypeDef):
|
| 26 |
+
self.response = response
|
| 27 |
+
self.raw: Any = response["Body"]
|
| 28 |
+
|
| 29 |
+
def raise_for_status(self):
|
| 30 |
+
# s3 get_object raises automatically?
|
| 31 |
+
pass
|
| 32 |
+
|
| 33 |
+
@property
|
| 34 |
+
def status_code(self):
|
| 35 |
+
return self.response["ResponseMetadata"]["HTTPStatusCode"]
|
| 36 |
+
|
| 37 |
+
@property
|
| 38 |
+
def headers(self):
|
| 39 |
+
# a case-sensitive dict; keys may be lowercased always?
|
| 40 |
+
return self.response["ResponseMetadata"]["HTTPHeaders"]
|
| 41 |
+
|
| 42 |
+
def iter_content(self, n: int):
|
| 43 |
+
return iter(lambda: self.raw.read(n), b"")
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
class SessionFacade:
|
| 47 |
+
"""
|
| 48 |
+
Make s3 client look just enough like a requests.session for LazyZipOverHTTP
|
| 49 |
+
"""
|
| 50 |
+
|
| 51 |
+
def __init__(self, client: Client, bucket: str, key: str):
|
| 52 |
+
self.client = client
|
| 53 |
+
self.bucket = bucket
|
| 54 |
+
self.key = key
|
| 55 |
+
|
| 56 |
+
def get(self, url, *, headers: dict | None = None, stream=True):
|
| 57 |
+
if headers and "Range" in headers:
|
| 58 |
+
response = self.client.get_object(
|
| 59 |
+
Bucket=self.bucket, Key=self.key, Range=headers["Range"]
|
| 60 |
+
)
|
| 61 |
+
else:
|
| 62 |
+
response = self.client.get_object(Bucket=self.bucket, Key=self.key)
|
| 63 |
+
return ResponseFacade(response)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def stream_conda_info(client, bucket, key):
|
| 67 |
+
"""
|
| 68 |
+
Yield (tar, member) for conda package.
|
| 69 |
+
|
| 70 |
+
Just "info/" for .conda, all members for tar.
|
| 71 |
+
"""
|
| 72 |
+
filename, conda = conda_reader_for_s3(client, bucket, key)
|
| 73 |
+
|
| 74 |
+
with closing(conda):
|
| 75 |
+
yield from package_streaming.stream_conda_info(filename, conda)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def conda_reader_for_s3(client: Client, bucket: str, key: str):
|
| 79 |
+
"""
|
| 80 |
+
Return (name, file_like) suitable for package_streaming APIs
|
| 81 |
+
"""
|
| 82 |
+
session: Any = SessionFacade(client, bucket, key)
|
| 83 |
+
return conda_reader_for_url(key, session)
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/conda_package_streaming/transmute.py
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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g-*` `.tar` and `info-*`
|
| 5 |
+
`.tar`, then compress directly into an open `ZipFile` at the end.
|
| 6 |
+
`SpooledTemporaryFile` buffers the first 10MB of the package and its metadata in
|
| 7 |
+
memory, but writes out to disk for larger packages.
|
| 8 |
+
|
| 9 |
+
Conda packages created this way have `info-*` as the last element in the
|
| 10 |
+
`ZipFile`, instead of the first for `.conda` packages created with pre-2.0
|
| 11 |
+
`conda-package-handling`.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
import shutil
|
| 19 |
+
import tarfile
|
| 20 |
+
import tempfile
|
| 21 |
+
import zipfile
|
| 22 |
+
from pathlib import Path
|
| 23 |
+
from typing import Callable
|
| 24 |
+
|
| 25 |
+
import zstandard
|
| 26 |
+
|
| 27 |
+
# streams everything in .tar.bz2 mode
|
| 28 |
+
from .package_streaming import CondaComponent, stream_conda_component
|
| 29 |
+
|
| 30 |
+
# increase to reduce speed and increase compression (levels above 19 use much
|
| 31 |
+
# more memory)
|
| 32 |
+
ZSTD_COMPRESS_LEVEL = 19
|
| 33 |
+
# increase to reduce compression and increase speed
|
| 34 |
+
ZSTD_COMPRESS_THREADS = 1
|
| 35 |
+
|
| 36 |
+
CONDA_PACKAGE_FORMAT_VERSION = 2
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def transmute(
|
| 40 |
+
package,
|
| 41 |
+
path,
|
| 42 |
+
*,
|
| 43 |
+
compressor: Callable[
|
| 44 |
+
[], zstandard.ZstdCompressor
|
| 45 |
+
] = lambda: zstandard.ZstdCompressor(
|
| 46 |
+
level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS
|
| 47 |
+
),
|
| 48 |
+
is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"),
|
| 49 |
+
) -> Path:
|
| 50 |
+
"""
|
| 51 |
+
Convert .tar.bz2 conda :package to .conda-format under path.
|
| 52 |
+
|
| 53 |
+
:param package: path to .tar.bz2 conda package
|
| 54 |
+
:param path: destination path for transmuted .conda package
|
| 55 |
+
:param compressor: A function that creates instances of
|
| 56 |
+
``zstandard.ZstdCompressor()`` to override defaults.
|
| 57 |
+
:param is_info: A function that returns True if a file belongs in the
|
| 58 |
+
``info`` component of a `.conda` package. ``conda-package-handling``
|
| 59 |
+
(not this package ``conda-package-streaming``) uses a set of regular
|
| 60 |
+
expressions to keep expected items in the info- component, while other
|
| 61 |
+
items starting with ``info/`` wind up in the pkg- component.
|
| 62 |
+
|
| 63 |
+
:return: Path to transmuted package.
|
| 64 |
+
"""
|
| 65 |
+
assert package.endswith(".tar.bz2"), "can only convert .tar.bz2 to .conda"
|
| 66 |
+
assert os.path.isdir(path)
|
| 67 |
+
file_id = os.path.basename(package)[: -len(".tar.bz2")]
|
| 68 |
+
output_path = Path(path, f"{file_id}.conda")
|
| 69 |
+
|
| 70 |
+
with tempfile.SpooledTemporaryFile() as info_file, tempfile.SpooledTemporaryFile() as pkg_file:
|
| 71 |
+
with tarfile.TarFile(fileobj=info_file, mode="w") as info_tar, tarfile.TarFile(
|
| 72 |
+
fileobj=pkg_file, mode="w"
|
| 73 |
+
) as pkg_tar:
|
| 74 |
+
# If we wanted to compress these at a low setting to save temporary
|
| 75 |
+
# space, we could insert a file object that counts bytes written in
|
| 76 |
+
# front of a zstd (level between 1..3) compressor.
|
| 77 |
+
stream = iter(stream_conda_component(package))
|
| 78 |
+
for tar, member in stream:
|
| 79 |
+
tar_get = info_tar if is_info(member.name) else pkg_tar
|
| 80 |
+
if member.isfile():
|
| 81 |
+
tar_get.addfile(member, tar.extractfile(member))
|
| 82 |
+
else:
|
| 83 |
+
tar_get.addfile(member)
|
| 84 |
+
|
| 85 |
+
info_tar.close()
|
| 86 |
+
pkg_tar.close()
|
| 87 |
+
|
| 88 |
+
info_size = info_file.tell()
|
| 89 |
+
pkg_size = pkg_file.tell()
|
| 90 |
+
|
| 91 |
+
info_file.seek(0)
|
| 92 |
+
pkg_file.seek(0)
|
| 93 |
+
|
| 94 |
+
with zipfile.ZipFile(
|
| 95 |
+
output_path,
|
| 96 |
+
"x", # x to not append to existing
|
| 97 |
+
compresslevel=zipfile.ZIP_STORED,
|
| 98 |
+
) as conda_file:
|
| 99 |
+
# Use a maximum of one Zstd compressor, stream_writer at a time to save memory.
|
| 100 |
+
data_compress = compressor()
|
| 101 |
+
|
| 102 |
+
pkg_metadata = {"conda_pkg_format_version": CONDA_PACKAGE_FORMAT_VERSION}
|
| 103 |
+
conda_file.writestr("metadata.json", json.dumps(pkg_metadata))
|
| 104 |
+
|
| 105 |
+
with conda_file.open(
|
| 106 |
+
f"pkg-{file_id}.tar.zst", "w"
|
| 107 |
+
) as pkg_file_zip, data_compress.stream_writer(
|
| 108 |
+
pkg_file_zip, size=pkg_size, closefd=False
|
| 109 |
+
) as pkg_stream:
|
| 110 |
+
shutil.copyfileobj(pkg_file._file, pkg_stream)
|
| 111 |
+
|
| 112 |
+
with conda_file.open(
|
| 113 |
+
f"info-{file_id}.tar.zst", "w"
|
| 114 |
+
) as info_file_zip, data_compress.stream_writer(
|
| 115 |
+
info_file_zip, size=info_size, closefd=False
|
| 116 |
+
) as info_stream:
|
| 117 |
+
shutil.copyfileobj(info_file._file, info_stream)
|
| 118 |
+
|
| 119 |
+
return output_path
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def transmute_tar_bz2(
|
| 123 |
+
package: str,
|
| 124 |
+
path,
|
| 125 |
+
) -> Path:
|
| 126 |
+
"""
|
| 127 |
+
Convert .conda :package to .tar.bz2 format under path.
|
| 128 |
+
|
| 129 |
+
Can recompress .tar.bz2 packages.
|
| 130 |
+
|
| 131 |
+
:param package: path to `.conda` or `.tar.bz2` package.
|
| 132 |
+
:param path: destination path for transmuted package.
|
| 133 |
+
|
| 134 |
+
:return: Path to transmuted package.
|
| 135 |
+
"""
|
| 136 |
+
assert package.endswith((".tar.bz2", ".conda")), "Unknown extension"
|
| 137 |
+
assert os.path.isdir(path)
|
| 138 |
+
|
| 139 |
+
incoming_format = ".conda" if package.endswith(".conda") else ".tar.bz2"
|
| 140 |
+
|
| 141 |
+
file_id = os.path.basename(package)[: -len(incoming_format)]
|
| 142 |
+
|
| 143 |
+
if incoming_format == ".conda":
|
| 144 |
+
# .tar.bz2 MUST place info/ first.
|
| 145 |
+
components = [CondaComponent.info, CondaComponent.pkg]
|
| 146 |
+
else:
|
| 147 |
+
# .tar.bz2 doesn't filter by component
|
| 148 |
+
components = [CondaComponent.pkg]
|
| 149 |
+
|
| 150 |
+
output_path = Path(path, f"{file_id}.tar.bz2")
|
| 151 |
+
|
| 152 |
+
with open(package, "rb") as fileobj, tarfile.open(output_path, "x:bz2") as pkg_tar:
|
| 153 |
+
for component in components:
|
| 154 |
+
stream = iter(stream_conda_component(package, fileobj, component=component))
|
| 155 |
+
for tar, member in stream:
|
| 156 |
+
if member.isfile():
|
| 157 |
+
pkg_tar.addfile(member, tar.extractfile(member))
|
| 158 |
+
else:
|
| 159 |
+
pkg_tar.addfile(member)
|
| 160 |
+
|
| 161 |
+
return output_path
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/einops_exts/einops_exts.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
from torch import nn
|
| 3 |
+
from functools import wraps, partial
|
| 4 |
+
|
| 5 |
+
from einops import rearrange, reduce, repeat
|
| 6 |
+
|
| 7 |
+
# checking shape
|
| 8 |
+
# @nils-werner
|
| 9 |
+
# https://github.com/arogozhnikov/einops/issues/168#issuecomment-1042933838
|
| 10 |
+
|
| 11 |
+
def check_shape(tensor, pattern, **kwargs):
|
| 12 |
+
return rearrange(tensor, f"{pattern} -> {pattern}", **kwargs)
|
| 13 |
+
|
| 14 |
+
# do same einops operations on a list of tensors
|
| 15 |
+
|
| 16 |
+
def _many(fn):
|
| 17 |
+
@wraps(fn)
|
| 18 |
+
def inner(tensors, pattern, **kwargs):
|
| 19 |
+
return (fn(tensor, pattern, **kwargs) for tensor in tensors)
|
| 20 |
+
return inner
|
| 21 |
+
|
| 22 |
+
# do einops with unflattening of anonymously named dimensions
|
| 23 |
+
# (...flattened) -> ...flattened
|
| 24 |
+
|
| 25 |
+
def _with_anon_dims(fn):
|
| 26 |
+
@wraps(fn)
|
| 27 |
+
def inner(tensor, pattern, **kwargs):
|
| 28 |
+
regex = r'(\.\.\.[a-zA-Z]+)'
|
| 29 |
+
matches = re.findall(regex, pattern)
|
| 30 |
+
get_anon_dim_name = lambda t: t.lstrip('...')
|
| 31 |
+
dim_prefixes = tuple(map(get_anon_dim_name, set(matches)))
|
| 32 |
+
|
| 33 |
+
update_kwargs_dict = dict()
|
| 34 |
+
|
| 35 |
+
for prefix in dim_prefixes:
|
| 36 |
+
assert prefix in kwargs, f'dimension list "{prefix}" was not passed in'
|
| 37 |
+
dim_list = kwargs[prefix]
|
| 38 |
+
assert isinstance(dim_list, (list, tuple)), f'dimension list "{prefix}" needs to be a tuple of list of dimensions'
|
| 39 |
+
dim_names = list(map(lambda ind: f'{prefix}{ind}', range(len(dim_list))))
|
| 40 |
+
update_kwargs_dict[prefix] = dict(zip(dim_names, dim_list))
|
| 41 |
+
|
| 42 |
+
def sub_with_anonymous_dims(t):
|
| 43 |
+
dim_name_prefix = get_anon_dim_name(t.groups()[0])
|
| 44 |
+
return ' '.join(update_kwargs_dict[dim_name_prefix].keys())
|
| 45 |
+
|
| 46 |
+
pattern_new = re.sub(regex, sub_with_anonymous_dims, pattern)
|
| 47 |
+
|
| 48 |
+
for prefix, update_dict in update_kwargs_dict.items():
|
| 49 |
+
del kwargs[prefix]
|
| 50 |
+
kwargs.update(update_dict)
|
| 51 |
+
|
| 52 |
+
return fn(tensor, pattern_new, **kwargs)
|
| 53 |
+
return inner
|
| 54 |
+
|
| 55 |
+
# generate all helper functions
|
| 56 |
+
|
| 57 |
+
rearrange_many = _many(rearrange)
|
| 58 |
+
repeat_many = _many(repeat)
|
| 59 |
+
reduce_many = _many(reduce)
|
| 60 |
+
|
| 61 |
+
rearrange_with_anon_dims = _with_anon_dims(rearrange)
|
| 62 |
+
repeat_with_anon_dims = _with_anon_dims(repeat)
|
| 63 |
+
reduce_with_anon_dims = _with_anon_dims(reduce)
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/einops_exts/torch.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from torch import nn
|
| 2 |
+
from einops import rearrange
|
| 3 |
+
|
| 4 |
+
# for rearranging to and from a pattern
|
| 5 |
+
|
| 6 |
+
class EinopsToAndFrom(nn.Module):
|
| 7 |
+
def __init__(self, from_einops, to_einops, fn):
|
| 8 |
+
super().__init__()
|
| 9 |
+
self.from_einops = from_einops
|
| 10 |
+
self.to_einops = to_einops
|
| 11 |
+
self.fn = fn
|
| 12 |
+
|
| 13 |
+
def forward(self, x, **kwargs):
|
| 14 |
+
shape = x.shape
|
| 15 |
+
reconstitute_kwargs = dict(tuple(zip(self.from_einops.split(' '), shape)))
|
| 16 |
+
x = rearrange(x, f'{self.from_einops} -> {self.to_einops}')
|
| 17 |
+
x = self.fn(x, **kwargs)
|
| 18 |
+
x = rearrange(x, f'{self.to_einops} -> {self.from_einops}', **reconstitute_kwargs)
|
| 19 |
+
return x
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
from .deform_grid import deform_grid, deform_grid_gradient, deform_random_grid
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/deform_grid.py
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
import scipy.ndimage
|
| 3 |
+
|
| 4 |
+
from . import _deform_grid
|
| 5 |
+
|
| 6 |
+
def deform_random_grid(X, sigma=25, points=3, order=3, mode='constant', cval=0.0,
|
| 7 |
+
crop=None, prefilter=True, axis=None,
|
| 8 |
+
affine=None, rotate=None, zoom=None):
|
| 9 |
+
"""
|
| 10 |
+
Elastic deformation with a random deformation grid
|
| 11 |
+
|
| 12 |
+
This generates a random, square deformation grid with displacements
|
| 13 |
+
sampled from from a normal distribution with standard deviation `sigma`.
|
| 14 |
+
The deformation is then applied to the image or list of images,
|
| 15 |
+
|
| 16 |
+
See ``deform_grid`` for a full description of the parameters.
|
| 17 |
+
|
| 18 |
+
Parameters
|
| 19 |
+
----------
|
| 20 |
+
X : numpy array or list of arrays
|
| 21 |
+
image, or list of images of the same size
|
| 22 |
+
sigma : float
|
| 23 |
+
standard deviation of the normal distribution
|
| 24 |
+
points : array
|
| 25 |
+
number of points of the deformation grid
|
| 26 |
+
rotate : float or None
|
| 27 |
+
angle in degrees to rotate the output
|
| 28 |
+
|
| 29 |
+
This only works for 2D images and rotates the image around
|
| 30 |
+
the center of the output.
|
| 31 |
+
zoom : float or None
|
| 32 |
+
scale factor to zoom the output
|
| 33 |
+
|
| 34 |
+
This only works for 2D images and scales the image around
|
| 35 |
+
the center of the output.
|
| 36 |
+
|
| 37 |
+
See Also
|
| 38 |
+
--------
|
| 39 |
+
deform_grid : for a full description of the parameters.
|
| 40 |
+
"""
|
| 41 |
+
# prepare inputs and axis selection
|
| 42 |
+
Xs = _normalize_inputs(X)
|
| 43 |
+
axis, deform_shape = _normalize_axis_list(axis, Xs)
|
| 44 |
+
|
| 45 |
+
if not isinstance(points, (list, tuple)):
|
| 46 |
+
points = [points] * len(deform_shape)
|
| 47 |
+
|
| 48 |
+
displacement = numpy.random.randn(len(deform_shape), *points) * sigma
|
| 49 |
+
return deform_grid(X, displacement, order, mode, cval, crop, prefilter, axis, affine, rotate, zoom)
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def deform_grid(X, displacement, order=3, mode='constant', cval=0.0, crop=None, prefilter=True, axis=None,
|
| 53 |
+
affine=None, rotate=None, zoom=None):
|
| 54 |
+
"""
|
| 55 |
+
Elastic deformation with a deformation grid
|
| 56 |
+
|
| 57 |
+
The procedure generates a coarse displacement grid with a random displacement
|
| 58 |
+
for each grid point. This grid is then interpolated to compute a displacement for
|
| 59 |
+
each pixel in the input image. The input image is then deformed using the
|
| 60 |
+
displacement vectors and a spline interpolation.
|
| 61 |
+
|
| 62 |
+
Parameters
|
| 63 |
+
----------
|
| 64 |
+
X : numpy array or list of arrays
|
| 65 |
+
image, or list of images of the same size
|
| 66 |
+
|
| 67 |
+
If X is a list of images, the values for order, mode and cval can be lists
|
| 68 |
+
to specify a different value for every image in X.
|
| 69 |
+
displacement : numpy array
|
| 70 |
+
displacement vectors for each control point
|
| 71 |
+
|
| 72 |
+
displacement is a NumPy array with displacement vectors for each
|
| 73 |
+
control points. For example, to deform a 2D image with 3 x 5 control
|
| 74 |
+
points, provide a displacement matrix of shape 2 x 3 x 5.
|
| 75 |
+
order : {0, 1, 2, 3, 4}
|
| 76 |
+
interpolation order
|
| 77 |
+
mode : ({nearest, wrap, reflect, mirror, constant})
|
| 78 |
+
border mode
|
| 79 |
+
cval : float
|
| 80 |
+
constant value to be used if mode == 'constant'
|
| 81 |
+
crop : None or list
|
| 82 |
+
None, or a list of slice() objects to crop the output
|
| 83 |
+
|
| 84 |
+
crop can be a list of slice() objects to crop the output with.
|
| 85 |
+
Only very simple slicing is supported: the slice start and stop values must
|
| 86 |
+
be positive and should not be larger than the output. Note that this parameter
|
| 87 |
+
is dependent of the axis parameter: if an axis list is given, crop must only
|
| 88 |
+
contain slice() objects for the dimensions in axis.
|
| 89 |
+
prefilter : bool
|
| 90 |
+
if True the input X will be pre-filtered with a spline filter
|
| 91 |
+
axis : None, int, a list of ints, or a list of lists of ints
|
| 92 |
+
the axes to deform over
|
| 93 |
+
|
| 94 |
+
axis indicates the axes on which the deformation should be applied.
|
| 95 |
+
The default (None) is to apply a deformation to all dimensions of the input.
|
| 96 |
+
Giving a single axis (int) or a tuple of axes will apply the deformation only
|
| 97 |
+
to those axes. The shape of the displacement must match this number of axes.
|
| 98 |
+
If multiple inputs are given, axis should be None or a list of tuples with
|
| 99 |
+
the axes for each input.
|
| 100 |
+
affine : None, numpy array of shape (ndim, ndim + 1)
|
| 101 |
+
affine transformation to apply to the output
|
| 102 |
+
|
| 103 |
+
The affine transformation is applied to the output during interpolation.
|
| 104 |
+
rotate : float or None
|
| 105 |
+
angle in degrees to rotate the output
|
| 106 |
+
|
| 107 |
+
This only works for 2D images and rotates the image around
|
| 108 |
+
the center of the output.
|
| 109 |
+
zoom : float or None
|
| 110 |
+
scale factor to zoom the output
|
| 111 |
+
|
| 112 |
+
This only works for 2D images and scales the image around
|
| 113 |
+
the center of the output.
|
| 114 |
+
|
| 115 |
+
Returns
|
| 116 |
+
-------
|
| 117 |
+
numpy array or list of arrays
|
| 118 |
+
The deformed image, or a list of deformed images if a list of inputs is given.
|
| 119 |
+
|
| 120 |
+
Notes
|
| 121 |
+
-----
|
| 122 |
+
See the SciPy documentation for scipy.ndimage.interpolation.map_coordinates
|
| 123 |
+
for more details on some of the parameters.
|
| 124 |
+
|
| 125 |
+
The elastic deformation approach is found in
|
| 126 |
+
|
| 127 |
+
* Ronneberger, Fischer, and Brox, "U-Net: Convolutional Networks for Biomedical
|
| 128 |
+
Image Segmentation" https://arxiv.org/abs/1505.04597
|
| 129 |
+
* Cicek et al., "3D U-Net: Learning Dense Volumetric
|
| 130 |
+
Segmentation from Sparse Annotation" https://arxiv.org/abs/1606.06650
|
| 131 |
+
|
| 132 |
+
Based on a Python implementation by Florian Calvet.
|
| 133 |
+
"""
|
| 134 |
+
# prepare inputs and axis selection
|
| 135 |
+
Xs = _normalize_inputs(X)
|
| 136 |
+
axis, deform_shape = _normalize_axis_list(axis, Xs)
|
| 137 |
+
|
| 138 |
+
# prepare output cropping
|
| 139 |
+
output_shapes, output_offset = _compute_output_shapes(Xs, axis, deform_shape, crop)
|
| 140 |
+
|
| 141 |
+
# prepare other parameters
|
| 142 |
+
displacement = _normalize_displacement(displacement, Xs, axis)
|
| 143 |
+
order = _normalize_order(order, Xs)
|
| 144 |
+
mode = _normalize_mode(mode, Xs)
|
| 145 |
+
cval = _normalize_cval(cval, Xs)
|
| 146 |
+
affine = _normalize_affine(affine, axis)
|
| 147 |
+
|
| 148 |
+
# compute inverse affine given output affine
|
| 149 |
+
inverse_affine = _compute_inverse_affine(affine)
|
| 150 |
+
|
| 151 |
+
# add rotation and zoom to the inverse affine matrix
|
| 152 |
+
inverse_affine = _apply_rotation_and_zoom(rotate, zoom, inverse_affine, [output_shapes[0][d] for d in axis[0]])
|
| 153 |
+
|
| 154 |
+
# prefilter inputs
|
| 155 |
+
Xs_f = []
|
| 156 |
+
for i, x in enumerate(Xs):
|
| 157 |
+
if prefilter and order[i] > 1:
|
| 158 |
+
x_f = numpy.zeros_like(x)
|
| 159 |
+
for d in axis[i]:
|
| 160 |
+
scipy.ndimage.spline_filter1d(x, axis=d, order=order[i], output=x_f)
|
| 161 |
+
x = x_f
|
| 162 |
+
Xs_f.append(x_f)
|
| 163 |
+
else:
|
| 164 |
+
Xs_f.append(x)
|
| 165 |
+
# prefilter displacement
|
| 166 |
+
displacement_f = numpy.zeros_like(displacement)
|
| 167 |
+
for d in range(1, displacement.ndim):
|
| 168 |
+
scipy.ndimage.spline_filter1d(displacement, axis=d, order=3, output=displacement_f)
|
| 169 |
+
displacement = displacement_f
|
| 170 |
+
|
| 171 |
+
# prepare output arrays
|
| 172 |
+
outputs = [numpy.zeros(os, dtype=x.dtype) for os, x in zip(output_shapes, Xs)]
|
| 173 |
+
|
| 174 |
+
_deform_grid.deform_grid(Xs_f, displacement_f, output_offset, outputs, axis, order, mode, cval, inverse_affine)
|
| 175 |
+
|
| 176 |
+
if isinstance(X, list):
|
| 177 |
+
return outputs
|
| 178 |
+
else:
|
| 179 |
+
return outputs[0]
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def deform_grid_gradient(dY, displacement, order=3, mode='constant', cval=0.0, crop=None,
|
| 183 |
+
prefilter=True, axis=None, X_shape=None,
|
| 184 |
+
affine=None, rotate=None, zoom=None):
|
| 185 |
+
"""
|
| 186 |
+
Gradient for deform_grid.
|
| 187 |
+
|
| 188 |
+
This method performs the backward operation that returns the gradient of deform_grid
|
| 189 |
+
with respect to the input. This is similar to performing an inverse deformation on
|
| 190 |
+
the gradient, but not exactly the same: this function gives an exact gradient that
|
| 191 |
+
also takes the interpolation into account.
|
| 192 |
+
|
| 193 |
+
The X_shape parameter specifices the shape of the original inputs, and is only
|
| 194 |
+
necessary if the crop parameter is used. Otherwise, the input shape is the same as
|
| 195 |
+
the shape of the gradient dY.
|
| 196 |
+
|
| 197 |
+
See the documentation for ``deform_grid``.
|
| 198 |
+
|
| 199 |
+
Parameters
|
| 200 |
+
----------
|
| 201 |
+
dY : numpy array
|
| 202 |
+
the input gradient, or list of gradients of the same size
|
| 203 |
+
displacement : numpy array
|
| 204 |
+
displacement vectors for each control point
|
| 205 |
+
order : {0, 1, 2, 3, 4}
|
| 206 |
+
interpolation order
|
| 207 |
+
mode : ({nearest, wrap, reflect, mirror, constant})
|
| 208 |
+
border mode
|
| 209 |
+
cval : float
|
| 210 |
+
constant value to be used if mode == 'constant'
|
| 211 |
+
crop : None or list
|
| 212 |
+
None, or a list of slice() objects to crop the output
|
| 213 |
+
prefilter : bool
|
| 214 |
+
if True the input X will be pre-filtered with a spline filter
|
| 215 |
+
axis : None, int, a list of ints, or a list of lists of ints
|
| 216 |
+
the axes to deform over
|
| 217 |
+
X_shape: tuple with the shape of the input, or a list of tuples
|
| 218 |
+
affine : None, numpy array of shape (ndim, ndim + 1)
|
| 219 |
+
affine transformation to apply to the output
|
| 220 |
+
rotate : float or None
|
| 221 |
+
angle in degrees to rotate the output
|
| 222 |
+
zoom : float or None
|
| 223 |
+
scale factor to zoom the output
|
| 224 |
+
|
| 225 |
+
Returns
|
| 226 |
+
-------
|
| 227 |
+
numpy array
|
| 228 |
+
Returns the gradient with respect to X.
|
| 229 |
+
|
| 230 |
+
"""
|
| 231 |
+
# prepare inputs
|
| 232 |
+
dYs = _normalize_inputs(dY)
|
| 233 |
+
|
| 234 |
+
# find input shape
|
| 235 |
+
if isinstance(X_shape, tuple):
|
| 236 |
+
X_shape = [X_shape]
|
| 237 |
+
elif X_shape is None:
|
| 238 |
+
if crop is not None:
|
| 239 |
+
raise ValueError("X_shape is required if the crop parameter is given.")
|
| 240 |
+
X_shape = [dy.shape for dy in dYs]
|
| 241 |
+
|
| 242 |
+
# initialize gradient outputs
|
| 243 |
+
dXs = [numpy.zeros(s, dy.dtype) for s, dy in zip(X_shape, dYs)]
|
| 244 |
+
|
| 245 |
+
# prepare axis selection
|
| 246 |
+
axis, deform_shape = _normalize_axis_list(axis, dXs)
|
| 247 |
+
|
| 248 |
+
# prepare cropping
|
| 249 |
+
output_shapes, output_offset = _compute_output_shapes(dXs, axis, deform_shape, crop)
|
| 250 |
+
if [tuple(s) for s in output_shapes] != [dy.shape for dy in dYs]:
|
| 251 |
+
raise ValueError("X_shape does not match output shape and cropping. "
|
| 252 |
+
"Expected output shape is %s, but %s given."
|
| 253 |
+
% (str(output_shapes), str([dy.shape for dy in dYs])))
|
| 254 |
+
|
| 255 |
+
# prepare other parameters
|
| 256 |
+
displacement = _normalize_displacement(displacement, dYs, axis)
|
| 257 |
+
order = _normalize_order(order, dYs)
|
| 258 |
+
mode = _normalize_mode(mode, dYs)
|
| 259 |
+
cval = _normalize_cval(cval, dYs)
|
| 260 |
+
affine = _normalize_affine(affine, axis)
|
| 261 |
+
|
| 262 |
+
# compute inverse affine given output affine
|
| 263 |
+
inverse_affine = _compute_inverse_affine(affine)
|
| 264 |
+
|
| 265 |
+
# add rotation and zoom to the affine matrix
|
| 266 |
+
inverse_affine = _apply_rotation_and_zoom(rotate, zoom, inverse_affine, [output_shapes[0][d] for d in axis[0]])
|
| 267 |
+
|
| 268 |
+
# prefilter displacement
|
| 269 |
+
displacement_f = numpy.zeros_like(displacement)
|
| 270 |
+
for d in range(1, displacement.ndim):
|
| 271 |
+
scipy.ndimage.spline_filter1d(displacement, axis=d, order=3, output=displacement_f)
|
| 272 |
+
displacement = displacement_f
|
| 273 |
+
|
| 274 |
+
_deform_grid.deform_grid_grad(dXs, displacement_f, output_offset, dYs, axis, order, mode, cval, inverse_affine)
|
| 275 |
+
|
| 276 |
+
# compute gradient of prefilter operation
|
| 277 |
+
dXs_f = []
|
| 278 |
+
for i, x in enumerate(dXs):
|
| 279 |
+
if prefilter and order[i] > 1:
|
| 280 |
+
x_f = numpy.zeros_like(x)
|
| 281 |
+
for d in axis[i]:
|
| 282 |
+
_deform_grid.spline_filter1d_grad(x, x_f, d, order[i])
|
| 283 |
+
x = x_f
|
| 284 |
+
dXs_f.append(x_f)
|
| 285 |
+
else:
|
| 286 |
+
dXs_f.append(x)
|
| 287 |
+
|
| 288 |
+
if isinstance(dY, list):
|
| 289 |
+
return dXs_f
|
| 290 |
+
else:
|
| 291 |
+
return dXs_f[0]
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
|
| 295 |
+
def _normalize_inputs(X):
|
| 296 |
+
if isinstance(X, numpy.ndarray):
|
| 297 |
+
Xs = [X]
|
| 298 |
+
elif isinstance(X, list):
|
| 299 |
+
Xs = X
|
| 300 |
+
else:
|
| 301 |
+
raise Exception('X should be a numpy.ndarray or a list of numpy.ndarrays.')
|
| 302 |
+
|
| 303 |
+
# check X inputs
|
| 304 |
+
assert len(Xs) > 0, 'You must provide at least one image.'
|
| 305 |
+
assert all(isinstance(x, numpy.ndarray) for x in Xs), 'All elements of X should be numpy.ndarrays.'
|
| 306 |
+
return Xs
|
| 307 |
+
|
| 308 |
+
def _normalize_axis_list(axis, Xs):
|
| 309 |
+
if axis is None:
|
| 310 |
+
axis = [tuple(range(x.ndim)) for x in Xs]
|
| 311 |
+
elif isinstance(axis, int):
|
| 312 |
+
axis = (axis,)
|
| 313 |
+
if isinstance(axis, tuple):
|
| 314 |
+
axis = [axis] * len(Xs)
|
| 315 |
+
assert len(axis) == len(Xs), 'Number of axis tuples should match number of inputs.'
|
| 316 |
+
input_shapes = []
|
| 317 |
+
for x, ax in zip(Xs, axis):
|
| 318 |
+
assert isinstance(ax, tuple), 'axis should be given as a tuple'
|
| 319 |
+
assert all(isinstance(a, int) for a in ax), 'axis must contain ints'
|
| 320 |
+
assert len(ax) == len(axis[0]), 'All axis tuples should have the same length.'
|
| 321 |
+
assert ax == tuple(set(ax)), 'axis must be sorted and unique'
|
| 322 |
+
assert all(0 <= a < x.ndim for a in ax), 'invalid axis for input'
|
| 323 |
+
input_shapes.append(tuple(x.shape[d] for d in ax))
|
| 324 |
+
assert len(set(input_shapes)) == 1, 'All inputs should have the same shape.'
|
| 325 |
+
deform_shape = input_shapes[0]
|
| 326 |
+
return axis, deform_shape
|
| 327 |
+
|
| 328 |
+
def _compute_output_shapes(Xs, axis, deform_shape, crop):
|
| 329 |
+
if crop is not None:
|
| 330 |
+
assert isinstance(crop, (tuple, list)), "crop must be a tuple or a list."
|
| 331 |
+
assert len(crop) == len(deform_shape)
|
| 332 |
+
output_shapes = [list(x.shape) for x in Xs]
|
| 333 |
+
output_offset = [0 for d in range(len(axis[0]))]
|
| 334 |
+
for d in range(len(axis[0])):
|
| 335 |
+
if isinstance(crop[d], slice):
|
| 336 |
+
assert crop[d].step is None
|
| 337 |
+
start = (crop[d].start or 0)
|
| 338 |
+
stop = (crop[d].stop or deform_shape[d])
|
| 339 |
+
assert start >= 0
|
| 340 |
+
assert start < stop and stop <= deform_shape[d]
|
| 341 |
+
for i in range(len(Xs)):
|
| 342 |
+
output_shapes[i][axis[i][d]] = stop - start
|
| 343 |
+
if start > 0:
|
| 344 |
+
output_offset[d] = start
|
| 345 |
+
else:
|
| 346 |
+
raise Exception('Crop must be a slice.')
|
| 347 |
+
if any(o > 0 for o in output_offset):
|
| 348 |
+
output_offset = numpy.array(output_offset).astype('int64')
|
| 349 |
+
else:
|
| 350 |
+
output_offset = None
|
| 351 |
+
else:
|
| 352 |
+
output_shapes = [x.shape for x in Xs]
|
| 353 |
+
output_offset = None
|
| 354 |
+
return output_shapes, output_offset
|
| 355 |
+
|
| 356 |
+
def _normalize_displacement(displacement, Xs, axis):
|
| 357 |
+
assert isinstance(displacement, numpy.ndarray), 'Displacement matrix should be a numpy.ndarray.'
|
| 358 |
+
assert displacement.ndim == len(axis[0]) + 1, 'Number of dimensions of displacement does not match input.'
|
| 359 |
+
assert displacement.shape[0] == len(axis[0]), 'First dimension of displacement should match number of input dimensions.'
|
| 360 |
+
return displacement
|
| 361 |
+
|
| 362 |
+
def _normalize_order(order, Xs):
|
| 363 |
+
if not isinstance(order, (tuple, list)):
|
| 364 |
+
order = [order] * len(Xs)
|
| 365 |
+
assert len(Xs) == len(order), 'Number of order parameters should be equal to number of inputs.'
|
| 366 |
+
assert all(0 <= o and o <= 5 for o in order), 'order should be 0, 1, 2, 3, 4 or 5.'
|
| 367 |
+
return numpy.array(order).astype('int64')
|
| 368 |
+
|
| 369 |
+
def _normalize_mode(mode, Xs):
|
| 370 |
+
if not isinstance(mode, (tuple, list)):
|
| 371 |
+
mode = [mode] * len(Xs)
|
| 372 |
+
mode = [_extend_mode_to_code(o) for o in mode]
|
| 373 |
+
assert len(Xs) == len(mode), 'Number of mode parameters should be equal to number of inputs.'
|
| 374 |
+
return numpy.array(mode).astype('int64')
|
| 375 |
+
|
| 376 |
+
def _normalize_cval(cval, Xs):
|
| 377 |
+
if not isinstance(cval, (tuple, list)):
|
| 378 |
+
cval = [cval] * len(Xs)
|
| 379 |
+
assert len(Xs) == len(cval), 'Number of cval parameters should be equal to number of inputs.'
|
| 380 |
+
return numpy.array(cval).astype('float64')
|
| 381 |
+
|
| 382 |
+
def _normalize_affine(affine, axis):
|
| 383 |
+
if affine is None:
|
| 384 |
+
return affine
|
| 385 |
+
n_axes = len(axis[0])
|
| 386 |
+
if affine.shape == (n_axes + 1, n_axes + 1):
|
| 387 |
+
assert numpy.allclose(affine[n_axes, :], [0, 0, 1]), 'Invalid affine matrix.'
|
| 388 |
+
affine = affine[:n_axes, :]
|
| 389 |
+
assert affine.shape == (n_axes, n_axes + 1), 'Affine matrix should have shape (ndim, ndim+1).'
|
| 390 |
+
return numpy.array(affine).astype('float64')
|
| 391 |
+
|
| 392 |
+
def _compute_inverse_affine(affine):
|
| 393 |
+
if affine is None:
|
| 394 |
+
return None
|
| 395 |
+
else:
|
| 396 |
+
inverse_affine = numpy.zeros(affine.shape, dtype='float64')
|
| 397 |
+
inverse_affine[:, :-1] = numpy.linalg.inv(affine[:, :-1])
|
| 398 |
+
inverse_affine[:, -1] = -numpy.dot(inverse_affine[:, :-1], affine[:, -1])
|
| 399 |
+
return inverse_affine
|
| 400 |
+
|
| 401 |
+
def _compute_rotation_zoom_affine(angle=None, zoom=None, center=None):
|
| 402 |
+
affine = None
|
| 403 |
+
if center is not None:
|
| 404 |
+
a = numpy.array([[1, 0, -center[0]],
|
| 405 |
+
[0, 1, -center[1]],
|
| 406 |
+
[0, 0, 1]])
|
| 407 |
+
affine = a if affine is None else numpy.dot(a, affine)
|
| 408 |
+
if angle:
|
| 409 |
+
theta = numpy.radians(angle)
|
| 410 |
+
a = numpy.array([[numpy.cos(theta), -numpy.sin(theta), 0],
|
| 411 |
+
[numpy.sin(theta), numpy.cos(theta), 0],
|
| 412 |
+
[0, 0, 1]])
|
| 413 |
+
affine = a if affine is None else numpy.dot(a, affine)
|
| 414 |
+
if zoom:
|
| 415 |
+
a = numpy.array([[zoom, 0, 0],
|
| 416 |
+
[0, zoom, 0],
|
| 417 |
+
[0, 0, 1]])
|
| 418 |
+
affine = a if affine is None else numpy.dot(a, affine)
|
| 419 |
+
if center is not None:
|
| 420 |
+
a = numpy.array([[1, 0, center[0]],
|
| 421 |
+
[0, 1, center[1]],
|
| 422 |
+
[0, 0, 1]])
|
| 423 |
+
affine = a if affine is None else numpy.dot(a, affine)
|
| 424 |
+
return affine
|
| 425 |
+
|
| 426 |
+
def _apply_rotation_and_zoom(rotate, zoom, inverse_affine, output_shape):
|
| 427 |
+
if rotate is None and zoom is None:
|
| 428 |
+
return inverse_affine
|
| 429 |
+
assert len(output_shape) == 2, 'Zoom and rotate is only implemented for 2D images.'
|
| 430 |
+
rotate = -float(rotate or 0)
|
| 431 |
+
zoom = 1 / float(zoom or 1)
|
| 432 |
+
new_inverse_affine = _compute_rotation_zoom_affine(angle=rotate, zoom=zoom, center=numpy.array(output_shape) / 2 - 0.5)
|
| 433 |
+
if inverse_affine is not None:
|
| 434 |
+
base_inverse_affine = numpy.eye(3, dtype='float64')
|
| 435 |
+
base_inverse_affine[:-1, :] = inverse_affine
|
| 436 |
+
return numpy.dot(new_inverse_affine, base_inverse_affine)[:2, :]
|
| 437 |
+
else:
|
| 438 |
+
return new_inverse_affine[:2, :]
|
| 439 |
+
|
| 440 |
+
def _extend_mode_to_code(mode):
|
| 441 |
+
"""Convert an extension mode to the corresponding integer code.
|
| 442 |
+
"""
|
| 443 |
+
if mode == 'nearest':
|
| 444 |
+
return 0
|
| 445 |
+
elif mode == 'wrap':
|
| 446 |
+
return 1
|
| 447 |
+
elif mode == 'reflect':
|
| 448 |
+
return 2
|
| 449 |
+
elif mode == 'mirror':
|
| 450 |
+
return 3
|
| 451 |
+
elif mode == 'constant':
|
| 452 |
+
return 4
|
| 453 |
+
else:
|
| 454 |
+
raise RuntimeError('boundary mode not supported')
|
| 455 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/tf.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy
|
| 2 |
+
import tensorflow
|
| 3 |
+
import elasticdeform
|
| 4 |
+
|
| 5 |
+
def deform_grid(X, displacement, *args, **kwargs):
|
| 6 |
+
"""
|
| 7 |
+
Elastic deformation with a deformation grid, wrapped in a TensorFlow Op.
|
| 8 |
+
|
| 9 |
+
This function wraps the ``elasticdeform.deform_grid`` function in a TensorFlow Op
|
| 10 |
+
with a custom gradient.
|
| 11 |
+
|
| 12 |
+
Parameters
|
| 13 |
+
----------
|
| 14 |
+
X : Tensor or list of Tensors
|
| 15 |
+
input image or list of input images
|
| 16 |
+
displacement : Tensor or numpy array
|
| 17 |
+
displacement vectors for each control point
|
| 18 |
+
|
| 19 |
+
Returns
|
| 20 |
+
-------
|
| 21 |
+
Tensor
|
| 22 |
+
the deformed image, or a list of deformed images
|
| 23 |
+
|
| 24 |
+
See Also
|
| 25 |
+
--------
|
| 26 |
+
elasticdeform.deform_grid : for the other parameters
|
| 27 |
+
"""
|
| 28 |
+
use_tf_v1 = hasattr(tensorflow, 'py_func')
|
| 29 |
+
@tensorflow.custom_gradient
|
| 30 |
+
def f(displacement, *xs):
|
| 31 |
+
def fwd(displacement, *xs):
|
| 32 |
+
if not use_tf_v1:
|
| 33 |
+
xs = [x.numpy() for x in list(xs)]
|
| 34 |
+
displacement = displacement.numpy()
|
| 35 |
+
return elasticdeform.deform_grid(list(xs), displacement, *args, **kwargs)
|
| 36 |
+
|
| 37 |
+
def bwd(*dys):
|
| 38 |
+
def grad(*dys_disp_xs):
|
| 39 |
+
dys = list(dys_disp_xs[:len(xs)])
|
| 40 |
+
displacement = dys_disp_xs[len(xs)]
|
| 41 |
+
X_shape = [x.shape for x in dys_disp_xs[len(xs) + 1:]]
|
| 42 |
+
if not use_tf_v1:
|
| 43 |
+
dys = [dy.numpy() for dy in dys]
|
| 44 |
+
displacement = displacement.numpy()
|
| 45 |
+
dXs = elasticdeform.deform_grid_gradient(dys, displacement,
|
| 46 |
+
*args, X_shape=X_shape, **kwargs)
|
| 47 |
+
return [numpy.nan * displacement] + dXs
|
| 48 |
+
grad_inputs = dys + (displacement,) + xs
|
| 49 |
+
grad_output_dtypes = [displacement.dtype] + [x.dtype for x in xs]
|
| 50 |
+
if use_tf_v1:
|
| 51 |
+
# TensorFlow 1
|
| 52 |
+
return tensorflow.py_func(grad, grad_inputs, grad_output_dtypes,
|
| 53 |
+
stateful=False, name='DeformGridGrad')
|
| 54 |
+
else:
|
| 55 |
+
# TensorFlow 2
|
| 56 |
+
return tensorflow.py_function(grad, grad_inputs, grad_output_dtypes,
|
| 57 |
+
name='DeformGridGrad')
|
| 58 |
+
|
| 59 |
+
inputs = (displacement,) + xs
|
| 60 |
+
output_dtypes = [x.dtype for x in xs]
|
| 61 |
+
if use_tf_v1:
|
| 62 |
+
# TensorFlow 1
|
| 63 |
+
y = tensorflow.py_func(fwd, inputs, output_dtypes, stateful=False, name='DeformGrid')
|
| 64 |
+
else:
|
| 65 |
+
# TensorFlow 2
|
| 66 |
+
y = tensorflow.py_function(fwd, inputs, output_dtypes, name='DeformGrid')
|
| 67 |
+
return y, bwd
|
| 68 |
+
|
| 69 |
+
if isinstance(X, (list, tuple)):
|
| 70 |
+
return f(displacement, *X)
|
| 71 |
+
else:
|
| 72 |
+
return f(displacement, X)[0]
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/elasticdeform/torch.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy
|
| 2 |
+
import torch
|
| 3 |
+
import elasticdeform
|
| 4 |
+
|
| 5 |
+
class ElasticDeform(torch.autograd.Function):
|
| 6 |
+
@staticmethod
|
| 7 |
+
def forward(ctx, displacement, deform_args, deform_kwargs, *xs):
|
| 8 |
+
ctx.save_for_backward(displacement)
|
| 9 |
+
ctx.deform_args = deform_args
|
| 10 |
+
ctx.deform_kwargs = deform_kwargs
|
| 11 |
+
ctx.x_shapes = [x.shape for x in xs]
|
| 12 |
+
|
| 13 |
+
xs_numpy = [x.detach().cpu().numpy() for x in xs]
|
| 14 |
+
displacement = displacement.detach().cpu().numpy()
|
| 15 |
+
ys = elasticdeform.deform_grid(xs_numpy, displacement, *deform_args, **deform_kwargs)
|
| 16 |
+
return tuple(torch.tensor(y, device=x.device) for x, y in zip(xs, ys))
|
| 17 |
+
|
| 18 |
+
@staticmethod
|
| 19 |
+
def backward(ctx, *dys):
|
| 20 |
+
displacement, = ctx.saved_tensors
|
| 21 |
+
deform_args = ctx.deform_args
|
| 22 |
+
deform_kwargs = ctx.deform_kwargs
|
| 23 |
+
x_shapes = ctx.x_shapes
|
| 24 |
+
|
| 25 |
+
dys_numpy = [dy.detach().cpu().numpy() for dy in dys]
|
| 26 |
+
displacement = displacement.detach().cpu().numpy()
|
| 27 |
+
dxs = elasticdeform.deform_grid_gradient(dys_numpy, displacement,
|
| 28 |
+
*deform_args, X_shape=x_shapes, **deform_kwargs)
|
| 29 |
+
return (None, None, None) + tuple(torch.tensor(dx, device=dy.device) for dx, dy in zip(dxs, dys))
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def deform_grid(X, displacement, *args, **kwargs):
|
| 34 |
+
"""
|
| 35 |
+
Elastic deformation with a deformation grid, wrapped for PyTorch.
|
| 36 |
+
|
| 37 |
+
This function wraps the ``elasticdeform.deform_grid`` function in a PyTorch function
|
| 38 |
+
with a custom gradient.
|
| 39 |
+
|
| 40 |
+
Parameters
|
| 41 |
+
----------
|
| 42 |
+
X : torch.Tensor or list of torch.Tensors
|
| 43 |
+
input image or list of input images
|
| 44 |
+
displacement : torch.Tensor
|
| 45 |
+
displacement vectors for each control point
|
| 46 |
+
|
| 47 |
+
Returns
|
| 48 |
+
-------
|
| 49 |
+
torch.Tensor
|
| 50 |
+
the deformed image, or a list of deformed images
|
| 51 |
+
|
| 52 |
+
See Also
|
| 53 |
+
--------
|
| 54 |
+
elasticdeform.deform_grid : for the other parameters
|
| 55 |
+
"""
|
| 56 |
+
if not isinstance(X, (list, tuple)):
|
| 57 |
+
X_list = [X]
|
| 58 |
+
else:
|
| 59 |
+
X_list = X
|
| 60 |
+
displacement = torch.as_tensor(displacement)
|
| 61 |
+
y = ElasticDeform.apply(displacement, args, kwargs, *X_list)
|
| 62 |
+
|
| 63 |
+
if isinstance(X, (list, tuple)):
|
| 64 |
+
return y
|
| 65 |
+
else:
|
| 66 |
+
return y[0]
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright 2013-2019 Nikolay Kim and Andrew Svetlov
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: frozenlist
|
| 3 |
+
Version: 1.3.0
|
| 4 |
+
Summary: A list-like structure which implements collections.abc.MutableSequence
|
| 5 |
+
Home-page: https://github.com/aio-libs/frozenlist
|
| 6 |
+
Maintainer: aiohttp team <team@aiohttp.org>
|
| 7 |
+
Maintainer-email: team@aiohttp.org
|
| 8 |
+
License: Apache 2
|
| 9 |
+
Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby
|
| 10 |
+
Project-URL: CI: Github Actions, https://github.com/aio-libs/frozenlist/actions
|
| 11 |
+
Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/frozenlist
|
| 12 |
+
Project-URL: Docs: RTD, https://frozenlist.readthedocs.io
|
| 13 |
+
Project-URL: GitHub: issues, https://github.com/aio-libs/frozenlist/issues
|
| 14 |
+
Project-URL: GitHub: repo, https://github.com/aio-libs/frozenlist
|
| 15 |
+
Platform: UNKNOWN
|
| 16 |
+
Classifier: License :: OSI Approved :: Apache Software License
|
| 17 |
+
Classifier: Intended Audience :: Developers
|
| 18 |
+
Classifier: Programming Language :: Python
|
| 19 |
+
Classifier: Programming Language :: Python :: 3
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 24 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 25 |
+
Classifier: Operating System :: POSIX
|
| 26 |
+
Classifier: Operating System :: MacOS :: MacOS X
|
| 27 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 28 |
+
Requires-Python: >=3.7
|
| 29 |
+
Description-Content-Type: text/x-rst
|
| 30 |
+
License-File: LICENSE
|
| 31 |
+
|
| 32 |
+
==========
|
| 33 |
+
frozenlist
|
| 34 |
+
==========
|
| 35 |
+
|
| 36 |
+
.. image:: https://github.com/aio-libs/frozenlist/workflows/CI/badge.svg
|
| 37 |
+
:target: https://github.com/aio-libs/frozenlist/actions
|
| 38 |
+
:alt: GitHub status for master branch
|
| 39 |
+
|
| 40 |
+
.. image:: https://codecov.io/gh/aio-libs/frozenlist/branch/master/graph/badge.svg
|
| 41 |
+
:target: https://codecov.io/gh/aio-libs/frozenlist
|
| 42 |
+
:alt: codecov.io status for master branch
|
| 43 |
+
|
| 44 |
+
.. image:: https://badge.fury.io/py/frozenlist.svg
|
| 45 |
+
:target: https://pypi.org/project/frozenlist
|
| 46 |
+
:alt: Latest PyPI package version
|
| 47 |
+
|
| 48 |
+
.. image:: https://readthedocs.org/projects/frozenlist/badge/?version=latest
|
| 49 |
+
:target: https://frozenlist.readthedocs.io/
|
| 50 |
+
:alt: Latest Read The Docs
|
| 51 |
+
|
| 52 |
+
.. image:: https://img.shields.io/discourse/topics?server=https%3A%2F%2Faio-libs.discourse.group%2F
|
| 53 |
+
:target: https://aio-libs.discourse.group/
|
| 54 |
+
:alt: Discourse group for io-libs
|
| 55 |
+
|
| 56 |
+
.. image:: https://badges.gitter.im/Join%20Chat.svg
|
| 57 |
+
:target: https://gitter.im/aio-libs/Lobby
|
| 58 |
+
:alt: Chat on Gitter
|
| 59 |
+
|
| 60 |
+
Introduction
|
| 61 |
+
============
|
| 62 |
+
|
| 63 |
+
``frozenlist.FrozenList`` is a list-like structure which implements
|
| 64 |
+
``collections.abc.MutableSequence``. The list is *mutable* until ``FrozenList.freeze``
|
| 65 |
+
is called, after which list modifications raise ``RuntimeError``:
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
>>> from frozenlist import FrozenList
|
| 69 |
+
>>> fl = FrozenList([17, 42])
|
| 70 |
+
>>> fl.append('spam')
|
| 71 |
+
>>> fl.append('Vikings')
|
| 72 |
+
>>> fl
|
| 73 |
+
<FrozenList(frozen=False, [17, 42, 'spam', 'Vikings'])>
|
| 74 |
+
>>> fl.freeze()
|
| 75 |
+
>>> fl
|
| 76 |
+
<FrozenList(frozen=True, [17, 42, 'spam', 'Vikings'])>
|
| 77 |
+
>>> fl.frozen
|
| 78 |
+
True
|
| 79 |
+
>>> fl.append("Monty")
|
| 80 |
+
Traceback (most recent call last):
|
| 81 |
+
File "<stdin>", line 1, in <module>
|
| 82 |
+
File "frozenlist/_frozenlist.pyx", line 97, in frozenlist._frozenlist.FrozenList.append
|
| 83 |
+
self._check_frozen()
|
| 84 |
+
File "frozenlist/_frozenlist.pyx", line 19, in frozenlist._frozenlist.FrozenList._check_frozen
|
| 85 |
+
raise RuntimeError("Cannot modify frozen list.")
|
| 86 |
+
RuntimeError: Cannot modify frozen list.
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
FrozenList is also hashable, but only when frozen. Otherwise it also throws a RuntimeError:
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
>>> fl = FrozenList([17, 42, 'spam'])
|
| 93 |
+
>>> hash(fl)
|
| 94 |
+
Traceback (most recent call last):
|
| 95 |
+
File "<stdin>", line 1, in <module>
|
| 96 |
+
File "frozenlist/_frozenlist.pyx", line 111, in frozenlist._frozenlist.FrozenList.__hash__
|
| 97 |
+
raise RuntimeError("Cannot hash unfrozen list.")
|
| 98 |
+
RuntimeError: Cannot hash unfrozen list.
|
| 99 |
+
>>> fl.freeze()
|
| 100 |
+
>>> hash(fl)
|
| 101 |
+
3713081631934410656
|
| 102 |
+
>>> dictionary = {fl: 'Vikings'} # frozen fl can be a dict key
|
| 103 |
+
>>> dictionary
|
| 104 |
+
{<FrozenList(frozen=True, [1, 2])>: 'Vikings'}
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
Installation
|
| 108 |
+
------------
|
| 109 |
+
|
| 110 |
+
::
|
| 111 |
+
|
| 112 |
+
$ pip install frozenlist
|
| 113 |
+
|
| 114 |
+
The library requires Python 3.6 or newer.
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
Documentation
|
| 118 |
+
=============
|
| 119 |
+
|
| 120 |
+
https://frozenlist.readthedocs.io/
|
| 121 |
+
|
| 122 |
+
Communication channels
|
| 123 |
+
======================
|
| 124 |
+
|
| 125 |
+
*aio-libs discourse group*: https://aio-libs.discourse.group
|
| 126 |
+
|
| 127 |
+
Feel free to post your questions and ideas here.
|
| 128 |
+
|
| 129 |
+
*gitter chat* https://gitter.im/aio-libs/Lobby
|
| 130 |
+
|
| 131 |
+
Requirements
|
| 132 |
+
============
|
| 133 |
+
|
| 134 |
+
- Python >= 3.6
|
| 135 |
+
|
| 136 |
+
License
|
| 137 |
+
=======
|
| 138 |
+
|
| 139 |
+
``frozenlist`` is offered under the Apache 2 license.
|
| 140 |
+
|
| 141 |
+
Source code
|
| 142 |
+
===========
|
| 143 |
+
|
| 144 |
+
The project is hosted on GitHub_
|
| 145 |
+
|
| 146 |
+
Please file an issue in the `bug tracker
|
| 147 |
+
<https://github.com/aio-libs/frozenlist/issues>`_ if you have found a bug
|
| 148 |
+
or have some suggestions to improve the library.
|
| 149 |
+
|
| 150 |
+
.. _GitHub: https://github.com/aio-libs/frozenlist
|
| 151 |
+
|
| 152 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
frozenlist-1.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
frozenlist-1.3.0.dist-info/LICENSE,sha256=b9UkPpLdf5jsacesN3co50kFcJ_1J6W_mNbQJjwE9bY,11332
|
| 3 |
+
frozenlist-1.3.0.dist-info/METADATA,sha256=9gHv8zW2TAZ0zIIOnUVYAoi3o5sk0p5UwGmfYottR3w,4662
|
| 4 |
+
frozenlist-1.3.0.dist-info/RECORD,,
|
| 5 |
+
frozenlist-1.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
frozenlist-1.3.0.dist-info/WHEEL,sha256=Buq0s4-kaRglAVHfGKm_b4CVYtkMY90kHTy3VpNpJvY,217
|
| 7 |
+
frozenlist-1.3.0.dist-info/top_level.txt,sha256=jivtxsPXA3nK3WBWW2LW5Mtu_GHt8UZA13NeCs2cKuA,11
|
| 8 |
+
frozenlist/__init__.py,sha256=jQq0o1FROZho0_3gAjPc_IPXGD_dGOIbp_7_LsxTV6I,2323
|
| 9 |
+
frozenlist/__init__.pyi,sha256=vMEoES1xGegPtVXoCi9XydEeHsyuIq-KdeXwP5PdsaA,1470
|
| 10 |
+
frozenlist/__pycache__/__init__.cpython-38.pyc,,
|
| 11 |
+
frozenlist/_frozenlist.cpython-38-x86_64-linux-gnu.so,sha256=IGZSLglPVJXFyIbMTbK1Y7_IQFS6PhrvIWMdeluGUaA,499824
|
| 12 |
+
frozenlist/_frozenlist.pyx,sha256=9V4Z1En6TZwgFD26d-sjxyhUzUm338H1Qiz4-i5ukv0,2983
|
| 13 |
+
frozenlist/py.typed,sha256=sow9soTwP9T_gEAQSVh7Gb8855h04Nwmhs2We-JRgZM,7
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/REQUESTED
ADDED
|
File without changes
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.37.1)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp38-cp38-manylinux_2_5_x86_64
|
| 5 |
+
Tag: cp38-cp38-manylinux1_x86_64
|
| 6 |
+
Tag: cp38-cp38-manylinux_2_17_x86_64
|
| 7 |
+
Tag: cp38-cp38-manylinux2014_x86_64
|
| 8 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/frozenlist-1.3.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
frozenlist
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
| 203 |
+
|
| 204 |
+
-----------------------------------------------------------
|
| 205 |
+
|
| 206 |
+
BSD 3-Clause License
|
| 207 |
+
|
| 208 |
+
Copyright 2016, Google Inc.
|
| 209 |
+
|
| 210 |
+
Redistribution and use in source and binary forms, with or without
|
| 211 |
+
modification, are permitted provided that the following conditions are met:
|
| 212 |
+
|
| 213 |
+
1. Redistributions of source code must retain the above copyright notice,
|
| 214 |
+
this list of conditions and the following disclaimer.
|
| 215 |
+
|
| 216 |
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
| 217 |
+
this list of conditions and the following disclaimer in the documentation
|
| 218 |
+
and/or other materials provided with the distribution.
|
| 219 |
+
|
| 220 |
+
3. Neither the name of the copyright holder nor the names of its
|
| 221 |
+
contributors may be used to endorse or promote products derived from this
|
| 222 |
+
software without specific prior written permission.
|
| 223 |
+
|
| 224 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 225 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 226 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 227 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
| 228 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
| 229 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
| 230 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
| 231 |
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
| 232 |
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
| 233 |
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
| 234 |
+
THE POSSIBILITY OF SUCH DAMAGE.
|
| 235 |
+
|
| 236 |
+
-----------------------------------------------------------
|
| 237 |
+
|
| 238 |
+
Mozilla Public License, v. 2.0
|
| 239 |
+
|
| 240 |
+
This Source Code Form is subject to the terms of the Mozilla Public License,
|
| 241 |
+
v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
| 242 |
+
obtain one at https://mozilla.org/MPL/2.0/.
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: grpcio
|
| 3 |
+
Version: 1.47.0
|
| 4 |
+
Summary: HTTP/2-based RPC framework
|
| 5 |
+
Home-page: https://grpc.io
|
| 6 |
+
Author: The gRPC Authors
|
| 7 |
+
Author-email: grpc-io@googlegroups.com
|
| 8 |
+
License: Apache License 2.0
|
| 9 |
+
Platform: UNKNOWN
|
| 10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 11 |
+
Classifier: Programming Language :: Python
|
| 12 |
+
Classifier: Programming Language :: Python :: 3
|
| 13 |
+
Classifier: Programming Language :: Python :: 3.5
|
| 14 |
+
Classifier: Programming Language :: Python :: 3.6
|
| 15 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 19 |
+
Classifier: License :: OSI Approved :: Apache Software License
|
| 20 |
+
Requires-Python: >=3.6
|
| 21 |
+
License-File: LICENSE
|
| 22 |
+
Requires-Dist: six (>=1.5.2)
|
| 23 |
+
Requires-Dist: futures (>=2.2.0) ; python_version < "3.2"
|
| 24 |
+
Requires-Dist: enum34 (>=1.0.4) ; python_version < "3.4"
|
| 25 |
+
Provides-Extra: protobuf
|
| 26 |
+
Requires-Dist: grpcio-tools (>=1.47.0) ; extra == 'protobuf'
|
| 27 |
+
|
| 28 |
+
gRPC Python
|
| 29 |
+
===========
|
| 30 |
+
|
| 31 |
+
|compat_check_pypi|
|
| 32 |
+
|
| 33 |
+
Package for gRPC Python.
|
| 34 |
+
|
| 35 |
+
.. |compat_check_pypi| image:: https://python-compatibility-tools.appspot.com/one_badge_image?package=grpcio
|
| 36 |
+
:target: https://python-compatibility-tools.appspot.com/one_badge_target?package=grpcio
|
| 37 |
+
|
| 38 |
+
Supported Python Versions
|
| 39 |
+
-------------------------
|
| 40 |
+
Python >= 3.6
|
| 41 |
+
|
| 42 |
+
Installation
|
| 43 |
+
------------
|
| 44 |
+
|
| 45 |
+
gRPC Python is available for Linux, macOS, and Windows.
|
| 46 |
+
|
| 47 |
+
Installing From PyPI
|
| 48 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 49 |
+
|
| 50 |
+
If you are installing locally...
|
| 51 |
+
|
| 52 |
+
::
|
| 53 |
+
|
| 54 |
+
$ pip install grpcio
|
| 55 |
+
|
| 56 |
+
Else system wide (on Ubuntu)...
|
| 57 |
+
|
| 58 |
+
::
|
| 59 |
+
|
| 60 |
+
$ sudo pip install grpcio
|
| 61 |
+
|
| 62 |
+
If you're on Windows make sure that you installed the :code:`pip.exe` component
|
| 63 |
+
when you installed Python (if not go back and install it!) then invoke:
|
| 64 |
+
|
| 65 |
+
::
|
| 66 |
+
|
| 67 |
+
$ pip.exe install grpcio
|
| 68 |
+
|
| 69 |
+
Windows users may need to invoke :code:`pip.exe` from a command line ran as
|
| 70 |
+
administrator.
|
| 71 |
+
|
| 72 |
+
n.b. On Windows and on Mac OS X one *must* have a recent release of :code:`pip`
|
| 73 |
+
to retrieve the proper wheel from PyPI. Be sure to upgrade to the latest
|
| 74 |
+
version!
|
| 75 |
+
|
| 76 |
+
Installing From Source
|
| 77 |
+
~~~~~~~~~~~~~~~~~~~~~~
|
| 78 |
+
|
| 79 |
+
Building from source requires that you have the Python headers (usually a
|
| 80 |
+
package named :code:`python-dev`).
|
| 81 |
+
|
| 82 |
+
::
|
| 83 |
+
|
| 84 |
+
$ export REPO_ROOT=grpc # REPO_ROOT can be any directory of your choice
|
| 85 |
+
$ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc $REPO_ROOT
|
| 86 |
+
$ cd $REPO_ROOT
|
| 87 |
+
$ git submodule update --init
|
| 88 |
+
|
| 89 |
+
# For the next two commands do `sudo pip install` if you get permission-denied errors
|
| 90 |
+
$ pip install -rrequirements.txt
|
| 91 |
+
$ GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
|
| 92 |
+
|
| 93 |
+
You cannot currently install Python from source on Windows. Things might work
|
| 94 |
+
out for you in MSYS2 (follow the Linux instructions), but it isn't officially
|
| 95 |
+
supported at the moment.
|
| 96 |
+
|
| 97 |
+
Troubleshooting
|
| 98 |
+
~~~~~~~~~~~~~~~
|
| 99 |
+
|
| 100 |
+
Help, I ...
|
| 101 |
+
|
| 102 |
+
* **... see a** :code:`pkg_resources.VersionConflict` **when I try to install
|
| 103 |
+
grpc**
|
| 104 |
+
|
| 105 |
+
This is likely because :code:`pip` doesn't own the offending dependency,
|
| 106 |
+
which in turn is likely because your operating system's package manager owns
|
| 107 |
+
it. You'll need to force the installation of the dependency:
|
| 108 |
+
|
| 109 |
+
:code:`pip install --ignore-installed $OFFENDING_DEPENDENCY`
|
| 110 |
+
|
| 111 |
+
For example, if you get an error like the following:
|
| 112 |
+
|
| 113 |
+
::
|
| 114 |
+
|
| 115 |
+
Traceback (most recent call last):
|
| 116 |
+
File "<string>", line 17, in <module>
|
| 117 |
+
...
|
| 118 |
+
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 509, in find
|
| 119 |
+
raise VersionConflict(dist, req)
|
| 120 |
+
pkg_resources.VersionConflict: (six 1.8.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.10'))
|
| 121 |
+
|
| 122 |
+
You can fix it by doing:
|
| 123 |
+
|
| 124 |
+
::
|
| 125 |
+
|
| 126 |
+
sudo pip install --ignore-installed six
|
| 127 |
+
|
| 128 |
+
* **... see the following error on some platforms**
|
| 129 |
+
|
| 130 |
+
::
|
| 131 |
+
|
| 132 |
+
/tmp/pip-build-U8pSsr/cython/Cython/Plex/Scanners.c:4:20: fatal error: Python.h: No such file or directory
|
| 133 |
+
#include "Python.h"
|
| 134 |
+
^
|
| 135 |
+
compilation terminated.
|
| 136 |
+
|
| 137 |
+
You can fix it by installing `python-dev` package. i.e
|
| 138 |
+
|
| 139 |
+
::
|
| 140 |
+
|
| 141 |
+
sudo apt-get install python-dev
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
grpc/__init__.py,sha256=4OK04hgDV2jesZMzJhbNVQ-iUussrhqeOWCnJy5vh7U,82896
|
| 2 |
+
grpc/__pycache__/__init__.cpython-38.pyc,,
|
| 3 |
+
grpc/__pycache__/_auth.cpython-38.pyc,,
|
| 4 |
+
grpc/__pycache__/_channel.cpython-38.pyc,,
|
| 5 |
+
grpc/__pycache__/_common.cpython-38.pyc,,
|
| 6 |
+
grpc/__pycache__/_compression.cpython-38.pyc,,
|
| 7 |
+
grpc/__pycache__/_grpcio_metadata.cpython-38.pyc,,
|
| 8 |
+
grpc/__pycache__/_interceptor.cpython-38.pyc,,
|
| 9 |
+
grpc/__pycache__/_plugin_wrapping.cpython-38.pyc,,
|
| 10 |
+
grpc/__pycache__/_runtime_protos.cpython-38.pyc,,
|
| 11 |
+
grpc/__pycache__/_server.cpython-38.pyc,,
|
| 12 |
+
grpc/__pycache__/_simple_stubs.cpython-38.pyc,,
|
| 13 |
+
grpc/__pycache__/_utilities.cpython-38.pyc,,
|
| 14 |
+
grpc/_auth.py,sha256=zvJYyOTwc0-ykNJK2gs9MK0JSLXKT7tKDB2Bh50tSU4,2168
|
| 15 |
+
grpc/_channel.py,sha256=8VQESBTLiets7po1zUebwqVBZZ5QUHvkDyPhxvBWAEI,63514
|
| 16 |
+
grpc/_common.py,sha256=iO_tQWEGacZP8M669PzAKesVokMeFeaEEQB4gTCg-MI,6254
|
| 17 |
+
grpc/_compression.py,sha256=F9C7oriOjlz2s168rFK99P6F7mIB_82Yz8XH2I5O64A,1695
|
| 18 |
+
grpc/_cython/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 19 |
+
grpc/_cython/__pycache__/__init__.cpython-38.pyc,,
|
| 20 |
+
grpc/_cython/_credentials/roots.pem,sha256=lhQzRMSuEJWIElssQdXa9lSl-vxuI_rDf3uj0p2n53Y,264440
|
| 21 |
+
grpc/_cython/_cygrpc/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 22 |
+
grpc/_cython/_cygrpc/__pycache__/__init__.cpython-38.pyc,,
|
| 23 |
+
grpc/_cython/cygrpc.cpython-38-x86_64-linux-gnu.so,sha256=4JOoBhB-wLjwcDn2cD83Urx5nxD2Ig7jpobH6K0voss,9960264
|
| 24 |
+
grpc/_grpcio_metadata.py,sha256=K2aekpUq0uhnjYdBjfsmMHd_cAnWtAxI4mOUwTlgjkY,26
|
| 25 |
+
grpc/_interceptor.py,sha256=a53wUfAAQVNYFcU1Gdv0iPBMo9iBDj3EjKpdQFpIuPc,20367
|
| 26 |
+
grpc/_plugin_wrapping.py,sha256=EebcDqD5Tup75sluQaxdUMST6KHGRR8D0Zsldq4e6FA,3916
|
| 27 |
+
grpc/_runtime_protos.py,sha256=iu20d84Jhy0MQoYnYHirTOwIhbBJEEKOBvUPXl8PraA,5564
|
| 28 |
+
grpc/_server.py,sha256=3nOou_EXYVl7kBBj_G1V6R0B8nl1Mar5nGJvVgBdVag,37668
|
| 29 |
+
grpc/_simple_stubs.py,sha256=rH9JFZHmkDkJgQ0IN0UcnWY2q05fXaH3owSD1-8yRm0,23408
|
| 30 |
+
grpc/_utilities.py,sha256=mfkrcyU52mAXKF7_9suyvKmWsqKmzPfAO2skZhRKSEU,5180
|
| 31 |
+
grpc/aio/__init__.py,sha256=Rc9in37TxB9f7wKIJsDUdP3YG1-lRw4AJi-aed2fAWU,3160
|
| 32 |
+
grpc/aio/__pycache__/__init__.cpython-38.pyc,,
|
| 33 |
+
grpc/aio/__pycache__/_base_call.cpython-38.pyc,,
|
| 34 |
+
grpc/aio/__pycache__/_base_channel.cpython-38.pyc,,
|
| 35 |
+
grpc/aio/__pycache__/_base_server.cpython-38.pyc,,
|
| 36 |
+
grpc/aio/__pycache__/_call.cpython-38.pyc,,
|
| 37 |
+
grpc/aio/__pycache__/_channel.cpython-38.pyc,,
|
| 38 |
+
grpc/aio/__pycache__/_interceptor.cpython-38.pyc,,
|
| 39 |
+
grpc/aio/__pycache__/_metadata.cpython-38.pyc,,
|
| 40 |
+
grpc/aio/__pycache__/_server.cpython-38.pyc,,
|
| 41 |
+
grpc/aio/__pycache__/_typing.cpython-38.pyc,,
|
| 42 |
+
grpc/aio/__pycache__/_utils.cpython-38.pyc,,
|
| 43 |
+
grpc/aio/_base_call.py,sha256=PpjLHS8BstE9U8R8vjJ6z-jxOZ4xe1je4XxTxW8-zvA,7313
|
| 44 |
+
grpc/aio/_base_channel.py,sha256=drgTVdBxls_nKD4WsbR2koWwx4-QvR09yyJmI8GurP4,13229
|
| 45 |
+
grpc/aio/_base_server.py,sha256=TXLhToa0dJsv7NAXJxSRXqEz9BuLT_JhoSxgSDDRBSI,12188
|
| 46 |
+
grpc/aio/_call.py,sha256=z5nxcQxwc1ZIMAABXl5PxRxzg1qvLFYY09M4z0kwJX0,24469
|
| 47 |
+
grpc/aio/_channel.py,sha256=XtrI3_GNc266-34HWjIP7xbUr-4M92l8tyf1X09jHhQ,19903
|
| 48 |
+
grpc/aio/_interceptor.py,sha256=7CNC4b9loNP-MfJr4NiqY9dN3vLr1EZfmxIOplBEY4A,40008
|
| 49 |
+
grpc/aio/_metadata.py,sha256=eyvzmGvz3ZuBgMo49Ta_FpRNq2tDivC8b0Tyu98PCIY,4570
|
| 50 |
+
grpc/aio/_server.py,sha256=Z6L66phJYscyXK69sGnpuiLtGbZDNaDUiFy5HRgvxsw,8699
|
| 51 |
+
grpc/aio/_typing.py,sha256=P8CDiVjLSE_PeahSGruuT5IPb8R9y7epVE8eLNaupbs,1363
|
| 52 |
+
grpc/aio/_utils.py,sha256=Bh5-lQO2xszdZeTFAWFfFhhaKy20ll4kucD6f_YZTlg,821
|
| 53 |
+
grpc/beta/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 54 |
+
grpc/beta/__pycache__/__init__.cpython-38.pyc,,
|
| 55 |
+
grpc/beta/__pycache__/_client_adaptations.cpython-38.pyc,,
|
| 56 |
+
grpc/beta/__pycache__/_metadata.cpython-38.pyc,,
|
| 57 |
+
grpc/beta/__pycache__/_server_adaptations.cpython-38.pyc,,
|
| 58 |
+
grpc/beta/__pycache__/implementations.cpython-38.pyc,,
|
| 59 |
+
grpc/beta/__pycache__/interfaces.cpython-38.pyc,,
|
| 60 |
+
grpc/beta/__pycache__/utilities.cpython-38.pyc,,
|
| 61 |
+
grpc/beta/_client_adaptations.py,sha256=dBDjTXCf4VLzrmHIMmABrn0QJm2n1FzkR1aEt6AKjcc,27512
|
| 62 |
+
grpc/beta/_metadata.py,sha256=8bVMfkiSnRbN-paMtPqWKfLCQsBu9cpx2tMeWkfnNaw,1606
|
| 63 |
+
grpc/beta/_server_adaptations.py,sha256=wDdQYfXkqcppA75C6u3nhmZIpO4yhJuBndGbEhVAUxg,13817
|
| 64 |
+
grpc/beta/implementations.py,sha256=hZNIW751MHKCoSycGkEjmIF_YAKcHWLnusOzf12FP38,11822
|
| 65 |
+
grpc/beta/interfaces.py,sha256=chnG-HYccIk-jo5cnU-1L4MR7ZOqEsuZQVSdepW8UQM,5955
|
| 66 |
+
grpc/beta/utilities.py,sha256=-N8MklKSxbBreECo4EEI9WbbzbTycKBl4FPo4nfgbMI,4933
|
| 67 |
+
grpc/experimental/__init__.py,sha256=lLYEUAFLxv6_RfyGYIL_rMRXUE8FwjwMshLhsz9o4Pg,4058
|
| 68 |
+
grpc/experimental/__pycache__/__init__.cpython-38.pyc,,
|
| 69 |
+
grpc/experimental/__pycache__/gevent.cpython-38.pyc,,
|
| 70 |
+
grpc/experimental/__pycache__/session_cache.cpython-38.pyc,,
|
| 71 |
+
grpc/experimental/aio/__init__.py,sha256=bIyDdGBbNHi5F_kHvwByONjc4M_74thy53YmBDr1ZPo,660
|
| 72 |
+
grpc/experimental/aio/__pycache__/__init__.cpython-38.pyc,,
|
| 73 |
+
grpc/experimental/gevent.py,sha256=_YAk9aH2PCZCpaCnW9uGY77W21342dEWm8wOVApTx88,973
|
| 74 |
+
grpc/experimental/session_cache.py,sha256=wAauvDzxvTC6-p3jMbPnTc7y74nhDKSRjb0ktfMPCm8,1533
|
| 75 |
+
grpc/framework/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 76 |
+
grpc/framework/__pycache__/__init__.cpython-38.pyc,,
|
| 77 |
+
grpc/framework/common/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 78 |
+
grpc/framework/common/__pycache__/__init__.cpython-38.pyc,,
|
| 79 |
+
grpc/framework/common/__pycache__/cardinality.cpython-38.pyc,,
|
| 80 |
+
grpc/framework/common/__pycache__/style.cpython-38.pyc,,
|
| 81 |
+
grpc/framework/common/cardinality.py,sha256=20A4kauMieG74urg13RDycR1882x5fPYDPoaShRMvng,988
|
| 82 |
+
grpc/framework/common/style.py,sha256=XGjGIDMJBUUA3Y_lacW1mEIW-UpArWiitC5O8VqSQLk,824
|
| 83 |
+
grpc/framework/foundation/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 84 |
+
grpc/framework/foundation/__pycache__/__init__.cpython-38.pyc,,
|
| 85 |
+
grpc/framework/foundation/__pycache__/abandonment.cpython-38.pyc,,
|
| 86 |
+
grpc/framework/foundation/__pycache__/callable_util.cpython-38.pyc,,
|
| 87 |
+
grpc/framework/foundation/__pycache__/future.cpython-38.pyc,,
|
| 88 |
+
grpc/framework/foundation/__pycache__/logging_pool.cpython-38.pyc,,
|
| 89 |
+
grpc/framework/foundation/__pycache__/stream.cpython-38.pyc,,
|
| 90 |
+
grpc/framework/foundation/__pycache__/stream_util.cpython-38.pyc,,
|
| 91 |
+
grpc/framework/foundation/abandonment.py,sha256=GTuGQt5NI37p1XXdTlI17vGi5-CecKyEU7SViPXSo9E,872
|
| 92 |
+
grpc/framework/foundation/callable_util.py,sha256=yV7ARj4SdAb4NG6jkQ15kyKTV6dH_sPXDt81QWifv6I,3151
|
| 93 |
+
grpc/framework/foundation/future.py,sha256=hLq3__91hlwiuwbT-5aOhjW54kIlIasDt3cAav02NT8,8091
|
| 94 |
+
grpc/framework/foundation/logging_pool.py,sha256=SWw-qAj4_n1q9nk4aAZDQMrRr4t_ZOBgqA7QemztrSI,2276
|
| 95 |
+
grpc/framework/foundation/stream.py,sha256=HbXAdhHv4SzaTZrEckRY6Q4RJ2DB6Exfou5a3PWSW1A,1389
|
| 96 |
+
grpc/framework/foundation/stream_util.py,sha256=CUx6geCSB9zwgdlE0XHXcPSbuLeuNfClsZFyjsQVMB0,4772
|
| 97 |
+
grpc/framework/interfaces/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 98 |
+
grpc/framework/interfaces/__pycache__/__init__.cpython-38.pyc,,
|
| 99 |
+
grpc/framework/interfaces/base/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 100 |
+
grpc/framework/interfaces/base/__pycache__/__init__.cpython-38.pyc,,
|
| 101 |
+
grpc/framework/interfaces/base/__pycache__/base.cpython-38.pyc,,
|
| 102 |
+
grpc/framework/interfaces/base/__pycache__/utilities.cpython-38.pyc,,
|
| 103 |
+
grpc/framework/interfaces/base/base.py,sha256=oIAyBRKyFUx7CD4N9LSounw0epPZnsZYqJH8xqCvPYs,12046
|
| 104 |
+
grpc/framework/interfaces/base/utilities.py,sha256=goqmJRHRD7rXJUKin-HTi5yqfupHkt5MY_QQCAWiF_g,2455
|
| 105 |
+
grpc/framework/interfaces/face/__init__.py,sha256=w3kqSAyaZgP-W0890xR4L4WeBPGrtsQCQJe0FUFR0K0,577
|
| 106 |
+
grpc/framework/interfaces/face/__pycache__/__init__.cpython-38.pyc,,
|
| 107 |
+
grpc/framework/interfaces/face/__pycache__/face.cpython-38.pyc,,
|
| 108 |
+
grpc/framework/interfaces/face/__pycache__/utilities.cpython-38.pyc,,
|
| 109 |
+
grpc/framework/interfaces/face/face.py,sha256=hM2_0SoOHx0_lcXHklttp_pzK0Hd3JHnrH5BweHd5P4,39620
|
| 110 |
+
grpc/framework/interfaces/face/utilities.py,sha256=yeg9qnK3Z22WEnOxpBSy-jt4kwGdXpBaltBdXa6cfRU,6711
|
| 111 |
+
grpcio-1.47.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 112 |
+
grpcio-1.47.0.dist-info/LICENSE,sha256=J3rcwdzvg1mx77SOYoY1-ItAvo-9ZOgv0BaZMNE116U,13187
|
| 113 |
+
grpcio-1.47.0.dist-info/METADATA,sha256=j2OL6uuOCtKDRT3nCrb9mluopeRBbaizQXlEbOxOhK4,3992
|
| 114 |
+
grpcio-1.47.0.dist-info/RECORD,,
|
| 115 |
+
grpcio-1.47.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 116 |
+
grpcio-1.47.0.dist-info/WHEEL,sha256=-ijGDuALlPxm3HbhKntps0QzHsi-DPlXqgerYTTJkFE,148
|
| 117 |
+
grpcio-1.47.0.dist-info/top_level.txt,sha256=eEd2Jq_aVQFp38bWW8Pfwjz_5iibqeOFT-2zXlPAq_8,5
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/REQUESTED
ADDED
|
File without changes
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.37.1)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp38-cp38-manylinux_2_17_x86_64
|
| 5 |
+
Tag: cp38-cp38-manylinux2014_x86_64
|
| 6 |
+
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/grpcio-1.47.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
grpc
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/networkx-2.8.5.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/networkx-2.8.5.dist-info/REQUESTED
ADDED
|
File without changes
|