Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- ckpts/universal/global_step120/zero/22.attention.dense.weight/exp_avg_sq.pt +3 -0
- venv/lib/python3.10/site-packages/attr/__init__.py +134 -0
- venv/lib/python3.10/site-packages/attr/__init__.pyi +555 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_cmp.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_compat.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_config.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_funcs.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_make.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_next_gen.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/_version_info.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/converters.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/exceptions.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/filters.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/setters.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/__pycache__/validators.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/attr/_cmp.py +150 -0
- venv/lib/python3.10/site-packages/attr/_cmp.pyi +13 -0
- venv/lib/python3.10/site-packages/attr/_compat.py +87 -0
- venv/lib/python3.10/site-packages/attr/_config.py +31 -0
- venv/lib/python3.10/site-packages/attr/_funcs.py +483 -0
- venv/lib/python3.10/site-packages/attr/_make.py +0 -0
- venv/lib/python3.10/site-packages/attr/_next_gen.py +229 -0
- venv/lib/python3.10/site-packages/attr/_typing_compat.pyi +15 -0
- venv/lib/python3.10/site-packages/attr/_version_info.py +86 -0
- venv/lib/python3.10/site-packages/attr/_version_info.pyi +9 -0
- venv/lib/python3.10/site-packages/attr/converters.py +144 -0
- venv/lib/python3.10/site-packages/attr/converters.pyi +13 -0
- venv/lib/python3.10/site-packages/attr/exceptions.py +95 -0
- venv/lib/python3.10/site-packages/attr/exceptions.pyi +17 -0
- venv/lib/python3.10/site-packages/attr/filters.py +66 -0
- venv/lib/python3.10/site-packages/attr/filters.pyi +6 -0
- venv/lib/python3.10/site-packages/attr/py.typed +0 -0
- venv/lib/python3.10/site-packages/attr/setters.py +73 -0
- venv/lib/python3.10/site-packages/attr/setters.pyi +19 -0
- venv/lib/python3.10/site-packages/attr/validators.py +681 -0
- venv/lib/python3.10/site-packages/attr/validators.pyi +88 -0
- venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/INSTALLER +1 -0
- venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/License.txt +1568 -0
- venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/METADATA +35 -0
- venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/RECORD +17 -0
- venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/WHEEL +5 -0
- venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/top_level.txt +1 -0
- venv/lib/python3.10/site-packages/sympy/__init__.py +535 -0
- venv/lib/python3.10/site-packages/sympy/__pycache__/__init__.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/__pycache__/abc.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/__pycache__/conftest.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/__pycache__/galgebra.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/__pycache__/release.cpython-310.pyc +0 -0
- venv/lib/python3.10/site-packages/sympy/__pycache__/this.cpython-310.pyc +0 -0
ckpts/universal/global_step120/zero/22.attention.dense.weight/exp_avg_sq.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:796619c9385d5e0fcae416c2d34a2bdf73c1ace4c2a2ebea44df3bc071d4d72f
|
3 |
+
size 16778411
|
venv/lib/python3.10/site-packages/attr/__init__.py
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Classes Without Boilerplate
|
5 |
+
"""
|
6 |
+
|
7 |
+
from functools import partial
|
8 |
+
from typing import Callable
|
9 |
+
|
10 |
+
from . import converters, exceptions, filters, setters, validators
|
11 |
+
from ._cmp import cmp_using
|
12 |
+
from ._compat import Protocol
|
13 |
+
from ._config import get_run_validators, set_run_validators
|
14 |
+
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
|
15 |
+
from ._make import (
|
16 |
+
NOTHING,
|
17 |
+
Attribute,
|
18 |
+
Factory,
|
19 |
+
attrib,
|
20 |
+
attrs,
|
21 |
+
fields,
|
22 |
+
fields_dict,
|
23 |
+
make_class,
|
24 |
+
validate,
|
25 |
+
)
|
26 |
+
from ._next_gen import define, field, frozen, mutable
|
27 |
+
from ._version_info import VersionInfo
|
28 |
+
|
29 |
+
|
30 |
+
s = attributes = attrs
|
31 |
+
ib = attr = attrib
|
32 |
+
dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
|
33 |
+
|
34 |
+
|
35 |
+
class AttrsInstance(Protocol):
|
36 |
+
pass
|
37 |
+
|
38 |
+
|
39 |
+
__all__ = [
|
40 |
+
"Attribute",
|
41 |
+
"AttrsInstance",
|
42 |
+
"Factory",
|
43 |
+
"NOTHING",
|
44 |
+
"asdict",
|
45 |
+
"assoc",
|
46 |
+
"astuple",
|
47 |
+
"attr",
|
48 |
+
"attrib",
|
49 |
+
"attributes",
|
50 |
+
"attrs",
|
51 |
+
"cmp_using",
|
52 |
+
"converters",
|
53 |
+
"define",
|
54 |
+
"evolve",
|
55 |
+
"exceptions",
|
56 |
+
"field",
|
57 |
+
"fields",
|
58 |
+
"fields_dict",
|
59 |
+
"filters",
|
60 |
+
"frozen",
|
61 |
+
"get_run_validators",
|
62 |
+
"has",
|
63 |
+
"ib",
|
64 |
+
"make_class",
|
65 |
+
"mutable",
|
66 |
+
"resolve_types",
|
67 |
+
"s",
|
68 |
+
"set_run_validators",
|
69 |
+
"setters",
|
70 |
+
"validate",
|
71 |
+
"validators",
|
72 |
+
]
|
73 |
+
|
74 |
+
|
75 |
+
def _make_getattr(mod_name: str) -> Callable:
|
76 |
+
"""
|
77 |
+
Create a metadata proxy for packaging information that uses *mod_name* in
|
78 |
+
its warnings and errors.
|
79 |
+
"""
|
80 |
+
|
81 |
+
def __getattr__(name: str) -> str:
|
82 |
+
dunder_to_metadata = {
|
83 |
+
"__title__": "Name",
|
84 |
+
"__copyright__": "",
|
85 |
+
"__version__": "version",
|
86 |
+
"__version_info__": "version",
|
87 |
+
"__description__": "summary",
|
88 |
+
"__uri__": "",
|
89 |
+
"__url__": "",
|
90 |
+
"__author__": "",
|
91 |
+
"__email__": "",
|
92 |
+
"__license__": "license",
|
93 |
+
}
|
94 |
+
if name not in dunder_to_metadata:
|
95 |
+
msg = f"module {mod_name} has no attribute {name}"
|
96 |
+
raise AttributeError(msg)
|
97 |
+
|
98 |
+
import sys
|
99 |
+
import warnings
|
100 |
+
|
101 |
+
if sys.version_info < (3, 8):
|
102 |
+
from importlib_metadata import metadata
|
103 |
+
else:
|
104 |
+
from importlib.metadata import metadata
|
105 |
+
|
106 |
+
if name not in ("__version__", "__version_info__"):
|
107 |
+
warnings.warn(
|
108 |
+
f"Accessing {mod_name}.{name} is deprecated and will be "
|
109 |
+
"removed in a future release. Use importlib.metadata directly "
|
110 |
+
"to query for attrs's packaging metadata.",
|
111 |
+
DeprecationWarning,
|
112 |
+
stacklevel=2,
|
113 |
+
)
|
114 |
+
|
115 |
+
meta = metadata("attrs")
|
116 |
+
if name == "__license__":
|
117 |
+
return "MIT"
|
118 |
+
if name == "__copyright__":
|
119 |
+
return "Copyright (c) 2015 Hynek Schlawack"
|
120 |
+
if name in ("__uri__", "__url__"):
|
121 |
+
return meta["Project-URL"].split(" ", 1)[-1]
|
122 |
+
if name == "__version_info__":
|
123 |
+
return VersionInfo._from_version_string(meta["version"])
|
124 |
+
if name == "__author__":
|
125 |
+
return meta["Author-email"].rsplit(" ", 1)[0]
|
126 |
+
if name == "__email__":
|
127 |
+
return meta["Author-email"].rsplit("<", 1)[1][:-1]
|
128 |
+
|
129 |
+
return meta[dunder_to_metadata[name]]
|
130 |
+
|
131 |
+
return __getattr__
|
132 |
+
|
133 |
+
|
134 |
+
__getattr__ = _make_getattr(__name__)
|
venv/lib/python3.10/site-packages/attr/__init__.pyi
ADDED
@@ -0,0 +1,555 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import enum
|
2 |
+
import sys
|
3 |
+
|
4 |
+
from typing import (
|
5 |
+
Any,
|
6 |
+
Callable,
|
7 |
+
Dict,
|
8 |
+
Generic,
|
9 |
+
List,
|
10 |
+
Mapping,
|
11 |
+
Optional,
|
12 |
+
Protocol,
|
13 |
+
Sequence,
|
14 |
+
Tuple,
|
15 |
+
Type,
|
16 |
+
TypeVar,
|
17 |
+
Union,
|
18 |
+
overload,
|
19 |
+
)
|
20 |
+
|
21 |
+
# `import X as X` is required to make these public
|
22 |
+
from . import converters as converters
|
23 |
+
from . import exceptions as exceptions
|
24 |
+
from . import filters as filters
|
25 |
+
from . import setters as setters
|
26 |
+
from . import validators as validators
|
27 |
+
from ._cmp import cmp_using as cmp_using
|
28 |
+
from ._typing_compat import AttrsInstance_
|
29 |
+
from ._version_info import VersionInfo
|
30 |
+
|
31 |
+
if sys.version_info >= (3, 10):
|
32 |
+
from typing import TypeGuard
|
33 |
+
else:
|
34 |
+
from typing_extensions import TypeGuard
|
35 |
+
|
36 |
+
if sys.version_info >= (3, 11):
|
37 |
+
from typing import dataclass_transform
|
38 |
+
else:
|
39 |
+
from typing_extensions import dataclass_transform
|
40 |
+
|
41 |
+
__version__: str
|
42 |
+
__version_info__: VersionInfo
|
43 |
+
__title__: str
|
44 |
+
__description__: str
|
45 |
+
__url__: str
|
46 |
+
__uri__: str
|
47 |
+
__author__: str
|
48 |
+
__email__: str
|
49 |
+
__license__: str
|
50 |
+
__copyright__: str
|
51 |
+
|
52 |
+
_T = TypeVar("_T")
|
53 |
+
_C = TypeVar("_C", bound=type)
|
54 |
+
|
55 |
+
_EqOrderType = Union[bool, Callable[[Any], Any]]
|
56 |
+
_ValidatorType = Callable[[Any, "Attribute[_T]", _T], Any]
|
57 |
+
_ConverterType = Callable[[Any], Any]
|
58 |
+
_FilterType = Callable[["Attribute[_T]", _T], bool]
|
59 |
+
_ReprType = Callable[[Any], str]
|
60 |
+
_ReprArgType = Union[bool, _ReprType]
|
61 |
+
_OnSetAttrType = Callable[[Any, "Attribute[Any]", Any], Any]
|
62 |
+
_OnSetAttrArgType = Union[
|
63 |
+
_OnSetAttrType, List[_OnSetAttrType], setters._NoOpType
|
64 |
+
]
|
65 |
+
_FieldTransformer = Callable[
|
66 |
+
[type, List["Attribute[Any]"]], List["Attribute[Any]"]
|
67 |
+
]
|
68 |
+
# FIXME: in reality, if multiple validators are passed they must be in a list
|
69 |
+
# or tuple, but those are invariant and so would prevent subtypes of
|
70 |
+
# _ValidatorType from working when passed in a list or tuple.
|
71 |
+
_ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]]
|
72 |
+
|
73 |
+
# We subclass this here to keep the protocol's qualified name clean.
|
74 |
+
class AttrsInstance(AttrsInstance_, Protocol):
|
75 |
+
pass
|
76 |
+
|
77 |
+
_A = TypeVar("_A", bound=type[AttrsInstance])
|
78 |
+
|
79 |
+
class _Nothing(enum.Enum):
|
80 |
+
NOTHING = enum.auto()
|
81 |
+
|
82 |
+
NOTHING = _Nothing.NOTHING
|
83 |
+
|
84 |
+
# NOTE: Factory lies about its return type to make this possible:
|
85 |
+
# `x: List[int] # = Factory(list)`
|
86 |
+
# Work around mypy issue #4554 in the common case by using an overload.
|
87 |
+
if sys.version_info >= (3, 8):
|
88 |
+
from typing import Literal
|
89 |
+
@overload
|
90 |
+
def Factory(factory: Callable[[], _T]) -> _T: ...
|
91 |
+
@overload
|
92 |
+
def Factory(
|
93 |
+
factory: Callable[[Any], _T],
|
94 |
+
takes_self: Literal[True],
|
95 |
+
) -> _T: ...
|
96 |
+
@overload
|
97 |
+
def Factory(
|
98 |
+
factory: Callable[[], _T],
|
99 |
+
takes_self: Literal[False],
|
100 |
+
) -> _T: ...
|
101 |
+
|
102 |
+
else:
|
103 |
+
@overload
|
104 |
+
def Factory(factory: Callable[[], _T]) -> _T: ...
|
105 |
+
@overload
|
106 |
+
def Factory(
|
107 |
+
factory: Union[Callable[[Any], _T], Callable[[], _T]],
|
108 |
+
takes_self: bool = ...,
|
109 |
+
) -> _T: ...
|
110 |
+
|
111 |
+
class Attribute(Generic[_T]):
|
112 |
+
name: str
|
113 |
+
default: Optional[_T]
|
114 |
+
validator: Optional[_ValidatorType[_T]]
|
115 |
+
repr: _ReprArgType
|
116 |
+
cmp: _EqOrderType
|
117 |
+
eq: _EqOrderType
|
118 |
+
order: _EqOrderType
|
119 |
+
hash: Optional[bool]
|
120 |
+
init: bool
|
121 |
+
converter: Optional[_ConverterType]
|
122 |
+
metadata: Dict[Any, Any]
|
123 |
+
type: Optional[Type[_T]]
|
124 |
+
kw_only: bool
|
125 |
+
on_setattr: _OnSetAttrType
|
126 |
+
alias: Optional[str]
|
127 |
+
|
128 |
+
def evolve(self, **changes: Any) -> "Attribute[Any]": ...
|
129 |
+
|
130 |
+
# NOTE: We had several choices for the annotation to use for type arg:
|
131 |
+
# 1) Type[_T]
|
132 |
+
# - Pros: Handles simple cases correctly
|
133 |
+
# - Cons: Might produce less informative errors in the case of conflicting
|
134 |
+
# TypeVars e.g. `attr.ib(default='bad', type=int)`
|
135 |
+
# 2) Callable[..., _T]
|
136 |
+
# - Pros: Better error messages than #1 for conflicting TypeVars
|
137 |
+
# - Cons: Terrible error messages for validator checks.
|
138 |
+
# e.g. attr.ib(type=int, validator=validate_str)
|
139 |
+
# -> error: Cannot infer function type argument
|
140 |
+
# 3) type (and do all of the work in the mypy plugin)
|
141 |
+
# - Pros: Simple here, and we could customize the plugin with our own errors.
|
142 |
+
# - Cons: Would need to write mypy plugin code to handle all the cases.
|
143 |
+
# We chose option #1.
|
144 |
+
|
145 |
+
# `attr` lies about its return type to make the following possible:
|
146 |
+
# attr() -> Any
|
147 |
+
# attr(8) -> int
|
148 |
+
# attr(validator=<some callable>) -> Whatever the callable expects.
|
149 |
+
# This makes this type of assignments possible:
|
150 |
+
# x: int = attr(8)
|
151 |
+
#
|
152 |
+
# This form catches explicit None or no default but with no other arguments
|
153 |
+
# returns Any.
|
154 |
+
@overload
|
155 |
+
def attrib(
|
156 |
+
default: None = ...,
|
157 |
+
validator: None = ...,
|
158 |
+
repr: _ReprArgType = ...,
|
159 |
+
cmp: Optional[_EqOrderType] = ...,
|
160 |
+
hash: Optional[bool] = ...,
|
161 |
+
init: bool = ...,
|
162 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
163 |
+
type: None = ...,
|
164 |
+
converter: None = ...,
|
165 |
+
factory: None = ...,
|
166 |
+
kw_only: bool = ...,
|
167 |
+
eq: Optional[_EqOrderType] = ...,
|
168 |
+
order: Optional[_EqOrderType] = ...,
|
169 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
170 |
+
alias: Optional[str] = ...,
|
171 |
+
) -> Any: ...
|
172 |
+
|
173 |
+
# This form catches an explicit None or no default and infers the type from the
|
174 |
+
# other arguments.
|
175 |
+
@overload
|
176 |
+
def attrib(
|
177 |
+
default: None = ...,
|
178 |
+
validator: Optional[_ValidatorArgType[_T]] = ...,
|
179 |
+
repr: _ReprArgType = ...,
|
180 |
+
cmp: Optional[_EqOrderType] = ...,
|
181 |
+
hash: Optional[bool] = ...,
|
182 |
+
init: bool = ...,
|
183 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
184 |
+
type: Optional[Type[_T]] = ...,
|
185 |
+
converter: Optional[_ConverterType] = ...,
|
186 |
+
factory: Optional[Callable[[], _T]] = ...,
|
187 |
+
kw_only: bool = ...,
|
188 |
+
eq: Optional[_EqOrderType] = ...,
|
189 |
+
order: Optional[_EqOrderType] = ...,
|
190 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
191 |
+
alias: Optional[str] = ...,
|
192 |
+
) -> _T: ...
|
193 |
+
|
194 |
+
# This form catches an explicit default argument.
|
195 |
+
@overload
|
196 |
+
def attrib(
|
197 |
+
default: _T,
|
198 |
+
validator: Optional[_ValidatorArgType[_T]] = ...,
|
199 |
+
repr: _ReprArgType = ...,
|
200 |
+
cmp: Optional[_EqOrderType] = ...,
|
201 |
+
hash: Optional[bool] = ...,
|
202 |
+
init: bool = ...,
|
203 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
204 |
+
type: Optional[Type[_T]] = ...,
|
205 |
+
converter: Optional[_ConverterType] = ...,
|
206 |
+
factory: Optional[Callable[[], _T]] = ...,
|
207 |
+
kw_only: bool = ...,
|
208 |
+
eq: Optional[_EqOrderType] = ...,
|
209 |
+
order: Optional[_EqOrderType] = ...,
|
210 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
211 |
+
alias: Optional[str] = ...,
|
212 |
+
) -> _T: ...
|
213 |
+
|
214 |
+
# This form covers type=non-Type: e.g. forward references (str), Any
|
215 |
+
@overload
|
216 |
+
def attrib(
|
217 |
+
default: Optional[_T] = ...,
|
218 |
+
validator: Optional[_ValidatorArgType[_T]] = ...,
|
219 |
+
repr: _ReprArgType = ...,
|
220 |
+
cmp: Optional[_EqOrderType] = ...,
|
221 |
+
hash: Optional[bool] = ...,
|
222 |
+
init: bool = ...,
|
223 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
224 |
+
type: object = ...,
|
225 |
+
converter: Optional[_ConverterType] = ...,
|
226 |
+
factory: Optional[Callable[[], _T]] = ...,
|
227 |
+
kw_only: bool = ...,
|
228 |
+
eq: Optional[_EqOrderType] = ...,
|
229 |
+
order: Optional[_EqOrderType] = ...,
|
230 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
231 |
+
alias: Optional[str] = ...,
|
232 |
+
) -> Any: ...
|
233 |
+
@overload
|
234 |
+
def field(
|
235 |
+
*,
|
236 |
+
default: None = ...,
|
237 |
+
validator: None = ...,
|
238 |
+
repr: _ReprArgType = ...,
|
239 |
+
hash: Optional[bool] = ...,
|
240 |
+
init: bool = ...,
|
241 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
242 |
+
converter: None = ...,
|
243 |
+
factory: None = ...,
|
244 |
+
kw_only: bool = ...,
|
245 |
+
eq: Optional[bool] = ...,
|
246 |
+
order: Optional[bool] = ...,
|
247 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
248 |
+
alias: Optional[str] = ...,
|
249 |
+
type: Optional[type] = ...,
|
250 |
+
) -> Any: ...
|
251 |
+
|
252 |
+
# This form catches an explicit None or no default and infers the type from the
|
253 |
+
# other arguments.
|
254 |
+
@overload
|
255 |
+
def field(
|
256 |
+
*,
|
257 |
+
default: None = ...,
|
258 |
+
validator: Optional[_ValidatorArgType[_T]] = ...,
|
259 |
+
repr: _ReprArgType = ...,
|
260 |
+
hash: Optional[bool] = ...,
|
261 |
+
init: bool = ...,
|
262 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
263 |
+
converter: Optional[_ConverterType] = ...,
|
264 |
+
factory: Optional[Callable[[], _T]] = ...,
|
265 |
+
kw_only: bool = ...,
|
266 |
+
eq: Optional[_EqOrderType] = ...,
|
267 |
+
order: Optional[_EqOrderType] = ...,
|
268 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
269 |
+
alias: Optional[str] = ...,
|
270 |
+
type: Optional[type] = ...,
|
271 |
+
) -> _T: ...
|
272 |
+
|
273 |
+
# This form catches an explicit default argument.
|
274 |
+
@overload
|
275 |
+
def field(
|
276 |
+
*,
|
277 |
+
default: _T,
|
278 |
+
validator: Optional[_ValidatorArgType[_T]] = ...,
|
279 |
+
repr: _ReprArgType = ...,
|
280 |
+
hash: Optional[bool] = ...,
|
281 |
+
init: bool = ...,
|
282 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
283 |
+
converter: Optional[_ConverterType] = ...,
|
284 |
+
factory: Optional[Callable[[], _T]] = ...,
|
285 |
+
kw_only: bool = ...,
|
286 |
+
eq: Optional[_EqOrderType] = ...,
|
287 |
+
order: Optional[_EqOrderType] = ...,
|
288 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
289 |
+
alias: Optional[str] = ...,
|
290 |
+
type: Optional[type] = ...,
|
291 |
+
) -> _T: ...
|
292 |
+
|
293 |
+
# This form covers type=non-Type: e.g. forward references (str), Any
|
294 |
+
@overload
|
295 |
+
def field(
|
296 |
+
*,
|
297 |
+
default: Optional[_T] = ...,
|
298 |
+
validator: Optional[_ValidatorArgType[_T]] = ...,
|
299 |
+
repr: _ReprArgType = ...,
|
300 |
+
hash: Optional[bool] = ...,
|
301 |
+
init: bool = ...,
|
302 |
+
metadata: Optional[Mapping[Any, Any]] = ...,
|
303 |
+
converter: Optional[_ConverterType] = ...,
|
304 |
+
factory: Optional[Callable[[], _T]] = ...,
|
305 |
+
kw_only: bool = ...,
|
306 |
+
eq: Optional[_EqOrderType] = ...,
|
307 |
+
order: Optional[_EqOrderType] = ...,
|
308 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
309 |
+
alias: Optional[str] = ...,
|
310 |
+
type: Optional[type] = ...,
|
311 |
+
) -> Any: ...
|
312 |
+
@overload
|
313 |
+
@dataclass_transform(order_default=True, field_specifiers=(attrib, field))
|
314 |
+
def attrs(
|
315 |
+
maybe_cls: _C,
|
316 |
+
these: Optional[Dict[str, Any]] = ...,
|
317 |
+
repr_ns: Optional[str] = ...,
|
318 |
+
repr: bool = ...,
|
319 |
+
cmp: Optional[_EqOrderType] = ...,
|
320 |
+
hash: Optional[bool] = ...,
|
321 |
+
init: bool = ...,
|
322 |
+
slots: bool = ...,
|
323 |
+
frozen: bool = ...,
|
324 |
+
weakref_slot: bool = ...,
|
325 |
+
str: bool = ...,
|
326 |
+
auto_attribs: bool = ...,
|
327 |
+
kw_only: bool = ...,
|
328 |
+
cache_hash: bool = ...,
|
329 |
+
auto_exc: bool = ...,
|
330 |
+
eq: Optional[_EqOrderType] = ...,
|
331 |
+
order: Optional[_EqOrderType] = ...,
|
332 |
+
auto_detect: bool = ...,
|
333 |
+
collect_by_mro: bool = ...,
|
334 |
+
getstate_setstate: Optional[bool] = ...,
|
335 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
336 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
337 |
+
match_args: bool = ...,
|
338 |
+
unsafe_hash: Optional[bool] = ...,
|
339 |
+
) -> _C: ...
|
340 |
+
@overload
|
341 |
+
@dataclass_transform(order_default=True, field_specifiers=(attrib, field))
|
342 |
+
def attrs(
|
343 |
+
maybe_cls: None = ...,
|
344 |
+
these: Optional[Dict[str, Any]] = ...,
|
345 |
+
repr_ns: Optional[str] = ...,
|
346 |
+
repr: bool = ...,
|
347 |
+
cmp: Optional[_EqOrderType] = ...,
|
348 |
+
hash: Optional[bool] = ...,
|
349 |
+
init: bool = ...,
|
350 |
+
slots: bool = ...,
|
351 |
+
frozen: bool = ...,
|
352 |
+
weakref_slot: bool = ...,
|
353 |
+
str: bool = ...,
|
354 |
+
auto_attribs: bool = ...,
|
355 |
+
kw_only: bool = ...,
|
356 |
+
cache_hash: bool = ...,
|
357 |
+
auto_exc: bool = ...,
|
358 |
+
eq: Optional[_EqOrderType] = ...,
|
359 |
+
order: Optional[_EqOrderType] = ...,
|
360 |
+
auto_detect: bool = ...,
|
361 |
+
collect_by_mro: bool = ...,
|
362 |
+
getstate_setstate: Optional[bool] = ...,
|
363 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
364 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
365 |
+
match_args: bool = ...,
|
366 |
+
unsafe_hash: Optional[bool] = ...,
|
367 |
+
) -> Callable[[_C], _C]: ...
|
368 |
+
@overload
|
369 |
+
@dataclass_transform(field_specifiers=(attrib, field))
|
370 |
+
def define(
|
371 |
+
maybe_cls: _C,
|
372 |
+
*,
|
373 |
+
these: Optional[Dict[str, Any]] = ...,
|
374 |
+
repr: bool = ...,
|
375 |
+
unsafe_hash: Optional[bool] = ...,
|
376 |
+
hash: Optional[bool] = ...,
|
377 |
+
init: bool = ...,
|
378 |
+
slots: bool = ...,
|
379 |
+
frozen: bool = ...,
|
380 |
+
weakref_slot: bool = ...,
|
381 |
+
str: bool = ...,
|
382 |
+
auto_attribs: bool = ...,
|
383 |
+
kw_only: bool = ...,
|
384 |
+
cache_hash: bool = ...,
|
385 |
+
auto_exc: bool = ...,
|
386 |
+
eq: Optional[bool] = ...,
|
387 |
+
order: Optional[bool] = ...,
|
388 |
+
auto_detect: bool = ...,
|
389 |
+
getstate_setstate: Optional[bool] = ...,
|
390 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
391 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
392 |
+
match_args: bool = ...,
|
393 |
+
) -> _C: ...
|
394 |
+
@overload
|
395 |
+
@dataclass_transform(field_specifiers=(attrib, field))
|
396 |
+
def define(
|
397 |
+
maybe_cls: None = ...,
|
398 |
+
*,
|
399 |
+
these: Optional[Dict[str, Any]] = ...,
|
400 |
+
repr: bool = ...,
|
401 |
+
unsafe_hash: Optional[bool] = ...,
|
402 |
+
hash: Optional[bool] = ...,
|
403 |
+
init: bool = ...,
|
404 |
+
slots: bool = ...,
|
405 |
+
frozen: bool = ...,
|
406 |
+
weakref_slot: bool = ...,
|
407 |
+
str: bool = ...,
|
408 |
+
auto_attribs: bool = ...,
|
409 |
+
kw_only: bool = ...,
|
410 |
+
cache_hash: bool = ...,
|
411 |
+
auto_exc: bool = ...,
|
412 |
+
eq: Optional[bool] = ...,
|
413 |
+
order: Optional[bool] = ...,
|
414 |
+
auto_detect: bool = ...,
|
415 |
+
getstate_setstate: Optional[bool] = ...,
|
416 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
417 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
418 |
+
match_args: bool = ...,
|
419 |
+
) -> Callable[[_C], _C]: ...
|
420 |
+
|
421 |
+
mutable = define
|
422 |
+
|
423 |
+
@overload
|
424 |
+
@dataclass_transform(frozen_default=True, field_specifiers=(attrib, field))
|
425 |
+
def frozen(
|
426 |
+
maybe_cls: _C,
|
427 |
+
*,
|
428 |
+
these: Optional[Dict[str, Any]] = ...,
|
429 |
+
repr: bool = ...,
|
430 |
+
unsafe_hash: Optional[bool] = ...,
|
431 |
+
hash: Optional[bool] = ...,
|
432 |
+
init: bool = ...,
|
433 |
+
slots: bool = ...,
|
434 |
+
frozen: bool = ...,
|
435 |
+
weakref_slot: bool = ...,
|
436 |
+
str: bool = ...,
|
437 |
+
auto_attribs: bool = ...,
|
438 |
+
kw_only: bool = ...,
|
439 |
+
cache_hash: bool = ...,
|
440 |
+
auto_exc: bool = ...,
|
441 |
+
eq: Optional[bool] = ...,
|
442 |
+
order: Optional[bool] = ...,
|
443 |
+
auto_detect: bool = ...,
|
444 |
+
getstate_setstate: Optional[bool] = ...,
|
445 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
446 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
447 |
+
match_args: bool = ...,
|
448 |
+
) -> _C: ...
|
449 |
+
@overload
|
450 |
+
@dataclass_transform(frozen_default=True, field_specifiers=(attrib, field))
|
451 |
+
def frozen(
|
452 |
+
maybe_cls: None = ...,
|
453 |
+
*,
|
454 |
+
these: Optional[Dict[str, Any]] = ...,
|
455 |
+
repr: bool = ...,
|
456 |
+
unsafe_hash: Optional[bool] = ...,
|
457 |
+
hash: Optional[bool] = ...,
|
458 |
+
init: bool = ...,
|
459 |
+
slots: bool = ...,
|
460 |
+
frozen: bool = ...,
|
461 |
+
weakref_slot: bool = ...,
|
462 |
+
str: bool = ...,
|
463 |
+
auto_attribs: bool = ...,
|
464 |
+
kw_only: bool = ...,
|
465 |
+
cache_hash: bool = ...,
|
466 |
+
auto_exc: bool = ...,
|
467 |
+
eq: Optional[bool] = ...,
|
468 |
+
order: Optional[bool] = ...,
|
469 |
+
auto_detect: bool = ...,
|
470 |
+
getstate_setstate: Optional[bool] = ...,
|
471 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
472 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
473 |
+
match_args: bool = ...,
|
474 |
+
) -> Callable[[_C], _C]: ...
|
475 |
+
def fields(cls: Type[AttrsInstance]) -> Any: ...
|
476 |
+
def fields_dict(cls: Type[AttrsInstance]) -> Dict[str, Attribute[Any]]: ...
|
477 |
+
def validate(inst: AttrsInstance) -> None: ...
|
478 |
+
def resolve_types(
|
479 |
+
cls: _A,
|
480 |
+
globalns: Optional[Dict[str, Any]] = ...,
|
481 |
+
localns: Optional[Dict[str, Any]] = ...,
|
482 |
+
attribs: Optional[List[Attribute[Any]]] = ...,
|
483 |
+
include_extras: bool = ...,
|
484 |
+
) -> _A: ...
|
485 |
+
|
486 |
+
# TODO: add support for returning a proper attrs class from the mypy plugin
|
487 |
+
# we use Any instead of _CountingAttr so that e.g. `make_class('Foo',
|
488 |
+
# [attr.ib()])` is valid
|
489 |
+
def make_class(
|
490 |
+
name: str,
|
491 |
+
attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]],
|
492 |
+
bases: Tuple[type, ...] = ...,
|
493 |
+
class_body: Optional[Dict[str, Any]] = ...,
|
494 |
+
repr_ns: Optional[str] = ...,
|
495 |
+
repr: bool = ...,
|
496 |
+
cmp: Optional[_EqOrderType] = ...,
|
497 |
+
hash: Optional[bool] = ...,
|
498 |
+
init: bool = ...,
|
499 |
+
slots: bool = ...,
|
500 |
+
frozen: bool = ...,
|
501 |
+
weakref_slot: bool = ...,
|
502 |
+
str: bool = ...,
|
503 |
+
auto_attribs: bool = ...,
|
504 |
+
kw_only: bool = ...,
|
505 |
+
cache_hash: bool = ...,
|
506 |
+
auto_exc: bool = ...,
|
507 |
+
eq: Optional[_EqOrderType] = ...,
|
508 |
+
order: Optional[_EqOrderType] = ...,
|
509 |
+
collect_by_mro: bool = ...,
|
510 |
+
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
511 |
+
field_transformer: Optional[_FieldTransformer] = ...,
|
512 |
+
) -> type: ...
|
513 |
+
|
514 |
+
# _funcs --
|
515 |
+
|
516 |
+
# TODO: add support for returning TypedDict from the mypy plugin
|
517 |
+
# FIXME: asdict/astuple do not honor their factory args. Waiting on one of
|
518 |
+
# these:
|
519 |
+
# https://github.com/python/mypy/issues/4236
|
520 |
+
# https://github.com/python/typing/issues/253
|
521 |
+
# XXX: remember to fix attrs.asdict/astuple too!
|
522 |
+
def asdict(
|
523 |
+
inst: AttrsInstance,
|
524 |
+
recurse: bool = ...,
|
525 |
+
filter: Optional[_FilterType[Any]] = ...,
|
526 |
+
dict_factory: Type[Mapping[Any, Any]] = ...,
|
527 |
+
retain_collection_types: bool = ...,
|
528 |
+
value_serializer: Optional[
|
529 |
+
Callable[[type, Attribute[Any], Any], Any]
|
530 |
+
] = ...,
|
531 |
+
tuple_keys: Optional[bool] = ...,
|
532 |
+
) -> Dict[str, Any]: ...
|
533 |
+
|
534 |
+
# TODO: add support for returning NamedTuple from the mypy plugin
|
535 |
+
def astuple(
|
536 |
+
inst: AttrsInstance,
|
537 |
+
recurse: bool = ...,
|
538 |
+
filter: Optional[_FilterType[Any]] = ...,
|
539 |
+
tuple_factory: Type[Sequence[Any]] = ...,
|
540 |
+
retain_collection_types: bool = ...,
|
541 |
+
) -> Tuple[Any, ...]: ...
|
542 |
+
def has(cls: type) -> TypeGuard[Type[AttrsInstance]]: ...
|
543 |
+
def assoc(inst: _T, **changes: Any) -> _T: ...
|
544 |
+
def evolve(inst: _T, **changes: Any) -> _T: ...
|
545 |
+
|
546 |
+
# _config --
|
547 |
+
|
548 |
+
def set_run_validators(run: bool) -> None: ...
|
549 |
+
def get_run_validators() -> bool: ...
|
550 |
+
|
551 |
+
# aliases --
|
552 |
+
|
553 |
+
s = attributes = attrs
|
554 |
+
ib = attr = attrib
|
555 |
+
dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;)
|
venv/lib/python3.10/site-packages/attr/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (3.01 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_cmp.cpython-310.pyc
ADDED
Binary file (3.93 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_compat.cpython-310.pyc
ADDED
Binary file (2.2 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_config.cpython-310.pyc
ADDED
Binary file (1 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_funcs.cpython-310.pyc
ADDED
Binary file (11.8 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_make.cpython-310.pyc
ADDED
Binary file (75.3 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_next_gen.cpython-310.pyc
ADDED
Binary file (5.42 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/_version_info.cpython-310.pyc
ADDED
Binary file (2.32 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/converters.cpython-310.pyc
ADDED
Binary file (3.55 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/exceptions.cpython-310.pyc
ADDED
Binary file (3.16 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/filters.cpython-310.pyc
ADDED
Binary file (1.92 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/setters.cpython-310.pyc
ADDED
Binary file (1.51 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/__pycache__/validators.cpython-310.pyc
ADDED
Binary file (19.7 kB). View file
|
|
venv/lib/python3.10/site-packages/attr/_cmp.py
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
|
4 |
+
import functools
|
5 |
+
import types
|
6 |
+
|
7 |
+
from ._make import _make_ne
|
8 |
+
|
9 |
+
|
10 |
+
_operation_names = {"eq": "==", "lt": "<", "le": "<=", "gt": ">", "ge": ">="}
|
11 |
+
|
12 |
+
|
13 |
+
def cmp_using(
|
14 |
+
eq=None,
|
15 |
+
lt=None,
|
16 |
+
le=None,
|
17 |
+
gt=None,
|
18 |
+
ge=None,
|
19 |
+
require_same_type=True,
|
20 |
+
class_name="Comparable",
|
21 |
+
):
|
22 |
+
"""
|
23 |
+
Create a class that can be passed into `attrs.field`'s ``eq``, ``order``,
|
24 |
+
and ``cmp`` arguments to customize field comparison.
|
25 |
+
|
26 |
+
The resulting class will have a full set of ordering methods if at least
|
27 |
+
one of ``{lt, le, gt, ge}`` and ``eq`` are provided.
|
28 |
+
|
29 |
+
:param Optional[callable] eq: `callable` used to evaluate equality of two
|
30 |
+
objects.
|
31 |
+
:param Optional[callable] lt: `callable` used to evaluate whether one
|
32 |
+
object is less than another object.
|
33 |
+
:param Optional[callable] le: `callable` used to evaluate whether one
|
34 |
+
object is less than or equal to another object.
|
35 |
+
:param Optional[callable] gt: `callable` used to evaluate whether one
|
36 |
+
object is greater than another object.
|
37 |
+
:param Optional[callable] ge: `callable` used to evaluate whether one
|
38 |
+
object is greater than or equal to another object.
|
39 |
+
|
40 |
+
:param bool require_same_type: When `True`, equality and ordering methods
|
41 |
+
will return `NotImplemented` if objects are not of the same type.
|
42 |
+
|
43 |
+
:param Optional[str] class_name: Name of class. Defaults to 'Comparable'.
|
44 |
+
|
45 |
+
See `comparison` for more details.
|
46 |
+
|
47 |
+
.. versionadded:: 21.1.0
|
48 |
+
"""
|
49 |
+
|
50 |
+
body = {
|
51 |
+
"__slots__": ["value"],
|
52 |
+
"__init__": _make_init(),
|
53 |
+
"_requirements": [],
|
54 |
+
"_is_comparable_to": _is_comparable_to,
|
55 |
+
}
|
56 |
+
|
57 |
+
# Add operations.
|
58 |
+
num_order_functions = 0
|
59 |
+
has_eq_function = False
|
60 |
+
|
61 |
+
if eq is not None:
|
62 |
+
has_eq_function = True
|
63 |
+
body["__eq__"] = _make_operator("eq", eq)
|
64 |
+
body["__ne__"] = _make_ne()
|
65 |
+
|
66 |
+
if lt is not None:
|
67 |
+
num_order_functions += 1
|
68 |
+
body["__lt__"] = _make_operator("lt", lt)
|
69 |
+
|
70 |
+
if le is not None:
|
71 |
+
num_order_functions += 1
|
72 |
+
body["__le__"] = _make_operator("le", le)
|
73 |
+
|
74 |
+
if gt is not None:
|
75 |
+
num_order_functions += 1
|
76 |
+
body["__gt__"] = _make_operator("gt", gt)
|
77 |
+
|
78 |
+
if ge is not None:
|
79 |
+
num_order_functions += 1
|
80 |
+
body["__ge__"] = _make_operator("ge", ge)
|
81 |
+
|
82 |
+
type_ = types.new_class(
|
83 |
+
class_name, (object,), {}, lambda ns: ns.update(body)
|
84 |
+
)
|
85 |
+
|
86 |
+
# Add same type requirement.
|
87 |
+
if require_same_type:
|
88 |
+
type_._requirements.append(_check_same_type)
|
89 |
+
|
90 |
+
# Add total ordering if at least one operation was defined.
|
91 |
+
if 0 < num_order_functions < 4:
|
92 |
+
if not has_eq_function:
|
93 |
+
# functools.total_ordering requires __eq__ to be defined,
|
94 |
+
# so raise early error here to keep a nice stack.
|
95 |
+
msg = "eq must be define is order to complete ordering from lt, le, gt, ge."
|
96 |
+
raise ValueError(msg)
|
97 |
+
type_ = functools.total_ordering(type_)
|
98 |
+
|
99 |
+
return type_
|
100 |
+
|
101 |
+
|
102 |
+
def _make_init():
|
103 |
+
"""
|
104 |
+
Create __init__ method.
|
105 |
+
"""
|
106 |
+
|
107 |
+
def __init__(self, value):
|
108 |
+
"""
|
109 |
+
Initialize object with *value*.
|
110 |
+
"""
|
111 |
+
self.value = value
|
112 |
+
|
113 |
+
return __init__
|
114 |
+
|
115 |
+
|
116 |
+
def _make_operator(name, func):
|
117 |
+
"""
|
118 |
+
Create operator method.
|
119 |
+
"""
|
120 |
+
|
121 |
+
def method(self, other):
|
122 |
+
if not self._is_comparable_to(other):
|
123 |
+
return NotImplemented
|
124 |
+
|
125 |
+
result = func(self.value, other.value)
|
126 |
+
if result is NotImplemented:
|
127 |
+
return NotImplemented
|
128 |
+
|
129 |
+
return result
|
130 |
+
|
131 |
+
method.__name__ = f"__{name}__"
|
132 |
+
method.__doc__ = (
|
133 |
+
f"Return a {_operation_names[name]} b. Computed by attrs."
|
134 |
+
)
|
135 |
+
|
136 |
+
return method
|
137 |
+
|
138 |
+
|
139 |
+
def _is_comparable_to(self, other):
|
140 |
+
"""
|
141 |
+
Check whether `other` is comparable to `self`.
|
142 |
+
"""
|
143 |
+
return all(func(self, other) for func in self._requirements)
|
144 |
+
|
145 |
+
|
146 |
+
def _check_same_type(self, other):
|
147 |
+
"""
|
148 |
+
Return True if *self* and *other* are of the same type, False otherwise.
|
149 |
+
"""
|
150 |
+
return other.value.__class__ is self.value.__class__
|
venv/lib/python3.10/site-packages/attr/_cmp.pyi
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Any, Callable, Optional, Type
|
2 |
+
|
3 |
+
_CompareWithType = Callable[[Any, Any], bool]
|
4 |
+
|
5 |
+
def cmp_using(
|
6 |
+
eq: Optional[_CompareWithType] = ...,
|
7 |
+
lt: Optional[_CompareWithType] = ...,
|
8 |
+
le: Optional[_CompareWithType] = ...,
|
9 |
+
gt: Optional[_CompareWithType] = ...,
|
10 |
+
ge: Optional[_CompareWithType] = ...,
|
11 |
+
require_same_type: bool = ...,
|
12 |
+
class_name: str = ...,
|
13 |
+
) -> Type: ...
|
venv/lib/python3.10/site-packages/attr/_compat.py
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
import inspect
|
4 |
+
import platform
|
5 |
+
import sys
|
6 |
+
import threading
|
7 |
+
|
8 |
+
from collections.abc import Mapping, Sequence # noqa: F401
|
9 |
+
from typing import _GenericAlias
|
10 |
+
|
11 |
+
|
12 |
+
PYPY = platform.python_implementation() == "PyPy"
|
13 |
+
PY_3_8_PLUS = sys.version_info[:2] >= (3, 8)
|
14 |
+
PY_3_9_PLUS = sys.version_info[:2] >= (3, 9)
|
15 |
+
PY310 = sys.version_info[:2] >= (3, 10)
|
16 |
+
PY_3_12_PLUS = sys.version_info[:2] >= (3, 12)
|
17 |
+
|
18 |
+
|
19 |
+
if sys.version_info < (3, 8):
|
20 |
+
try:
|
21 |
+
from typing_extensions import Protocol
|
22 |
+
except ImportError: # pragma: no cover
|
23 |
+
Protocol = object
|
24 |
+
else:
|
25 |
+
from typing import Protocol # noqa: F401
|
26 |
+
|
27 |
+
|
28 |
+
class _AnnotationExtractor:
|
29 |
+
"""
|
30 |
+
Extract type annotations from a callable, returning None whenever there
|
31 |
+
is none.
|
32 |
+
"""
|
33 |
+
|
34 |
+
__slots__ = ["sig"]
|
35 |
+
|
36 |
+
def __init__(self, callable):
|
37 |
+
try:
|
38 |
+
self.sig = inspect.signature(callable)
|
39 |
+
except (ValueError, TypeError): # inspect failed
|
40 |
+
self.sig = None
|
41 |
+
|
42 |
+
def get_first_param_type(self):
|
43 |
+
"""
|
44 |
+
Return the type annotation of the first argument if it's not empty.
|
45 |
+
"""
|
46 |
+
if not self.sig:
|
47 |
+
return None
|
48 |
+
|
49 |
+
params = list(self.sig.parameters.values())
|
50 |
+
if params and params[0].annotation is not inspect.Parameter.empty:
|
51 |
+
return params[0].annotation
|
52 |
+
|
53 |
+
return None
|
54 |
+
|
55 |
+
def get_return_type(self):
|
56 |
+
"""
|
57 |
+
Return the return type if it's not empty.
|
58 |
+
"""
|
59 |
+
if (
|
60 |
+
self.sig
|
61 |
+
and self.sig.return_annotation is not inspect.Signature.empty
|
62 |
+
):
|
63 |
+
return self.sig.return_annotation
|
64 |
+
|
65 |
+
return None
|
66 |
+
|
67 |
+
|
68 |
+
# Thread-local global to track attrs instances which are already being repr'd.
|
69 |
+
# This is needed because there is no other (thread-safe) way to pass info
|
70 |
+
# about the instances that are already being repr'd through the call stack
|
71 |
+
# in order to ensure we don't perform infinite recursion.
|
72 |
+
#
|
73 |
+
# For instance, if an instance contains a dict which contains that instance,
|
74 |
+
# we need to know that we're already repr'ing the outside instance from within
|
75 |
+
# the dict's repr() call.
|
76 |
+
#
|
77 |
+
# This lives here rather than in _make.py so that the functions in _make.py
|
78 |
+
# don't have a direct reference to the thread-local in their globals dict.
|
79 |
+
# If they have such a reference, it breaks cloudpickle.
|
80 |
+
repr_context = threading.local()
|
81 |
+
|
82 |
+
|
83 |
+
def get_generic_base(cl):
|
84 |
+
"""If this is a generic class (A[str]), return the generic base for it."""
|
85 |
+
if cl.__class__ is _GenericAlias:
|
86 |
+
return cl.__origin__
|
87 |
+
return None
|
venv/lib/python3.10/site-packages/attr/_config.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
__all__ = ["set_run_validators", "get_run_validators"]
|
4 |
+
|
5 |
+
_run_validators = True
|
6 |
+
|
7 |
+
|
8 |
+
def set_run_validators(run):
|
9 |
+
"""
|
10 |
+
Set whether or not validators are run. By default, they are run.
|
11 |
+
|
12 |
+
.. deprecated:: 21.3.0 It will not be removed, but it also will not be
|
13 |
+
moved to new ``attrs`` namespace. Use `attrs.validators.set_disabled()`
|
14 |
+
instead.
|
15 |
+
"""
|
16 |
+
if not isinstance(run, bool):
|
17 |
+
msg = "'run' must be bool."
|
18 |
+
raise TypeError(msg)
|
19 |
+
global _run_validators
|
20 |
+
_run_validators = run
|
21 |
+
|
22 |
+
|
23 |
+
def get_run_validators():
|
24 |
+
"""
|
25 |
+
Return whether or not validators are run.
|
26 |
+
|
27 |
+
.. deprecated:: 21.3.0 It will not be removed, but it also will not be
|
28 |
+
moved to new ``attrs`` namespace. Use `attrs.validators.get_disabled()`
|
29 |
+
instead.
|
30 |
+
"""
|
31 |
+
return _run_validators
|
venv/lib/python3.10/site-packages/attr/_funcs.py
ADDED
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
|
4 |
+
import copy
|
5 |
+
|
6 |
+
from ._compat import PY_3_9_PLUS, get_generic_base
|
7 |
+
from ._make import NOTHING, _obj_setattr, fields
|
8 |
+
from .exceptions import AttrsAttributeNotFoundError
|
9 |
+
|
10 |
+
|
11 |
+
def asdict(
|
12 |
+
inst,
|
13 |
+
recurse=True,
|
14 |
+
filter=None,
|
15 |
+
dict_factory=dict,
|
16 |
+
retain_collection_types=False,
|
17 |
+
value_serializer=None,
|
18 |
+
):
|
19 |
+
"""
|
20 |
+
Return the *attrs* attribute values of *inst* as a dict.
|
21 |
+
|
22 |
+
Optionally recurse into other *attrs*-decorated classes.
|
23 |
+
|
24 |
+
:param inst: Instance of an *attrs*-decorated class.
|
25 |
+
:param bool recurse: Recurse into classes that are also
|
26 |
+
*attrs*-decorated.
|
27 |
+
:param callable filter: A callable whose return code determines whether an
|
28 |
+
attribute or element is included (``True``) or dropped (``False``). Is
|
29 |
+
called with the `attrs.Attribute` as the first argument and the
|
30 |
+
value as the second argument.
|
31 |
+
:param callable dict_factory: A callable to produce dictionaries from. For
|
32 |
+
example, to produce ordered dictionaries instead of normal Python
|
33 |
+
dictionaries, pass in ``collections.OrderedDict``.
|
34 |
+
:param bool retain_collection_types: Do not convert to ``list`` when
|
35 |
+
encountering an attribute whose type is ``tuple`` or ``set``. Only
|
36 |
+
meaningful if ``recurse`` is ``True``.
|
37 |
+
:param Optional[callable] value_serializer: A hook that is called for every
|
38 |
+
attribute or dict key/value. It receives the current instance, field
|
39 |
+
and value and must return the (updated) value. The hook is run *after*
|
40 |
+
the optional *filter* has been applied.
|
41 |
+
|
42 |
+
:rtype: return type of *dict_factory*
|
43 |
+
|
44 |
+
:raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
|
45 |
+
class.
|
46 |
+
|
47 |
+
.. versionadded:: 16.0.0 *dict_factory*
|
48 |
+
.. versionadded:: 16.1.0 *retain_collection_types*
|
49 |
+
.. versionadded:: 20.3.0 *value_serializer*
|
50 |
+
.. versionadded:: 21.3.0 If a dict has a collection for a key, it is
|
51 |
+
serialized as a tuple.
|
52 |
+
"""
|
53 |
+
attrs = fields(inst.__class__)
|
54 |
+
rv = dict_factory()
|
55 |
+
for a in attrs:
|
56 |
+
v = getattr(inst, a.name)
|
57 |
+
if filter is not None and not filter(a, v):
|
58 |
+
continue
|
59 |
+
|
60 |
+
if value_serializer is not None:
|
61 |
+
v = value_serializer(inst, a, v)
|
62 |
+
|
63 |
+
if recurse is True:
|
64 |
+
if has(v.__class__):
|
65 |
+
rv[a.name] = asdict(
|
66 |
+
v,
|
67 |
+
recurse=True,
|
68 |
+
filter=filter,
|
69 |
+
dict_factory=dict_factory,
|
70 |
+
retain_collection_types=retain_collection_types,
|
71 |
+
value_serializer=value_serializer,
|
72 |
+
)
|
73 |
+
elif isinstance(v, (tuple, list, set, frozenset)):
|
74 |
+
cf = v.__class__ if retain_collection_types is True else list
|
75 |
+
items = [
|
76 |
+
_asdict_anything(
|
77 |
+
i,
|
78 |
+
is_key=False,
|
79 |
+
filter=filter,
|
80 |
+
dict_factory=dict_factory,
|
81 |
+
retain_collection_types=retain_collection_types,
|
82 |
+
value_serializer=value_serializer,
|
83 |
+
)
|
84 |
+
for i in v
|
85 |
+
]
|
86 |
+
try:
|
87 |
+
rv[a.name] = cf(items)
|
88 |
+
except TypeError:
|
89 |
+
if not issubclass(cf, tuple):
|
90 |
+
raise
|
91 |
+
# Workaround for TypeError: cf.__new__() missing 1 required
|
92 |
+
# positional argument (which appears, for a namedturle)
|
93 |
+
rv[a.name] = cf(*items)
|
94 |
+
elif isinstance(v, dict):
|
95 |
+
df = dict_factory
|
96 |
+
rv[a.name] = df(
|
97 |
+
(
|
98 |
+
_asdict_anything(
|
99 |
+
kk,
|
100 |
+
is_key=True,
|
101 |
+
filter=filter,
|
102 |
+
dict_factory=df,
|
103 |
+
retain_collection_types=retain_collection_types,
|
104 |
+
value_serializer=value_serializer,
|
105 |
+
),
|
106 |
+
_asdict_anything(
|
107 |
+
vv,
|
108 |
+
is_key=False,
|
109 |
+
filter=filter,
|
110 |
+
dict_factory=df,
|
111 |
+
retain_collection_types=retain_collection_types,
|
112 |
+
value_serializer=value_serializer,
|
113 |
+
),
|
114 |
+
)
|
115 |
+
for kk, vv in v.items()
|
116 |
+
)
|
117 |
+
else:
|
118 |
+
rv[a.name] = v
|
119 |
+
else:
|
120 |
+
rv[a.name] = v
|
121 |
+
return rv
|
122 |
+
|
123 |
+
|
124 |
+
def _asdict_anything(
|
125 |
+
val,
|
126 |
+
is_key,
|
127 |
+
filter,
|
128 |
+
dict_factory,
|
129 |
+
retain_collection_types,
|
130 |
+
value_serializer,
|
131 |
+
):
|
132 |
+
"""
|
133 |
+
``asdict`` only works on attrs instances, this works on anything.
|
134 |
+
"""
|
135 |
+
if getattr(val.__class__, "__attrs_attrs__", None) is not None:
|
136 |
+
# Attrs class.
|
137 |
+
rv = asdict(
|
138 |
+
val,
|
139 |
+
recurse=True,
|
140 |
+
filter=filter,
|
141 |
+
dict_factory=dict_factory,
|
142 |
+
retain_collection_types=retain_collection_types,
|
143 |
+
value_serializer=value_serializer,
|
144 |
+
)
|
145 |
+
elif isinstance(val, (tuple, list, set, frozenset)):
|
146 |
+
if retain_collection_types is True:
|
147 |
+
cf = val.__class__
|
148 |
+
elif is_key:
|
149 |
+
cf = tuple
|
150 |
+
else:
|
151 |
+
cf = list
|
152 |
+
|
153 |
+
rv = cf(
|
154 |
+
[
|
155 |
+
_asdict_anything(
|
156 |
+
i,
|
157 |
+
is_key=False,
|
158 |
+
filter=filter,
|
159 |
+
dict_factory=dict_factory,
|
160 |
+
retain_collection_types=retain_collection_types,
|
161 |
+
value_serializer=value_serializer,
|
162 |
+
)
|
163 |
+
for i in val
|
164 |
+
]
|
165 |
+
)
|
166 |
+
elif isinstance(val, dict):
|
167 |
+
df = dict_factory
|
168 |
+
rv = df(
|
169 |
+
(
|
170 |
+
_asdict_anything(
|
171 |
+
kk,
|
172 |
+
is_key=True,
|
173 |
+
filter=filter,
|
174 |
+
dict_factory=df,
|
175 |
+
retain_collection_types=retain_collection_types,
|
176 |
+
value_serializer=value_serializer,
|
177 |
+
),
|
178 |
+
_asdict_anything(
|
179 |
+
vv,
|
180 |
+
is_key=False,
|
181 |
+
filter=filter,
|
182 |
+
dict_factory=df,
|
183 |
+
retain_collection_types=retain_collection_types,
|
184 |
+
value_serializer=value_serializer,
|
185 |
+
),
|
186 |
+
)
|
187 |
+
for kk, vv in val.items()
|
188 |
+
)
|
189 |
+
else:
|
190 |
+
rv = val
|
191 |
+
if value_serializer is not None:
|
192 |
+
rv = value_serializer(None, None, rv)
|
193 |
+
|
194 |
+
return rv
|
195 |
+
|
196 |
+
|
197 |
+
def astuple(
|
198 |
+
inst,
|
199 |
+
recurse=True,
|
200 |
+
filter=None,
|
201 |
+
tuple_factory=tuple,
|
202 |
+
retain_collection_types=False,
|
203 |
+
):
|
204 |
+
"""
|
205 |
+
Return the *attrs* attribute values of *inst* as a tuple.
|
206 |
+
|
207 |
+
Optionally recurse into other *attrs*-decorated classes.
|
208 |
+
|
209 |
+
:param inst: Instance of an *attrs*-decorated class.
|
210 |
+
:param bool recurse: Recurse into classes that are also
|
211 |
+
*attrs*-decorated.
|
212 |
+
:param callable filter: A callable whose return code determines whether an
|
213 |
+
attribute or element is included (``True``) or dropped (``False``). Is
|
214 |
+
called with the `attrs.Attribute` as the first argument and the
|
215 |
+
value as the second argument.
|
216 |
+
:param callable tuple_factory: A callable to produce tuples from. For
|
217 |
+
example, to produce lists instead of tuples.
|
218 |
+
:param bool retain_collection_types: Do not convert to ``list``
|
219 |
+
or ``dict`` when encountering an attribute which type is
|
220 |
+
``tuple``, ``dict`` or ``set``. Only meaningful if ``recurse`` is
|
221 |
+
``True``.
|
222 |
+
|
223 |
+
:rtype: return type of *tuple_factory*
|
224 |
+
|
225 |
+
:raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
|
226 |
+
class.
|
227 |
+
|
228 |
+
.. versionadded:: 16.2.0
|
229 |
+
"""
|
230 |
+
attrs = fields(inst.__class__)
|
231 |
+
rv = []
|
232 |
+
retain = retain_collection_types # Very long. :/
|
233 |
+
for a in attrs:
|
234 |
+
v = getattr(inst, a.name)
|
235 |
+
if filter is not None and not filter(a, v):
|
236 |
+
continue
|
237 |
+
if recurse is True:
|
238 |
+
if has(v.__class__):
|
239 |
+
rv.append(
|
240 |
+
astuple(
|
241 |
+
v,
|
242 |
+
recurse=True,
|
243 |
+
filter=filter,
|
244 |
+
tuple_factory=tuple_factory,
|
245 |
+
retain_collection_types=retain,
|
246 |
+
)
|
247 |
+
)
|
248 |
+
elif isinstance(v, (tuple, list, set, frozenset)):
|
249 |
+
cf = v.__class__ if retain is True else list
|
250 |
+
items = [
|
251 |
+
astuple(
|
252 |
+
j,
|
253 |
+
recurse=True,
|
254 |
+
filter=filter,
|
255 |
+
tuple_factory=tuple_factory,
|
256 |
+
retain_collection_types=retain,
|
257 |
+
)
|
258 |
+
if has(j.__class__)
|
259 |
+
else j
|
260 |
+
for j in v
|
261 |
+
]
|
262 |
+
try:
|
263 |
+
rv.append(cf(items))
|
264 |
+
except TypeError:
|
265 |
+
if not issubclass(cf, tuple):
|
266 |
+
raise
|
267 |
+
# Workaround for TypeError: cf.__new__() missing 1 required
|
268 |
+
# positional argument (which appears, for a namedturle)
|
269 |
+
rv.append(cf(*items))
|
270 |
+
elif isinstance(v, dict):
|
271 |
+
df = v.__class__ if retain is True else dict
|
272 |
+
rv.append(
|
273 |
+
df(
|
274 |
+
(
|
275 |
+
astuple(
|
276 |
+
kk,
|
277 |
+
tuple_factory=tuple_factory,
|
278 |
+
retain_collection_types=retain,
|
279 |
+
)
|
280 |
+
if has(kk.__class__)
|
281 |
+
else kk,
|
282 |
+
astuple(
|
283 |
+
vv,
|
284 |
+
tuple_factory=tuple_factory,
|
285 |
+
retain_collection_types=retain,
|
286 |
+
)
|
287 |
+
if has(vv.__class__)
|
288 |
+
else vv,
|
289 |
+
)
|
290 |
+
for kk, vv in v.items()
|
291 |
+
)
|
292 |
+
)
|
293 |
+
else:
|
294 |
+
rv.append(v)
|
295 |
+
else:
|
296 |
+
rv.append(v)
|
297 |
+
|
298 |
+
return rv if tuple_factory is list else tuple_factory(rv)
|
299 |
+
|
300 |
+
|
301 |
+
def has(cls):
|
302 |
+
"""
|
303 |
+
Check whether *cls* is a class with *attrs* attributes.
|
304 |
+
|
305 |
+
:param type cls: Class to introspect.
|
306 |
+
:raise TypeError: If *cls* is not a class.
|
307 |
+
|
308 |
+
:rtype: bool
|
309 |
+
"""
|
310 |
+
attrs = getattr(cls, "__attrs_attrs__", None)
|
311 |
+
if attrs is not None:
|
312 |
+
return True
|
313 |
+
|
314 |
+
# No attrs, maybe it's a specialized generic (A[str])?
|
315 |
+
generic_base = get_generic_base(cls)
|
316 |
+
if generic_base is not None:
|
317 |
+
generic_attrs = getattr(generic_base, "__attrs_attrs__", None)
|
318 |
+
if generic_attrs is not None:
|
319 |
+
# Stick it on here for speed next time.
|
320 |
+
cls.__attrs_attrs__ = generic_attrs
|
321 |
+
return generic_attrs is not None
|
322 |
+
return False
|
323 |
+
|
324 |
+
|
325 |
+
def assoc(inst, **changes):
|
326 |
+
"""
|
327 |
+
Copy *inst* and apply *changes*.
|
328 |
+
|
329 |
+
This is different from `evolve` that applies the changes to the arguments
|
330 |
+
that create the new instance.
|
331 |
+
|
332 |
+
`evolve`'s behavior is preferable, but there are `edge cases`_ where it
|
333 |
+
doesn't work. Therefore `assoc` is deprecated, but will not be removed.
|
334 |
+
|
335 |
+
.. _`edge cases`: https://github.com/python-attrs/attrs/issues/251
|
336 |
+
|
337 |
+
:param inst: Instance of a class with *attrs* attributes.
|
338 |
+
:param changes: Keyword changes in the new copy.
|
339 |
+
|
340 |
+
:return: A copy of inst with *changes* incorporated.
|
341 |
+
|
342 |
+
:raise attrs.exceptions.AttrsAttributeNotFoundError: If *attr_name*
|
343 |
+
couldn't be found on *cls*.
|
344 |
+
:raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
|
345 |
+
class.
|
346 |
+
|
347 |
+
.. deprecated:: 17.1.0
|
348 |
+
Use `attrs.evolve` instead if you can.
|
349 |
+
This function will not be removed du to the slightly different approach
|
350 |
+
compared to `attrs.evolve`.
|
351 |
+
"""
|
352 |
+
new = copy.copy(inst)
|
353 |
+
attrs = fields(inst.__class__)
|
354 |
+
for k, v in changes.items():
|
355 |
+
a = getattr(attrs, k, NOTHING)
|
356 |
+
if a is NOTHING:
|
357 |
+
msg = f"{k} is not an attrs attribute on {new.__class__}."
|
358 |
+
raise AttrsAttributeNotFoundError(msg)
|
359 |
+
_obj_setattr(new, k, v)
|
360 |
+
return new
|
361 |
+
|
362 |
+
|
363 |
+
def evolve(*args, **changes):
|
364 |
+
"""
|
365 |
+
Create a new instance, based on the first positional argument with
|
366 |
+
*changes* applied.
|
367 |
+
|
368 |
+
:param inst: Instance of a class with *attrs* attributes.
|
369 |
+
:param changes: Keyword changes in the new copy.
|
370 |
+
|
371 |
+
:return: A copy of inst with *changes* incorporated.
|
372 |
+
|
373 |
+
:raise TypeError: If *attr_name* couldn't be found in the class
|
374 |
+
``__init__``.
|
375 |
+
:raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
|
376 |
+
class.
|
377 |
+
|
378 |
+
.. versionadded:: 17.1.0
|
379 |
+
.. deprecated:: 23.1.0
|
380 |
+
It is now deprecated to pass the instance using the keyword argument
|
381 |
+
*inst*. It will raise a warning until at least April 2024, after which
|
382 |
+
it will become an error. Always pass the instance as a positional
|
383 |
+
argument.
|
384 |
+
"""
|
385 |
+
# Try to get instance by positional argument first.
|
386 |
+
# Use changes otherwise and warn it'll break.
|
387 |
+
if args:
|
388 |
+
try:
|
389 |
+
(inst,) = args
|
390 |
+
except ValueError:
|
391 |
+
msg = f"evolve() takes 1 positional argument, but {len(args)} were given"
|
392 |
+
raise TypeError(msg) from None
|
393 |
+
else:
|
394 |
+
try:
|
395 |
+
inst = changes.pop("inst")
|
396 |
+
except KeyError:
|
397 |
+
msg = "evolve() missing 1 required positional argument: 'inst'"
|
398 |
+
raise TypeError(msg) from None
|
399 |
+
|
400 |
+
import warnings
|
401 |
+
|
402 |
+
warnings.warn(
|
403 |
+
"Passing the instance per keyword argument is deprecated and "
|
404 |
+
"will stop working in, or after, April 2024.",
|
405 |
+
DeprecationWarning,
|
406 |
+
stacklevel=2,
|
407 |
+
)
|
408 |
+
|
409 |
+
cls = inst.__class__
|
410 |
+
attrs = fields(cls)
|
411 |
+
for a in attrs:
|
412 |
+
if not a.init:
|
413 |
+
continue
|
414 |
+
attr_name = a.name # To deal with private attributes.
|
415 |
+
init_name = a.alias
|
416 |
+
if init_name not in changes:
|
417 |
+
changes[init_name] = getattr(inst, attr_name)
|
418 |
+
|
419 |
+
return cls(**changes)
|
420 |
+
|
421 |
+
|
422 |
+
def resolve_types(
|
423 |
+
cls, globalns=None, localns=None, attribs=None, include_extras=True
|
424 |
+
):
|
425 |
+
"""
|
426 |
+
Resolve any strings and forward annotations in type annotations.
|
427 |
+
|
428 |
+
This is only required if you need concrete types in `Attribute`'s *type*
|
429 |
+
field. In other words, you don't need to resolve your types if you only
|
430 |
+
use them for static type checking.
|
431 |
+
|
432 |
+
With no arguments, names will be looked up in the module in which the class
|
433 |
+
was created. If this is not what you want, e.g. if the name only exists
|
434 |
+
inside a method, you may pass *globalns* or *localns* to specify other
|
435 |
+
dictionaries in which to look up these names. See the docs of
|
436 |
+
`typing.get_type_hints` for more details.
|
437 |
+
|
438 |
+
:param type cls: Class to resolve.
|
439 |
+
:param Optional[dict] globalns: Dictionary containing global variables.
|
440 |
+
:param Optional[dict] localns: Dictionary containing local variables.
|
441 |
+
:param Optional[list] attribs: List of attribs for the given class.
|
442 |
+
This is necessary when calling from inside a ``field_transformer``
|
443 |
+
since *cls* is not an *attrs* class yet.
|
444 |
+
:param bool include_extras: Resolve more accurately, if possible.
|
445 |
+
Pass ``include_extras`` to ``typing.get_hints``, if supported by the
|
446 |
+
typing module. On supported Python versions (3.9+), this resolves the
|
447 |
+
types more accurately.
|
448 |
+
|
449 |
+
:raise TypeError: If *cls* is not a class.
|
450 |
+
:raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
|
451 |
+
class and you didn't pass any attribs.
|
452 |
+
:raise NameError: If types cannot be resolved because of missing variables.
|
453 |
+
|
454 |
+
:returns: *cls* so you can use this function also as a class decorator.
|
455 |
+
Please note that you have to apply it **after** `attrs.define`. That
|
456 |
+
means the decorator has to come in the line **before** `attrs.define`.
|
457 |
+
|
458 |
+
.. versionadded:: 20.1.0
|
459 |
+
.. versionadded:: 21.1.0 *attribs*
|
460 |
+
.. versionadded:: 23.1.0 *include_extras*
|
461 |
+
|
462 |
+
"""
|
463 |
+
# Since calling get_type_hints is expensive we cache whether we've
|
464 |
+
# done it already.
|
465 |
+
if getattr(cls, "__attrs_types_resolved__", None) != cls:
|
466 |
+
import typing
|
467 |
+
|
468 |
+
kwargs = {"globalns": globalns, "localns": localns}
|
469 |
+
|
470 |
+
if PY_3_9_PLUS:
|
471 |
+
kwargs["include_extras"] = include_extras
|
472 |
+
|
473 |
+
hints = typing.get_type_hints(cls, **kwargs)
|
474 |
+
for field in fields(cls) if attribs is None else attribs:
|
475 |
+
if field.name in hints:
|
476 |
+
# Since fields have been frozen we must work around it.
|
477 |
+
_obj_setattr(field, "type", hints[field.name])
|
478 |
+
# We store the class we resolved so that subclasses know they haven't
|
479 |
+
# been resolved.
|
480 |
+
cls.__attrs_types_resolved__ = cls
|
481 |
+
|
482 |
+
# Return the class so you can use it as a decorator too.
|
483 |
+
return cls
|
venv/lib/python3.10/site-packages/attr/_make.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
venv/lib/python3.10/site-packages/attr/_next_gen.py
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
These are keyword-only APIs that call `attr.s` and `attr.ib` with different
|
5 |
+
default values.
|
6 |
+
"""
|
7 |
+
|
8 |
+
|
9 |
+
from functools import partial
|
10 |
+
|
11 |
+
from . import setters
|
12 |
+
from ._funcs import asdict as _asdict
|
13 |
+
from ._funcs import astuple as _astuple
|
14 |
+
from ._make import (
|
15 |
+
NOTHING,
|
16 |
+
_frozen_setattrs,
|
17 |
+
_ng_default_on_setattr,
|
18 |
+
attrib,
|
19 |
+
attrs,
|
20 |
+
)
|
21 |
+
from .exceptions import UnannotatedAttributeError
|
22 |
+
|
23 |
+
|
24 |
+
def define(
|
25 |
+
maybe_cls=None,
|
26 |
+
*,
|
27 |
+
these=None,
|
28 |
+
repr=None,
|
29 |
+
unsafe_hash=None,
|
30 |
+
hash=None,
|
31 |
+
init=None,
|
32 |
+
slots=True,
|
33 |
+
frozen=False,
|
34 |
+
weakref_slot=True,
|
35 |
+
str=False,
|
36 |
+
auto_attribs=None,
|
37 |
+
kw_only=False,
|
38 |
+
cache_hash=False,
|
39 |
+
auto_exc=True,
|
40 |
+
eq=None,
|
41 |
+
order=False,
|
42 |
+
auto_detect=True,
|
43 |
+
getstate_setstate=None,
|
44 |
+
on_setattr=None,
|
45 |
+
field_transformer=None,
|
46 |
+
match_args=True,
|
47 |
+
):
|
48 |
+
r"""
|
49 |
+
Define an *attrs* class.
|
50 |
+
|
51 |
+
Differences to the classic `attr.s` that it uses underneath:
|
52 |
+
|
53 |
+
- Automatically detect whether or not *auto_attribs* should be `True` (c.f.
|
54 |
+
*auto_attribs* parameter).
|
55 |
+
- Converters and validators run when attributes are set by default -- if
|
56 |
+
*frozen* is `False`.
|
57 |
+
- *slots=True*
|
58 |
+
|
59 |
+
.. caution::
|
60 |
+
|
61 |
+
Usually this has only upsides and few visible effects in everyday
|
62 |
+
programming. But it *can* lead to some surprising behaviors, so please
|
63 |
+
make sure to read :term:`slotted classes`.
|
64 |
+
- *auto_exc=True*
|
65 |
+
- *auto_detect=True*
|
66 |
+
- *order=False*
|
67 |
+
- Some options that were only relevant on Python 2 or were kept around for
|
68 |
+
backwards-compatibility have been removed.
|
69 |
+
|
70 |
+
Please note that these are all defaults and you can change them as you
|
71 |
+
wish.
|
72 |
+
|
73 |
+
:param Optional[bool] auto_attribs: If set to `True` or `False`, it behaves
|
74 |
+
exactly like `attr.s`. If left `None`, `attr.s` will try to guess:
|
75 |
+
|
76 |
+
1. If any attributes are annotated and no unannotated `attrs.fields`\ s
|
77 |
+
are found, it assumes *auto_attribs=True*.
|
78 |
+
2. Otherwise it assumes *auto_attribs=False* and tries to collect
|
79 |
+
`attrs.fields`\ s.
|
80 |
+
|
81 |
+
For now, please refer to `attr.s` for the rest of the parameters.
|
82 |
+
|
83 |
+
.. versionadded:: 20.1.0
|
84 |
+
.. versionchanged:: 21.3.0 Converters are also run ``on_setattr``.
|
85 |
+
.. versionadded:: 22.2.0
|
86 |
+
*unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
|
87 |
+
"""
|
88 |
+
|
89 |
+
def do_it(cls, auto_attribs):
|
90 |
+
return attrs(
|
91 |
+
maybe_cls=cls,
|
92 |
+
these=these,
|
93 |
+
repr=repr,
|
94 |
+
hash=hash,
|
95 |
+
unsafe_hash=unsafe_hash,
|
96 |
+
init=init,
|
97 |
+
slots=slots,
|
98 |
+
frozen=frozen,
|
99 |
+
weakref_slot=weakref_slot,
|
100 |
+
str=str,
|
101 |
+
auto_attribs=auto_attribs,
|
102 |
+
kw_only=kw_only,
|
103 |
+
cache_hash=cache_hash,
|
104 |
+
auto_exc=auto_exc,
|
105 |
+
eq=eq,
|
106 |
+
order=order,
|
107 |
+
auto_detect=auto_detect,
|
108 |
+
collect_by_mro=True,
|
109 |
+
getstate_setstate=getstate_setstate,
|
110 |
+
on_setattr=on_setattr,
|
111 |
+
field_transformer=field_transformer,
|
112 |
+
match_args=match_args,
|
113 |
+
)
|
114 |
+
|
115 |
+
def wrap(cls):
|
116 |
+
"""
|
117 |
+
Making this a wrapper ensures this code runs during class creation.
|
118 |
+
|
119 |
+
We also ensure that frozen-ness of classes is inherited.
|
120 |
+
"""
|
121 |
+
nonlocal frozen, on_setattr
|
122 |
+
|
123 |
+
had_on_setattr = on_setattr not in (None, setters.NO_OP)
|
124 |
+
|
125 |
+
# By default, mutable classes convert & validate on setattr.
|
126 |
+
if frozen is False and on_setattr is None:
|
127 |
+
on_setattr = _ng_default_on_setattr
|
128 |
+
|
129 |
+
# However, if we subclass a frozen class, we inherit the immutability
|
130 |
+
# and disable on_setattr.
|
131 |
+
for base_cls in cls.__bases__:
|
132 |
+
if base_cls.__setattr__ is _frozen_setattrs:
|
133 |
+
if had_on_setattr:
|
134 |
+
msg = "Frozen classes can't use on_setattr (frozen-ness was inherited)."
|
135 |
+
raise ValueError(msg)
|
136 |
+
|
137 |
+
on_setattr = setters.NO_OP
|
138 |
+
break
|
139 |
+
|
140 |
+
if auto_attribs is not None:
|
141 |
+
return do_it(cls, auto_attribs)
|
142 |
+
|
143 |
+
try:
|
144 |
+
return do_it(cls, True)
|
145 |
+
except UnannotatedAttributeError:
|
146 |
+
return do_it(cls, False)
|
147 |
+
|
148 |
+
# maybe_cls's type depends on the usage of the decorator. It's a class
|
149 |
+
# if it's used as `@attrs` but ``None`` if used as `@attrs()`.
|
150 |
+
if maybe_cls is None:
|
151 |
+
return wrap
|
152 |
+
|
153 |
+
return wrap(maybe_cls)
|
154 |
+
|
155 |
+
|
156 |
+
mutable = define
|
157 |
+
frozen = partial(define, frozen=True, on_setattr=None)
|
158 |
+
|
159 |
+
|
160 |
+
def field(
|
161 |
+
*,
|
162 |
+
default=NOTHING,
|
163 |
+
validator=None,
|
164 |
+
repr=True,
|
165 |
+
hash=None,
|
166 |
+
init=True,
|
167 |
+
metadata=None,
|
168 |
+
type=None,
|
169 |
+
converter=None,
|
170 |
+
factory=None,
|
171 |
+
kw_only=False,
|
172 |
+
eq=None,
|
173 |
+
order=None,
|
174 |
+
on_setattr=None,
|
175 |
+
alias=None,
|
176 |
+
):
|
177 |
+
"""
|
178 |
+
Identical to `attr.ib`, except keyword-only and with some arguments
|
179 |
+
removed.
|
180 |
+
|
181 |
+
.. versionadded:: 23.1.0
|
182 |
+
The *type* parameter has been re-added; mostly for `attrs.make_class`.
|
183 |
+
Please note that type checkers ignore this metadata.
|
184 |
+
.. versionadded:: 20.1.0
|
185 |
+
"""
|
186 |
+
return attrib(
|
187 |
+
default=default,
|
188 |
+
validator=validator,
|
189 |
+
repr=repr,
|
190 |
+
hash=hash,
|
191 |
+
init=init,
|
192 |
+
metadata=metadata,
|
193 |
+
type=type,
|
194 |
+
converter=converter,
|
195 |
+
factory=factory,
|
196 |
+
kw_only=kw_only,
|
197 |
+
eq=eq,
|
198 |
+
order=order,
|
199 |
+
on_setattr=on_setattr,
|
200 |
+
alias=alias,
|
201 |
+
)
|
202 |
+
|
203 |
+
|
204 |
+
def asdict(inst, *, recurse=True, filter=None, value_serializer=None):
|
205 |
+
"""
|
206 |
+
Same as `attr.asdict`, except that collections types are always retained
|
207 |
+
and dict is always used as *dict_factory*.
|
208 |
+
|
209 |
+
.. versionadded:: 21.3.0
|
210 |
+
"""
|
211 |
+
return _asdict(
|
212 |
+
inst=inst,
|
213 |
+
recurse=recurse,
|
214 |
+
filter=filter,
|
215 |
+
value_serializer=value_serializer,
|
216 |
+
retain_collection_types=True,
|
217 |
+
)
|
218 |
+
|
219 |
+
|
220 |
+
def astuple(inst, *, recurse=True, filter=None):
|
221 |
+
"""
|
222 |
+
Same as `attr.astuple`, except that collections types are always retained
|
223 |
+
and `tuple` is always used as the *tuple_factory*.
|
224 |
+
|
225 |
+
.. versionadded:: 21.3.0
|
226 |
+
"""
|
227 |
+
return _astuple(
|
228 |
+
inst=inst, recurse=recurse, filter=filter, retain_collection_types=True
|
229 |
+
)
|
venv/lib/python3.10/site-packages/attr/_typing_compat.pyi
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Any, ClassVar, Protocol
|
2 |
+
|
3 |
+
# MYPY is a special constant in mypy which works the same way as `TYPE_CHECKING`.
|
4 |
+
MYPY = False
|
5 |
+
|
6 |
+
if MYPY:
|
7 |
+
# A protocol to be able to statically accept an attrs class.
|
8 |
+
class AttrsInstance_(Protocol):
|
9 |
+
__attrs_attrs__: ClassVar[Any]
|
10 |
+
|
11 |
+
else:
|
12 |
+
# For type checkers without plug-in support use an empty protocol that
|
13 |
+
# will (hopefully) be combined into a union.
|
14 |
+
class AttrsInstance_(Protocol):
|
15 |
+
pass
|
venv/lib/python3.10/site-packages/attr/_version_info.py
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
|
4 |
+
from functools import total_ordering
|
5 |
+
|
6 |
+
from ._funcs import astuple
|
7 |
+
from ._make import attrib, attrs
|
8 |
+
|
9 |
+
|
10 |
+
@total_ordering
|
11 |
+
@attrs(eq=False, order=False, slots=True, frozen=True)
|
12 |
+
class VersionInfo:
|
13 |
+
"""
|
14 |
+
A version object that can be compared to tuple of length 1--4:
|
15 |
+
|
16 |
+
>>> attr.VersionInfo(19, 1, 0, "final") <= (19, 2)
|
17 |
+
True
|
18 |
+
>>> attr.VersionInfo(19, 1, 0, "final") < (19, 1, 1)
|
19 |
+
True
|
20 |
+
>>> vi = attr.VersionInfo(19, 2, 0, "final")
|
21 |
+
>>> vi < (19, 1, 1)
|
22 |
+
False
|
23 |
+
>>> vi < (19,)
|
24 |
+
False
|
25 |
+
>>> vi == (19, 2,)
|
26 |
+
True
|
27 |
+
>>> vi == (19, 2, 1)
|
28 |
+
False
|
29 |
+
|
30 |
+
.. versionadded:: 19.2
|
31 |
+
"""
|
32 |
+
|
33 |
+
year = attrib(type=int)
|
34 |
+
minor = attrib(type=int)
|
35 |
+
micro = attrib(type=int)
|
36 |
+
releaselevel = attrib(type=str)
|
37 |
+
|
38 |
+
@classmethod
|
39 |
+
def _from_version_string(cls, s):
|
40 |
+
"""
|
41 |
+
Parse *s* and return a _VersionInfo.
|
42 |
+
"""
|
43 |
+
v = s.split(".")
|
44 |
+
if len(v) == 3:
|
45 |
+
v.append("final")
|
46 |
+
|
47 |
+
return cls(
|
48 |
+
year=int(v[0]), minor=int(v[1]), micro=int(v[2]), releaselevel=v[3]
|
49 |
+
)
|
50 |
+
|
51 |
+
def _ensure_tuple(self, other):
|
52 |
+
"""
|
53 |
+
Ensure *other* is a tuple of a valid length.
|
54 |
+
|
55 |
+
Returns a possibly transformed *other* and ourselves as a tuple of
|
56 |
+
the same length as *other*.
|
57 |
+
"""
|
58 |
+
|
59 |
+
if self.__class__ is other.__class__:
|
60 |
+
other = astuple(other)
|
61 |
+
|
62 |
+
if not isinstance(other, tuple):
|
63 |
+
raise NotImplementedError
|
64 |
+
|
65 |
+
if not (1 <= len(other) <= 4):
|
66 |
+
raise NotImplementedError
|
67 |
+
|
68 |
+
return astuple(self)[: len(other)], other
|
69 |
+
|
70 |
+
def __eq__(self, other):
|
71 |
+
try:
|
72 |
+
us, them = self._ensure_tuple(other)
|
73 |
+
except NotImplementedError:
|
74 |
+
return NotImplemented
|
75 |
+
|
76 |
+
return us == them
|
77 |
+
|
78 |
+
def __lt__(self, other):
|
79 |
+
try:
|
80 |
+
us, them = self._ensure_tuple(other)
|
81 |
+
except NotImplementedError:
|
82 |
+
return NotImplemented
|
83 |
+
|
84 |
+
# Since alphabetically "dev0" < "final" < "post1" < "post2", we don't
|
85 |
+
# have to do anything special with releaselevel for now.
|
86 |
+
return us < them
|
venv/lib/python3.10/site-packages/attr/_version_info.pyi
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
class VersionInfo:
|
2 |
+
@property
|
3 |
+
def year(self) -> int: ...
|
4 |
+
@property
|
5 |
+
def minor(self) -> int: ...
|
6 |
+
@property
|
7 |
+
def micro(self) -> int: ...
|
8 |
+
@property
|
9 |
+
def releaselevel(self) -> str: ...
|
venv/lib/python3.10/site-packages/attr/converters.py
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Commonly useful converters.
|
5 |
+
"""
|
6 |
+
|
7 |
+
|
8 |
+
import typing
|
9 |
+
|
10 |
+
from ._compat import _AnnotationExtractor
|
11 |
+
from ._make import NOTHING, Factory, pipe
|
12 |
+
|
13 |
+
|
14 |
+
__all__ = [
|
15 |
+
"default_if_none",
|
16 |
+
"optional",
|
17 |
+
"pipe",
|
18 |
+
"to_bool",
|
19 |
+
]
|
20 |
+
|
21 |
+
|
22 |
+
def optional(converter):
|
23 |
+
"""
|
24 |
+
A converter that allows an attribute to be optional. An optional attribute
|
25 |
+
is one which can be set to ``None``.
|
26 |
+
|
27 |
+
Type annotations will be inferred from the wrapped converter's, if it
|
28 |
+
has any.
|
29 |
+
|
30 |
+
:param callable converter: the converter that is used for non-``None``
|
31 |
+
values.
|
32 |
+
|
33 |
+
.. versionadded:: 17.1.0
|
34 |
+
"""
|
35 |
+
|
36 |
+
def optional_converter(val):
|
37 |
+
if val is None:
|
38 |
+
return None
|
39 |
+
return converter(val)
|
40 |
+
|
41 |
+
xtr = _AnnotationExtractor(converter)
|
42 |
+
|
43 |
+
t = xtr.get_first_param_type()
|
44 |
+
if t:
|
45 |
+
optional_converter.__annotations__["val"] = typing.Optional[t]
|
46 |
+
|
47 |
+
rt = xtr.get_return_type()
|
48 |
+
if rt:
|
49 |
+
optional_converter.__annotations__["return"] = typing.Optional[rt]
|
50 |
+
|
51 |
+
return optional_converter
|
52 |
+
|
53 |
+
|
54 |
+
def default_if_none(default=NOTHING, factory=None):
|
55 |
+
"""
|
56 |
+
A converter that allows to replace ``None`` values by *default* or the
|
57 |
+
result of *factory*.
|
58 |
+
|
59 |
+
:param default: Value to be used if ``None`` is passed. Passing an instance
|
60 |
+
of `attrs.Factory` is supported, however the ``takes_self`` option
|
61 |
+
is *not*.
|
62 |
+
:param callable factory: A callable that takes no parameters whose result
|
63 |
+
is used if ``None`` is passed.
|
64 |
+
|
65 |
+
:raises TypeError: If **neither** *default* or *factory* is passed.
|
66 |
+
:raises TypeError: If **both** *default* and *factory* are passed.
|
67 |
+
:raises ValueError: If an instance of `attrs.Factory` is passed with
|
68 |
+
``takes_self=True``.
|
69 |
+
|
70 |
+
.. versionadded:: 18.2.0
|
71 |
+
"""
|
72 |
+
if default is NOTHING and factory is None:
|
73 |
+
msg = "Must pass either `default` or `factory`."
|
74 |
+
raise TypeError(msg)
|
75 |
+
|
76 |
+
if default is not NOTHING and factory is not None:
|
77 |
+
msg = "Must pass either `default` or `factory` but not both."
|
78 |
+
raise TypeError(msg)
|
79 |
+
|
80 |
+
if factory is not None:
|
81 |
+
default = Factory(factory)
|
82 |
+
|
83 |
+
if isinstance(default, Factory):
|
84 |
+
if default.takes_self:
|
85 |
+
msg = "`takes_self` is not supported by default_if_none."
|
86 |
+
raise ValueError(msg)
|
87 |
+
|
88 |
+
def default_if_none_converter(val):
|
89 |
+
if val is not None:
|
90 |
+
return val
|
91 |
+
|
92 |
+
return default.factory()
|
93 |
+
|
94 |
+
else:
|
95 |
+
|
96 |
+
def default_if_none_converter(val):
|
97 |
+
if val is not None:
|
98 |
+
return val
|
99 |
+
|
100 |
+
return default
|
101 |
+
|
102 |
+
return default_if_none_converter
|
103 |
+
|
104 |
+
|
105 |
+
def to_bool(val):
|
106 |
+
"""
|
107 |
+
Convert "boolean" strings (e.g., from env. vars.) to real booleans.
|
108 |
+
|
109 |
+
Values mapping to :code:`True`:
|
110 |
+
|
111 |
+
- :code:`True`
|
112 |
+
- :code:`"true"` / :code:`"t"`
|
113 |
+
- :code:`"yes"` / :code:`"y"`
|
114 |
+
- :code:`"on"`
|
115 |
+
- :code:`"1"`
|
116 |
+
- :code:`1`
|
117 |
+
|
118 |
+
Values mapping to :code:`False`:
|
119 |
+
|
120 |
+
- :code:`False`
|
121 |
+
- :code:`"false"` / :code:`"f"`
|
122 |
+
- :code:`"no"` / :code:`"n"`
|
123 |
+
- :code:`"off"`
|
124 |
+
- :code:`"0"`
|
125 |
+
- :code:`0`
|
126 |
+
|
127 |
+
:raises ValueError: for any other value.
|
128 |
+
|
129 |
+
.. versionadded:: 21.3.0
|
130 |
+
"""
|
131 |
+
if isinstance(val, str):
|
132 |
+
val = val.lower()
|
133 |
+
truthy = {True, "true", "t", "yes", "y", "on", "1", 1}
|
134 |
+
falsy = {False, "false", "f", "no", "n", "off", "0", 0}
|
135 |
+
try:
|
136 |
+
if val in truthy:
|
137 |
+
return True
|
138 |
+
if val in falsy:
|
139 |
+
return False
|
140 |
+
except TypeError:
|
141 |
+
# Raised when "val" is not hashable (e.g., lists)
|
142 |
+
pass
|
143 |
+
msg = f"Cannot convert value to bool: {val}"
|
144 |
+
raise ValueError(msg)
|
venv/lib/python3.10/site-packages/attr/converters.pyi
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Callable, TypeVar, overload
|
2 |
+
|
3 |
+
from . import _ConverterType
|
4 |
+
|
5 |
+
_T = TypeVar("_T")
|
6 |
+
|
7 |
+
def pipe(*validators: _ConverterType) -> _ConverterType: ...
|
8 |
+
def optional(converter: _ConverterType) -> _ConverterType: ...
|
9 |
+
@overload
|
10 |
+
def default_if_none(default: _T) -> _ConverterType: ...
|
11 |
+
@overload
|
12 |
+
def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType: ...
|
13 |
+
def to_bool(val: str) -> bool: ...
|
venv/lib/python3.10/site-packages/attr/exceptions.py
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
from typing import ClassVar
|
6 |
+
|
7 |
+
|
8 |
+
class FrozenError(AttributeError):
|
9 |
+
"""
|
10 |
+
A frozen/immutable instance or attribute have been attempted to be
|
11 |
+
modified.
|
12 |
+
|
13 |
+
It mirrors the behavior of ``namedtuples`` by using the same error message
|
14 |
+
and subclassing `AttributeError`.
|
15 |
+
|
16 |
+
.. versionadded:: 20.1.0
|
17 |
+
"""
|
18 |
+
|
19 |
+
msg = "can't set attribute"
|
20 |
+
args: ClassVar[tuple[str]] = [msg]
|
21 |
+
|
22 |
+
|
23 |
+
class FrozenInstanceError(FrozenError):
|
24 |
+
"""
|
25 |
+
A frozen instance has been attempted to be modified.
|
26 |
+
|
27 |
+
.. versionadded:: 16.1.0
|
28 |
+
"""
|
29 |
+
|
30 |
+
|
31 |
+
class FrozenAttributeError(FrozenError):
|
32 |
+
"""
|
33 |
+
A frozen attribute has been attempted to be modified.
|
34 |
+
|
35 |
+
.. versionadded:: 20.1.0
|
36 |
+
"""
|
37 |
+
|
38 |
+
|
39 |
+
class AttrsAttributeNotFoundError(ValueError):
|
40 |
+
"""
|
41 |
+
An *attrs* function couldn't find an attribute that the user asked for.
|
42 |
+
|
43 |
+
.. versionadded:: 16.2.0
|
44 |
+
"""
|
45 |
+
|
46 |
+
|
47 |
+
class NotAnAttrsClassError(ValueError):
|
48 |
+
"""
|
49 |
+
A non-*attrs* class has been passed into an *attrs* function.
|
50 |
+
|
51 |
+
.. versionadded:: 16.2.0
|
52 |
+
"""
|
53 |
+
|
54 |
+
|
55 |
+
class DefaultAlreadySetError(RuntimeError):
|
56 |
+
"""
|
57 |
+
A default has been set when defining the field and is attempted to be reset
|
58 |
+
using the decorator.
|
59 |
+
|
60 |
+
.. versionadded:: 17.1.0
|
61 |
+
"""
|
62 |
+
|
63 |
+
|
64 |
+
class UnannotatedAttributeError(RuntimeError):
|
65 |
+
"""
|
66 |
+
A class with ``auto_attribs=True`` has a field without a type annotation.
|
67 |
+
|
68 |
+
.. versionadded:: 17.3.0
|
69 |
+
"""
|
70 |
+
|
71 |
+
|
72 |
+
class PythonTooOldError(RuntimeError):
|
73 |
+
"""
|
74 |
+
It was attempted to use an *attrs* feature that requires a newer Python
|
75 |
+
version.
|
76 |
+
|
77 |
+
.. versionadded:: 18.2.0
|
78 |
+
"""
|
79 |
+
|
80 |
+
|
81 |
+
class NotCallableError(TypeError):
|
82 |
+
"""
|
83 |
+
A field requiring a callable has been set with a value that is not
|
84 |
+
callable.
|
85 |
+
|
86 |
+
.. versionadded:: 19.2.0
|
87 |
+
"""
|
88 |
+
|
89 |
+
def __init__(self, msg, value):
|
90 |
+
super(TypeError, self).__init__(msg, value)
|
91 |
+
self.msg = msg
|
92 |
+
self.value = value
|
93 |
+
|
94 |
+
def __str__(self):
|
95 |
+
return str(self.msg)
|
venv/lib/python3.10/site-packages/attr/exceptions.pyi
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Any
|
2 |
+
|
3 |
+
class FrozenError(AttributeError):
|
4 |
+
msg: str = ...
|
5 |
+
|
6 |
+
class FrozenInstanceError(FrozenError): ...
|
7 |
+
class FrozenAttributeError(FrozenError): ...
|
8 |
+
class AttrsAttributeNotFoundError(ValueError): ...
|
9 |
+
class NotAnAttrsClassError(ValueError): ...
|
10 |
+
class DefaultAlreadySetError(RuntimeError): ...
|
11 |
+
class UnannotatedAttributeError(RuntimeError): ...
|
12 |
+
class PythonTooOldError(RuntimeError): ...
|
13 |
+
|
14 |
+
class NotCallableError(TypeError):
|
15 |
+
msg: str = ...
|
16 |
+
value: Any = ...
|
17 |
+
def __init__(self, msg: str, value: Any) -> None: ...
|
venv/lib/python3.10/site-packages/attr/filters.py
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Commonly useful filters for `attr.asdict`.
|
5 |
+
"""
|
6 |
+
|
7 |
+
from ._make import Attribute
|
8 |
+
|
9 |
+
|
10 |
+
def _split_what(what):
|
11 |
+
"""
|
12 |
+
Returns a tuple of `frozenset`s of classes and attributes.
|
13 |
+
"""
|
14 |
+
return (
|
15 |
+
frozenset(cls for cls in what if isinstance(cls, type)),
|
16 |
+
frozenset(cls for cls in what if isinstance(cls, str)),
|
17 |
+
frozenset(cls for cls in what if isinstance(cls, Attribute)),
|
18 |
+
)
|
19 |
+
|
20 |
+
|
21 |
+
def include(*what):
|
22 |
+
"""
|
23 |
+
Include *what*.
|
24 |
+
|
25 |
+
:param what: What to include.
|
26 |
+
:type what: `list` of classes `type`, field names `str` or
|
27 |
+
`attrs.Attribute`\\ s
|
28 |
+
|
29 |
+
:rtype: `callable`
|
30 |
+
|
31 |
+
.. versionchanged:: 23.1.0 Accept strings with field names.
|
32 |
+
"""
|
33 |
+
cls, names, attrs = _split_what(what)
|
34 |
+
|
35 |
+
def include_(attribute, value):
|
36 |
+
return (
|
37 |
+
value.__class__ in cls
|
38 |
+
or attribute.name in names
|
39 |
+
or attribute in attrs
|
40 |
+
)
|
41 |
+
|
42 |
+
return include_
|
43 |
+
|
44 |
+
|
45 |
+
def exclude(*what):
|
46 |
+
"""
|
47 |
+
Exclude *what*.
|
48 |
+
|
49 |
+
:param what: What to exclude.
|
50 |
+
:type what: `list` of classes `type`, field names `str` or
|
51 |
+
`attrs.Attribute`\\ s.
|
52 |
+
|
53 |
+
:rtype: `callable`
|
54 |
+
|
55 |
+
.. versionchanged:: 23.3.0 Accept field name string as input argument
|
56 |
+
"""
|
57 |
+
cls, names, attrs = _split_what(what)
|
58 |
+
|
59 |
+
def exclude_(attribute, value):
|
60 |
+
return not (
|
61 |
+
value.__class__ in cls
|
62 |
+
or attribute.name in names
|
63 |
+
or attribute in attrs
|
64 |
+
)
|
65 |
+
|
66 |
+
return exclude_
|
venv/lib/python3.10/site-packages/attr/filters.pyi
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Any, Union
|
2 |
+
|
3 |
+
from . import Attribute, _FilterType
|
4 |
+
|
5 |
+
def include(*what: Union[type, str, Attribute[Any]]) -> _FilterType[Any]: ...
|
6 |
+
def exclude(*what: Union[type, str, Attribute[Any]]) -> _FilterType[Any]: ...
|
venv/lib/python3.10/site-packages/attr/py.typed
ADDED
File without changes
|
venv/lib/python3.10/site-packages/attr/setters.py
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Commonly used hooks for on_setattr.
|
5 |
+
"""
|
6 |
+
|
7 |
+
|
8 |
+
from . import _config
|
9 |
+
from .exceptions import FrozenAttributeError
|
10 |
+
|
11 |
+
|
12 |
+
def pipe(*setters):
|
13 |
+
"""
|
14 |
+
Run all *setters* and return the return value of the last one.
|
15 |
+
|
16 |
+
.. versionadded:: 20.1.0
|
17 |
+
"""
|
18 |
+
|
19 |
+
def wrapped_pipe(instance, attrib, new_value):
|
20 |
+
rv = new_value
|
21 |
+
|
22 |
+
for setter in setters:
|
23 |
+
rv = setter(instance, attrib, rv)
|
24 |
+
|
25 |
+
return rv
|
26 |
+
|
27 |
+
return wrapped_pipe
|
28 |
+
|
29 |
+
|
30 |
+
def frozen(_, __, ___):
|
31 |
+
"""
|
32 |
+
Prevent an attribute to be modified.
|
33 |
+
|
34 |
+
.. versionadded:: 20.1.0
|
35 |
+
"""
|
36 |
+
raise FrozenAttributeError()
|
37 |
+
|
38 |
+
|
39 |
+
def validate(instance, attrib, new_value):
|
40 |
+
"""
|
41 |
+
Run *attrib*'s validator on *new_value* if it has one.
|
42 |
+
|
43 |
+
.. versionadded:: 20.1.0
|
44 |
+
"""
|
45 |
+
if _config._run_validators is False:
|
46 |
+
return new_value
|
47 |
+
|
48 |
+
v = attrib.validator
|
49 |
+
if not v:
|
50 |
+
return new_value
|
51 |
+
|
52 |
+
v(instance, attrib, new_value)
|
53 |
+
|
54 |
+
return new_value
|
55 |
+
|
56 |
+
|
57 |
+
def convert(instance, attrib, new_value):
|
58 |
+
"""
|
59 |
+
Run *attrib*'s converter -- if it has one -- on *new_value* and return the
|
60 |
+
result.
|
61 |
+
|
62 |
+
.. versionadded:: 20.1.0
|
63 |
+
"""
|
64 |
+
c = attrib.converter
|
65 |
+
if c:
|
66 |
+
return c(new_value)
|
67 |
+
|
68 |
+
return new_value
|
69 |
+
|
70 |
+
|
71 |
+
# Sentinel for disabling class-wide *on_setattr* hooks for certain attributes.
|
72 |
+
# autodata stopped working, so the docstring is inlined in the API docs.
|
73 |
+
NO_OP = object()
|
venv/lib/python3.10/site-packages/attr/setters.pyi
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Any, NewType, NoReturn, TypeVar
|
2 |
+
|
3 |
+
from . import Attribute, _OnSetAttrType
|
4 |
+
|
5 |
+
_T = TypeVar("_T")
|
6 |
+
|
7 |
+
def frozen(
|
8 |
+
instance: Any, attribute: Attribute[Any], new_value: Any
|
9 |
+
) -> NoReturn: ...
|
10 |
+
def pipe(*setters: _OnSetAttrType) -> _OnSetAttrType: ...
|
11 |
+
def validate(instance: Any, attribute: Attribute[_T], new_value: _T) -> _T: ...
|
12 |
+
|
13 |
+
# convert is allowed to return Any, because they can be chained using pipe.
|
14 |
+
def convert(
|
15 |
+
instance: Any, attribute: Attribute[Any], new_value: Any
|
16 |
+
) -> Any: ...
|
17 |
+
|
18 |
+
_NoOpType = NewType("_NoOpType", object)
|
19 |
+
NO_OP: _NoOpType
|
venv/lib/python3.10/site-packages/attr/validators.py
ADDED
@@ -0,0 +1,681 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SPDX-License-Identifier: MIT
|
2 |
+
|
3 |
+
"""
|
4 |
+
Commonly useful validators.
|
5 |
+
"""
|
6 |
+
|
7 |
+
|
8 |
+
import operator
|
9 |
+
import re
|
10 |
+
|
11 |
+
from contextlib import contextmanager
|
12 |
+
from re import Pattern
|
13 |
+
|
14 |
+
from ._config import get_run_validators, set_run_validators
|
15 |
+
from ._make import _AndValidator, and_, attrib, attrs
|
16 |
+
from .converters import default_if_none
|
17 |
+
from .exceptions import NotCallableError
|
18 |
+
|
19 |
+
|
20 |
+
__all__ = [
|
21 |
+
"and_",
|
22 |
+
"deep_iterable",
|
23 |
+
"deep_mapping",
|
24 |
+
"disabled",
|
25 |
+
"ge",
|
26 |
+
"get_disabled",
|
27 |
+
"gt",
|
28 |
+
"in_",
|
29 |
+
"instance_of",
|
30 |
+
"is_callable",
|
31 |
+
"le",
|
32 |
+
"lt",
|
33 |
+
"matches_re",
|
34 |
+
"max_len",
|
35 |
+
"min_len",
|
36 |
+
"not_",
|
37 |
+
"optional",
|
38 |
+
"provides",
|
39 |
+
"set_disabled",
|
40 |
+
]
|
41 |
+
|
42 |
+
|
43 |
+
def set_disabled(disabled):
|
44 |
+
"""
|
45 |
+
Globally disable or enable running validators.
|
46 |
+
|
47 |
+
By default, they are run.
|
48 |
+
|
49 |
+
:param disabled: If ``True``, disable running all validators.
|
50 |
+
:type disabled: bool
|
51 |
+
|
52 |
+
.. warning::
|
53 |
+
|
54 |
+
This function is not thread-safe!
|
55 |
+
|
56 |
+
.. versionadded:: 21.3.0
|
57 |
+
"""
|
58 |
+
set_run_validators(not disabled)
|
59 |
+
|
60 |
+
|
61 |
+
def get_disabled():
|
62 |
+
"""
|
63 |
+
Return a bool indicating whether validators are currently disabled or not.
|
64 |
+
|
65 |
+
:return: ``True`` if validators are currently disabled.
|
66 |
+
:rtype: bool
|
67 |
+
|
68 |
+
.. versionadded:: 21.3.0
|
69 |
+
"""
|
70 |
+
return not get_run_validators()
|
71 |
+
|
72 |
+
|
73 |
+
@contextmanager
|
74 |
+
def disabled():
|
75 |
+
"""
|
76 |
+
Context manager that disables running validators within its context.
|
77 |
+
|
78 |
+
.. warning::
|
79 |
+
|
80 |
+
This context manager is not thread-safe!
|
81 |
+
|
82 |
+
.. versionadded:: 21.3.0
|
83 |
+
"""
|
84 |
+
set_run_validators(False)
|
85 |
+
try:
|
86 |
+
yield
|
87 |
+
finally:
|
88 |
+
set_run_validators(True)
|
89 |
+
|
90 |
+
|
91 |
+
@attrs(repr=False, slots=True, hash=True)
|
92 |
+
class _InstanceOfValidator:
|
93 |
+
type = attrib()
|
94 |
+
|
95 |
+
def __call__(self, inst, attr, value):
|
96 |
+
"""
|
97 |
+
We use a callable class to be able to change the ``__repr__``.
|
98 |
+
"""
|
99 |
+
if not isinstance(value, self.type):
|
100 |
+
msg = "'{name}' must be {type!r} (got {value!r} that is a {actual!r}).".format(
|
101 |
+
name=attr.name,
|
102 |
+
type=self.type,
|
103 |
+
actual=value.__class__,
|
104 |
+
value=value,
|
105 |
+
)
|
106 |
+
raise TypeError(
|
107 |
+
msg,
|
108 |
+
attr,
|
109 |
+
self.type,
|
110 |
+
value,
|
111 |
+
)
|
112 |
+
|
113 |
+
def __repr__(self):
|
114 |
+
return f"<instance_of validator for type {self.type!r}>"
|
115 |
+
|
116 |
+
|
117 |
+
def instance_of(type):
|
118 |
+
"""
|
119 |
+
A validator that raises a `TypeError` if the initializer is called
|
120 |
+
with a wrong type for this particular attribute (checks are performed using
|
121 |
+
`isinstance` therefore it's also valid to pass a tuple of types).
|
122 |
+
|
123 |
+
:param type: The type to check for.
|
124 |
+
:type type: type or tuple of type
|
125 |
+
|
126 |
+
:raises TypeError: With a human readable error message, the attribute
|
127 |
+
(of type `attrs.Attribute`), the expected type, and the value it
|
128 |
+
got.
|
129 |
+
"""
|
130 |
+
return _InstanceOfValidator(type)
|
131 |
+
|
132 |
+
|
133 |
+
@attrs(repr=False, frozen=True, slots=True)
|
134 |
+
class _MatchesReValidator:
|
135 |
+
pattern = attrib()
|
136 |
+
match_func = attrib()
|
137 |
+
|
138 |
+
def __call__(self, inst, attr, value):
|
139 |
+
"""
|
140 |
+
We use a callable class to be able to change the ``__repr__``.
|
141 |
+
"""
|
142 |
+
if not self.match_func(value):
|
143 |
+
msg = "'{name}' must match regex {pattern!r} ({value!r} doesn't)".format(
|
144 |
+
name=attr.name, pattern=self.pattern.pattern, value=value
|
145 |
+
)
|
146 |
+
raise ValueError(
|
147 |
+
msg,
|
148 |
+
attr,
|
149 |
+
self.pattern,
|
150 |
+
value,
|
151 |
+
)
|
152 |
+
|
153 |
+
def __repr__(self):
|
154 |
+
return f"<matches_re validator for pattern {self.pattern!r}>"
|
155 |
+
|
156 |
+
|
157 |
+
def matches_re(regex, flags=0, func=None):
|
158 |
+
r"""
|
159 |
+
A validator that raises `ValueError` if the initializer is called
|
160 |
+
with a string that doesn't match *regex*.
|
161 |
+
|
162 |
+
:param regex: a regex string or precompiled pattern to match against
|
163 |
+
:param int flags: flags that will be passed to the underlying re function
|
164 |
+
(default 0)
|
165 |
+
:param callable func: which underlying `re` function to call. Valid options
|
166 |
+
are `re.fullmatch`, `re.search`, and `re.match`; the default ``None``
|
167 |
+
means `re.fullmatch`. For performance reasons, the pattern is always
|
168 |
+
precompiled using `re.compile`.
|
169 |
+
|
170 |
+
.. versionadded:: 19.2.0
|
171 |
+
.. versionchanged:: 21.3.0 *regex* can be a pre-compiled pattern.
|
172 |
+
"""
|
173 |
+
valid_funcs = (re.fullmatch, None, re.search, re.match)
|
174 |
+
if func not in valid_funcs:
|
175 |
+
msg = "'func' must be one of {}.".format(
|
176 |
+
", ".join(
|
177 |
+
sorted(e and e.__name__ or "None" for e in set(valid_funcs))
|
178 |
+
)
|
179 |
+
)
|
180 |
+
raise ValueError(msg)
|
181 |
+
|
182 |
+
if isinstance(regex, Pattern):
|
183 |
+
if flags:
|
184 |
+
msg = "'flags' can only be used with a string pattern; pass flags to re.compile() instead"
|
185 |
+
raise TypeError(msg)
|
186 |
+
pattern = regex
|
187 |
+
else:
|
188 |
+
pattern = re.compile(regex, flags)
|
189 |
+
|
190 |
+
if func is re.match:
|
191 |
+
match_func = pattern.match
|
192 |
+
elif func is re.search:
|
193 |
+
match_func = pattern.search
|
194 |
+
else:
|
195 |
+
match_func = pattern.fullmatch
|
196 |
+
|
197 |
+
return _MatchesReValidator(pattern, match_func)
|
198 |
+
|
199 |
+
|
200 |
+
@attrs(repr=False, slots=True, hash=True)
|
201 |
+
class _ProvidesValidator:
|
202 |
+
interface = attrib()
|
203 |
+
|
204 |
+
def __call__(self, inst, attr, value):
|
205 |
+
"""
|
206 |
+
We use a callable class to be able to change the ``__repr__``.
|
207 |
+
"""
|
208 |
+
if not self.interface.providedBy(value):
|
209 |
+
msg = "'{name}' must provide {interface!r} which {value!r} doesn't.".format(
|
210 |
+
name=attr.name, interface=self.interface, value=value
|
211 |
+
)
|
212 |
+
raise TypeError(
|
213 |
+
msg,
|
214 |
+
attr,
|
215 |
+
self.interface,
|
216 |
+
value,
|
217 |
+
)
|
218 |
+
|
219 |
+
def __repr__(self):
|
220 |
+
return f"<provides validator for interface {self.interface!r}>"
|
221 |
+
|
222 |
+
|
223 |
+
def provides(interface):
|
224 |
+
"""
|
225 |
+
A validator that raises a `TypeError` if the initializer is called
|
226 |
+
with an object that does not provide the requested *interface* (checks are
|
227 |
+
performed using ``interface.providedBy(value)`` (see `zope.interface
|
228 |
+
<https://zopeinterface.readthedocs.io/en/latest/>`_).
|
229 |
+
|
230 |
+
:param interface: The interface to check for.
|
231 |
+
:type interface: ``zope.interface.Interface``
|
232 |
+
|
233 |
+
:raises TypeError: With a human readable error message, the attribute
|
234 |
+
(of type `attrs.Attribute`), the expected interface, and the
|
235 |
+
value it got.
|
236 |
+
|
237 |
+
.. deprecated:: 23.1.0
|
238 |
+
"""
|
239 |
+
import warnings
|
240 |
+
|
241 |
+
warnings.warn(
|
242 |
+
"attrs's zope-interface support is deprecated and will be removed in, "
|
243 |
+
"or after, April 2024.",
|
244 |
+
DeprecationWarning,
|
245 |
+
stacklevel=2,
|
246 |
+
)
|
247 |
+
return _ProvidesValidator(interface)
|
248 |
+
|
249 |
+
|
250 |
+
@attrs(repr=False, slots=True, hash=True)
|
251 |
+
class _OptionalValidator:
|
252 |
+
validator = attrib()
|
253 |
+
|
254 |
+
def __call__(self, inst, attr, value):
|
255 |
+
if value is None:
|
256 |
+
return
|
257 |
+
|
258 |
+
self.validator(inst, attr, value)
|
259 |
+
|
260 |
+
def __repr__(self):
|
261 |
+
return f"<optional validator for {self.validator!r} or None>"
|
262 |
+
|
263 |
+
|
264 |
+
def optional(validator):
|
265 |
+
"""
|
266 |
+
A validator that makes an attribute optional. An optional attribute is one
|
267 |
+
which can be set to ``None`` in addition to satisfying the requirements of
|
268 |
+
the sub-validator.
|
269 |
+
|
270 |
+
:param Callable | tuple[Callable] | list[Callable] validator: A validator
|
271 |
+
(or validators) that is used for non-``None`` values.
|
272 |
+
|
273 |
+
.. versionadded:: 15.1.0
|
274 |
+
.. versionchanged:: 17.1.0 *validator* can be a list of validators.
|
275 |
+
.. versionchanged:: 23.1.0 *validator* can also be a tuple of validators.
|
276 |
+
"""
|
277 |
+
if isinstance(validator, (list, tuple)):
|
278 |
+
return _OptionalValidator(_AndValidator(validator))
|
279 |
+
|
280 |
+
return _OptionalValidator(validator)
|
281 |
+
|
282 |
+
|
283 |
+
@attrs(repr=False, slots=True, hash=True)
|
284 |
+
class _InValidator:
|
285 |
+
options = attrib()
|
286 |
+
|
287 |
+
def __call__(self, inst, attr, value):
|
288 |
+
try:
|
289 |
+
in_options = value in self.options
|
290 |
+
except TypeError: # e.g. `1 in "abc"`
|
291 |
+
in_options = False
|
292 |
+
|
293 |
+
if not in_options:
|
294 |
+
msg = f"'{attr.name}' must be in {self.options!r} (got {value!r})"
|
295 |
+
raise ValueError(
|
296 |
+
msg,
|
297 |
+
attr,
|
298 |
+
self.options,
|
299 |
+
value,
|
300 |
+
)
|
301 |
+
|
302 |
+
def __repr__(self):
|
303 |
+
return f"<in_ validator with options {self.options!r}>"
|
304 |
+
|
305 |
+
|
306 |
+
def in_(options):
|
307 |
+
"""
|
308 |
+
A validator that raises a `ValueError` if the initializer is called
|
309 |
+
with a value that does not belong in the options provided. The check is
|
310 |
+
performed using ``value in options``.
|
311 |
+
|
312 |
+
:param options: Allowed options.
|
313 |
+
:type options: list, tuple, `enum.Enum`, ...
|
314 |
+
|
315 |
+
:raises ValueError: With a human readable error message, the attribute (of
|
316 |
+
type `attrs.Attribute`), the expected options, and the value it
|
317 |
+
got.
|
318 |
+
|
319 |
+
.. versionadded:: 17.1.0
|
320 |
+
.. versionchanged:: 22.1.0
|
321 |
+
The ValueError was incomplete until now and only contained the human
|
322 |
+
readable error message. Now it contains all the information that has
|
323 |
+
been promised since 17.1.0.
|
324 |
+
"""
|
325 |
+
return _InValidator(options)
|
326 |
+
|
327 |
+
|
328 |
+
@attrs(repr=False, slots=False, hash=True)
|
329 |
+
class _IsCallableValidator:
|
330 |
+
def __call__(self, inst, attr, value):
|
331 |
+
"""
|
332 |
+
We use a callable class to be able to change the ``__repr__``.
|
333 |
+
"""
|
334 |
+
if not callable(value):
|
335 |
+
message = (
|
336 |
+
"'{name}' must be callable "
|
337 |
+
"(got {value!r} that is a {actual!r})."
|
338 |
+
)
|
339 |
+
raise NotCallableError(
|
340 |
+
msg=message.format(
|
341 |
+
name=attr.name, value=value, actual=value.__class__
|
342 |
+
),
|
343 |
+
value=value,
|
344 |
+
)
|
345 |
+
|
346 |
+
def __repr__(self):
|
347 |
+
return "<is_callable validator>"
|
348 |
+
|
349 |
+
|
350 |
+
def is_callable():
|
351 |
+
"""
|
352 |
+
A validator that raises a `attrs.exceptions.NotCallableError` if the
|
353 |
+
initializer is called with a value for this particular attribute
|
354 |
+
that is not callable.
|
355 |
+
|
356 |
+
.. versionadded:: 19.1.0
|
357 |
+
|
358 |
+
:raises attrs.exceptions.NotCallableError: With a human readable error
|
359 |
+
message containing the attribute (`attrs.Attribute`) name,
|
360 |
+
and the value it got.
|
361 |
+
"""
|
362 |
+
return _IsCallableValidator()
|
363 |
+
|
364 |
+
|
365 |
+
@attrs(repr=False, slots=True, hash=True)
|
366 |
+
class _DeepIterable:
|
367 |
+
member_validator = attrib(validator=is_callable())
|
368 |
+
iterable_validator = attrib(
|
369 |
+
default=None, validator=optional(is_callable())
|
370 |
+
)
|
371 |
+
|
372 |
+
def __call__(self, inst, attr, value):
|
373 |
+
"""
|
374 |
+
We use a callable class to be able to change the ``__repr__``.
|
375 |
+
"""
|
376 |
+
if self.iterable_validator is not None:
|
377 |
+
self.iterable_validator(inst, attr, value)
|
378 |
+
|
379 |
+
for member in value:
|
380 |
+
self.member_validator(inst, attr, member)
|
381 |
+
|
382 |
+
def __repr__(self):
|
383 |
+
iterable_identifier = (
|
384 |
+
""
|
385 |
+
if self.iterable_validator is None
|
386 |
+
else f" {self.iterable_validator!r}"
|
387 |
+
)
|
388 |
+
return (
|
389 |
+
f"<deep_iterable validator for{iterable_identifier}"
|
390 |
+
f" iterables of {self.member_validator!r}>"
|
391 |
+
)
|
392 |
+
|
393 |
+
|
394 |
+
def deep_iterable(member_validator, iterable_validator=None):
|
395 |
+
"""
|
396 |
+
A validator that performs deep validation of an iterable.
|
397 |
+
|
398 |
+
:param member_validator: Validator(s) to apply to iterable members
|
399 |
+
:param iterable_validator: Validator to apply to iterable itself
|
400 |
+
(optional)
|
401 |
+
|
402 |
+
.. versionadded:: 19.1.0
|
403 |
+
|
404 |
+
:raises TypeError: if any sub-validators fail
|
405 |
+
"""
|
406 |
+
if isinstance(member_validator, (list, tuple)):
|
407 |
+
member_validator = and_(*member_validator)
|
408 |
+
return _DeepIterable(member_validator, iterable_validator)
|
409 |
+
|
410 |
+
|
411 |
+
@attrs(repr=False, slots=True, hash=True)
|
412 |
+
class _DeepMapping:
|
413 |
+
key_validator = attrib(validator=is_callable())
|
414 |
+
value_validator = attrib(validator=is_callable())
|
415 |
+
mapping_validator = attrib(default=None, validator=optional(is_callable()))
|
416 |
+
|
417 |
+
def __call__(self, inst, attr, value):
|
418 |
+
"""
|
419 |
+
We use a callable class to be able to change the ``__repr__``.
|
420 |
+
"""
|
421 |
+
if self.mapping_validator is not None:
|
422 |
+
self.mapping_validator(inst, attr, value)
|
423 |
+
|
424 |
+
for key in value:
|
425 |
+
self.key_validator(inst, attr, key)
|
426 |
+
self.value_validator(inst, attr, value[key])
|
427 |
+
|
428 |
+
def __repr__(self):
|
429 |
+
return (
|
430 |
+
"<deep_mapping validator for objects mapping {key!r} to {value!r}>"
|
431 |
+
).format(key=self.key_validator, value=self.value_validator)
|
432 |
+
|
433 |
+
|
434 |
+
def deep_mapping(key_validator, value_validator, mapping_validator=None):
|
435 |
+
"""
|
436 |
+
A validator that performs deep validation of a dictionary.
|
437 |
+
|
438 |
+
:param key_validator: Validator to apply to dictionary keys
|
439 |
+
:param value_validator: Validator to apply to dictionary values
|
440 |
+
:param mapping_validator: Validator to apply to top-level mapping
|
441 |
+
attribute (optional)
|
442 |
+
|
443 |
+
.. versionadded:: 19.1.0
|
444 |
+
|
445 |
+
:raises TypeError: if any sub-validators fail
|
446 |
+
"""
|
447 |
+
return _DeepMapping(key_validator, value_validator, mapping_validator)
|
448 |
+
|
449 |
+
|
450 |
+
@attrs(repr=False, frozen=True, slots=True)
|
451 |
+
class _NumberValidator:
|
452 |
+
bound = attrib()
|
453 |
+
compare_op = attrib()
|
454 |
+
compare_func = attrib()
|
455 |
+
|
456 |
+
def __call__(self, inst, attr, value):
|
457 |
+
"""
|
458 |
+
We use a callable class to be able to change the ``__repr__``.
|
459 |
+
"""
|
460 |
+
if not self.compare_func(value, self.bound):
|
461 |
+
msg = f"'{attr.name}' must be {self.compare_op} {self.bound}: {value}"
|
462 |
+
raise ValueError(msg)
|
463 |
+
|
464 |
+
def __repr__(self):
|
465 |
+
return f"<Validator for x {self.compare_op} {self.bound}>"
|
466 |
+
|
467 |
+
|
468 |
+
def lt(val):
|
469 |
+
"""
|
470 |
+
A validator that raises `ValueError` if the initializer is called
|
471 |
+
with a number larger or equal to *val*.
|
472 |
+
|
473 |
+
:param val: Exclusive upper bound for values
|
474 |
+
|
475 |
+
.. versionadded:: 21.3.0
|
476 |
+
"""
|
477 |
+
return _NumberValidator(val, "<", operator.lt)
|
478 |
+
|
479 |
+
|
480 |
+
def le(val):
|
481 |
+
"""
|
482 |
+
A validator that raises `ValueError` if the initializer is called
|
483 |
+
with a number greater than *val*.
|
484 |
+
|
485 |
+
:param val: Inclusive upper bound for values
|
486 |
+
|
487 |
+
.. versionadded:: 21.3.0
|
488 |
+
"""
|
489 |
+
return _NumberValidator(val, "<=", operator.le)
|
490 |
+
|
491 |
+
|
492 |
+
def ge(val):
|
493 |
+
"""
|
494 |
+
A validator that raises `ValueError` if the initializer is called
|
495 |
+
with a number smaller than *val*.
|
496 |
+
|
497 |
+
:param val: Inclusive lower bound for values
|
498 |
+
|
499 |
+
.. versionadded:: 21.3.0
|
500 |
+
"""
|
501 |
+
return _NumberValidator(val, ">=", operator.ge)
|
502 |
+
|
503 |
+
|
504 |
+
def gt(val):
|
505 |
+
"""
|
506 |
+
A validator that raises `ValueError` if the initializer is called
|
507 |
+
with a number smaller or equal to *val*.
|
508 |
+
|
509 |
+
:param val: Exclusive lower bound for values
|
510 |
+
|
511 |
+
.. versionadded:: 21.3.0
|
512 |
+
"""
|
513 |
+
return _NumberValidator(val, ">", operator.gt)
|
514 |
+
|
515 |
+
|
516 |
+
@attrs(repr=False, frozen=True, slots=True)
|
517 |
+
class _MaxLengthValidator:
|
518 |
+
max_length = attrib()
|
519 |
+
|
520 |
+
def __call__(self, inst, attr, value):
|
521 |
+
"""
|
522 |
+
We use a callable class to be able to change the ``__repr__``.
|
523 |
+
"""
|
524 |
+
if len(value) > self.max_length:
|
525 |
+
msg = f"Length of '{attr.name}' must be <= {self.max_length}: {len(value)}"
|
526 |
+
raise ValueError(msg)
|
527 |
+
|
528 |
+
def __repr__(self):
|
529 |
+
return f"<max_len validator for {self.max_length}>"
|
530 |
+
|
531 |
+
|
532 |
+
def max_len(length):
|
533 |
+
"""
|
534 |
+
A validator that raises `ValueError` if the initializer is called
|
535 |
+
with a string or iterable that is longer than *length*.
|
536 |
+
|
537 |
+
:param int length: Maximum length of the string or iterable
|
538 |
+
|
539 |
+
.. versionadded:: 21.3.0
|
540 |
+
"""
|
541 |
+
return _MaxLengthValidator(length)
|
542 |
+
|
543 |
+
|
544 |
+
@attrs(repr=False, frozen=True, slots=True)
|
545 |
+
class _MinLengthValidator:
|
546 |
+
min_length = attrib()
|
547 |
+
|
548 |
+
def __call__(self, inst, attr, value):
|
549 |
+
"""
|
550 |
+
We use a callable class to be able to change the ``__repr__``.
|
551 |
+
"""
|
552 |
+
if len(value) < self.min_length:
|
553 |
+
msg = f"Length of '{attr.name}' must be >= {self.min_length}: {len(value)}"
|
554 |
+
raise ValueError(msg)
|
555 |
+
|
556 |
+
def __repr__(self):
|
557 |
+
return f"<min_len validator for {self.min_length}>"
|
558 |
+
|
559 |
+
|
560 |
+
def min_len(length):
|
561 |
+
"""
|
562 |
+
A validator that raises `ValueError` if the initializer is called
|
563 |
+
with a string or iterable that is shorter than *length*.
|
564 |
+
|
565 |
+
:param int length: Minimum length of the string or iterable
|
566 |
+
|
567 |
+
.. versionadded:: 22.1.0
|
568 |
+
"""
|
569 |
+
return _MinLengthValidator(length)
|
570 |
+
|
571 |
+
|
572 |
+
@attrs(repr=False, slots=True, hash=True)
|
573 |
+
class _SubclassOfValidator:
|
574 |
+
type = attrib()
|
575 |
+
|
576 |
+
def __call__(self, inst, attr, value):
|
577 |
+
"""
|
578 |
+
We use a callable class to be able to change the ``__repr__``.
|
579 |
+
"""
|
580 |
+
if not issubclass(value, self.type):
|
581 |
+
msg = f"'{attr.name}' must be a subclass of {self.type!r} (got {value!r})."
|
582 |
+
raise TypeError(
|
583 |
+
msg,
|
584 |
+
attr,
|
585 |
+
self.type,
|
586 |
+
value,
|
587 |
+
)
|
588 |
+
|
589 |
+
def __repr__(self):
|
590 |
+
return f"<subclass_of validator for type {self.type!r}>"
|
591 |
+
|
592 |
+
|
593 |
+
def _subclass_of(type):
|
594 |
+
"""
|
595 |
+
A validator that raises a `TypeError` if the initializer is called
|
596 |
+
with a wrong type for this particular attribute (checks are performed using
|
597 |
+
`issubclass` therefore it's also valid to pass a tuple of types).
|
598 |
+
|
599 |
+
:param type: The type to check for.
|
600 |
+
:type type: type or tuple of types
|
601 |
+
|
602 |
+
:raises TypeError: With a human readable error message, the attribute
|
603 |
+
(of type `attrs.Attribute`), the expected type, and the value it
|
604 |
+
got.
|
605 |
+
"""
|
606 |
+
return _SubclassOfValidator(type)
|
607 |
+
|
608 |
+
|
609 |
+
@attrs(repr=False, slots=True, hash=True)
|
610 |
+
class _NotValidator:
|
611 |
+
validator = attrib()
|
612 |
+
msg = attrib(
|
613 |
+
converter=default_if_none(
|
614 |
+
"not_ validator child '{validator!r}' "
|
615 |
+
"did not raise a captured error"
|
616 |
+
)
|
617 |
+
)
|
618 |
+
exc_types = attrib(
|
619 |
+
validator=deep_iterable(
|
620 |
+
member_validator=_subclass_of(Exception),
|
621 |
+
iterable_validator=instance_of(tuple),
|
622 |
+
),
|
623 |
+
)
|
624 |
+
|
625 |
+
def __call__(self, inst, attr, value):
|
626 |
+
try:
|
627 |
+
self.validator(inst, attr, value)
|
628 |
+
except self.exc_types:
|
629 |
+
pass # suppress error to invert validity
|
630 |
+
else:
|
631 |
+
raise ValueError(
|
632 |
+
self.msg.format(
|
633 |
+
validator=self.validator,
|
634 |
+
exc_types=self.exc_types,
|
635 |
+
),
|
636 |
+
attr,
|
637 |
+
self.validator,
|
638 |
+
value,
|
639 |
+
self.exc_types,
|
640 |
+
)
|
641 |
+
|
642 |
+
def __repr__(self):
|
643 |
+
return (
|
644 |
+
"<not_ validator wrapping {what!r}, capturing {exc_types!r}>"
|
645 |
+
).format(
|
646 |
+
what=self.validator,
|
647 |
+
exc_types=self.exc_types,
|
648 |
+
)
|
649 |
+
|
650 |
+
|
651 |
+
def not_(validator, *, msg=None, exc_types=(ValueError, TypeError)):
|
652 |
+
"""
|
653 |
+
A validator that wraps and logically 'inverts' the validator passed to it.
|
654 |
+
It will raise a `ValueError` if the provided validator *doesn't* raise a
|
655 |
+
`ValueError` or `TypeError` (by default), and will suppress the exception
|
656 |
+
if the provided validator *does*.
|
657 |
+
|
658 |
+
Intended to be used with existing validators to compose logic without
|
659 |
+
needing to create inverted variants, for example, ``not_(in_(...))``.
|
660 |
+
|
661 |
+
:param validator: A validator to be logically inverted.
|
662 |
+
:param msg: Message to raise if validator fails.
|
663 |
+
Formatted with keys ``exc_types`` and ``validator``.
|
664 |
+
:type msg: str
|
665 |
+
:param exc_types: Exception type(s) to capture.
|
666 |
+
Other types raised by child validators will not be intercepted and
|
667 |
+
pass through.
|
668 |
+
|
669 |
+
:raises ValueError: With a human readable error message,
|
670 |
+
the attribute (of type `attrs.Attribute`),
|
671 |
+
the validator that failed to raise an exception,
|
672 |
+
the value it got,
|
673 |
+
and the expected exception types.
|
674 |
+
|
675 |
+
.. versionadded:: 22.2.0
|
676 |
+
"""
|
677 |
+
try:
|
678 |
+
exc_types = tuple(exc_types)
|
679 |
+
except TypeError:
|
680 |
+
exc_types = (exc_types,)
|
681 |
+
return _NotValidator(validator, msg, exc_types)
|
venv/lib/python3.10/site-packages/attr/validators.pyi
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import (
|
2 |
+
Any,
|
3 |
+
AnyStr,
|
4 |
+
Callable,
|
5 |
+
Container,
|
6 |
+
ContextManager,
|
7 |
+
Iterable,
|
8 |
+
List,
|
9 |
+
Mapping,
|
10 |
+
Match,
|
11 |
+
Optional,
|
12 |
+
Pattern,
|
13 |
+
Tuple,
|
14 |
+
Type,
|
15 |
+
TypeVar,
|
16 |
+
Union,
|
17 |
+
overload,
|
18 |
+
)
|
19 |
+
|
20 |
+
from . import _ValidatorType
|
21 |
+
from . import _ValidatorArgType
|
22 |
+
|
23 |
+
_T = TypeVar("_T")
|
24 |
+
_T1 = TypeVar("_T1")
|
25 |
+
_T2 = TypeVar("_T2")
|
26 |
+
_T3 = TypeVar("_T3")
|
27 |
+
_I = TypeVar("_I", bound=Iterable)
|
28 |
+
_K = TypeVar("_K")
|
29 |
+
_V = TypeVar("_V")
|
30 |
+
_M = TypeVar("_M", bound=Mapping)
|
31 |
+
|
32 |
+
def set_disabled(run: bool) -> None: ...
|
33 |
+
def get_disabled() -> bool: ...
|
34 |
+
def disabled() -> ContextManager[None]: ...
|
35 |
+
|
36 |
+
# To be more precise on instance_of use some overloads.
|
37 |
+
# If there are more than 3 items in the tuple then we fall back to Any
|
38 |
+
@overload
|
39 |
+
def instance_of(type: Type[_T]) -> _ValidatorType[_T]: ...
|
40 |
+
@overload
|
41 |
+
def instance_of(type: Tuple[Type[_T]]) -> _ValidatorType[_T]: ...
|
42 |
+
@overload
|
43 |
+
def instance_of(
|
44 |
+
type: Tuple[Type[_T1], Type[_T2]]
|
45 |
+
) -> _ValidatorType[Union[_T1, _T2]]: ...
|
46 |
+
@overload
|
47 |
+
def instance_of(
|
48 |
+
type: Tuple[Type[_T1], Type[_T2], Type[_T3]]
|
49 |
+
) -> _ValidatorType[Union[_T1, _T2, _T3]]: ...
|
50 |
+
@overload
|
51 |
+
def instance_of(type: Tuple[type, ...]) -> _ValidatorType[Any]: ...
|
52 |
+
def provides(interface: Any) -> _ValidatorType[Any]: ...
|
53 |
+
def optional(
|
54 |
+
validator: Union[
|
55 |
+
_ValidatorType[_T], List[_ValidatorType[_T]], Tuple[_ValidatorType[_T]]
|
56 |
+
]
|
57 |
+
) -> _ValidatorType[Optional[_T]]: ...
|
58 |
+
def in_(options: Container[_T]) -> _ValidatorType[_T]: ...
|
59 |
+
def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ...
|
60 |
+
def matches_re(
|
61 |
+
regex: Union[Pattern[AnyStr], AnyStr],
|
62 |
+
flags: int = ...,
|
63 |
+
func: Optional[
|
64 |
+
Callable[[AnyStr, AnyStr, int], Optional[Match[AnyStr]]]
|
65 |
+
] = ...,
|
66 |
+
) -> _ValidatorType[AnyStr]: ...
|
67 |
+
def deep_iterable(
|
68 |
+
member_validator: _ValidatorArgType[_T],
|
69 |
+
iterable_validator: Optional[_ValidatorType[_I]] = ...,
|
70 |
+
) -> _ValidatorType[_I]: ...
|
71 |
+
def deep_mapping(
|
72 |
+
key_validator: _ValidatorType[_K],
|
73 |
+
value_validator: _ValidatorType[_V],
|
74 |
+
mapping_validator: Optional[_ValidatorType[_M]] = ...,
|
75 |
+
) -> _ValidatorType[_M]: ...
|
76 |
+
def is_callable() -> _ValidatorType[_T]: ...
|
77 |
+
def lt(val: _T) -> _ValidatorType[_T]: ...
|
78 |
+
def le(val: _T) -> _ValidatorType[_T]: ...
|
79 |
+
def ge(val: _T) -> _ValidatorType[_T]: ...
|
80 |
+
def gt(val: _T) -> _ValidatorType[_T]: ...
|
81 |
+
def max_len(length: int) -> _ValidatorType[_T]: ...
|
82 |
+
def min_len(length: int) -> _ValidatorType[_T]: ...
|
83 |
+
def not_(
|
84 |
+
validator: _ValidatorType[_T],
|
85 |
+
*,
|
86 |
+
msg: Optional[str] = None,
|
87 |
+
exc_types: Union[Type[Exception], Iterable[Type[Exception]]] = ...,
|
88 |
+
) -> _ValidatorType[_T]: ...
|
venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/License.txt
ADDED
@@ -0,0 +1,1568 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
End User License Agreement
|
2 |
+
--------------------------
|
3 |
+
|
4 |
+
|
5 |
+
Preface
|
6 |
+
-------
|
7 |
+
|
8 |
+
The Software License Agreement in Chapter 1 and the Supplement
|
9 |
+
in Chapter 2 contain license terms and conditions that govern
|
10 |
+
the use of NVIDIA software. By accepting this agreement, you
|
11 |
+
agree to comply with all the terms and conditions applicable
|
12 |
+
to the product(s) included herein.
|
13 |
+
|
14 |
+
|
15 |
+
NVIDIA Driver
|
16 |
+
|
17 |
+
|
18 |
+
Description
|
19 |
+
|
20 |
+
This package contains the operating system driver and
|
21 |
+
fundamental system software components for NVIDIA GPUs.
|
22 |
+
|
23 |
+
|
24 |
+
NVIDIA CUDA Toolkit
|
25 |
+
|
26 |
+
|
27 |
+
Description
|
28 |
+
|
29 |
+
The NVIDIA CUDA Toolkit provides command-line and graphical
|
30 |
+
tools for building, debugging and optimizing the performance
|
31 |
+
of applications accelerated by NVIDIA GPUs, runtime and math
|
32 |
+
libraries, and documentation including programming guides,
|
33 |
+
user manuals, and API references.
|
34 |
+
|
35 |
+
|
36 |
+
Default Install Location of CUDA Toolkit
|
37 |
+
|
38 |
+
Windows platform:
|
39 |
+
|
40 |
+
%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.#
|
41 |
+
|
42 |
+
Linux platform:
|
43 |
+
|
44 |
+
/usr/local/cuda-#.#
|
45 |
+
|
46 |
+
Mac platform:
|
47 |
+
|
48 |
+
/Developer/NVIDIA/CUDA-#.#
|
49 |
+
|
50 |
+
|
51 |
+
NVIDIA CUDA Samples
|
52 |
+
|
53 |
+
|
54 |
+
Description
|
55 |
+
|
56 |
+
This package includes over 100+ CUDA examples that demonstrate
|
57 |
+
various CUDA programming principles, and efficient CUDA
|
58 |
+
implementation of algorithms in specific application domains.
|
59 |
+
|
60 |
+
|
61 |
+
Default Install Location of CUDA Samples
|
62 |
+
|
63 |
+
Windows platform:
|
64 |
+
|
65 |
+
%ProgramData%\NVIDIA Corporation\CUDA Samples\v#.#
|
66 |
+
|
67 |
+
Linux platform:
|
68 |
+
|
69 |
+
/usr/local/cuda-#.#/samples
|
70 |
+
|
71 |
+
and
|
72 |
+
|
73 |
+
$HOME/NVIDIA_CUDA-#.#_Samples
|
74 |
+
|
75 |
+
Mac platform:
|
76 |
+
|
77 |
+
/Developer/NVIDIA/CUDA-#.#/samples
|
78 |
+
|
79 |
+
|
80 |
+
NVIDIA Nsight Visual Studio Edition (Windows only)
|
81 |
+
|
82 |
+
|
83 |
+
Description
|
84 |
+
|
85 |
+
NVIDIA Nsight Development Platform, Visual Studio Edition is a
|
86 |
+
development environment integrated into Microsoft Visual
|
87 |
+
Studio that provides tools for debugging, profiling, analyzing
|
88 |
+
and optimizing your GPU computing and graphics applications.
|
89 |
+
|
90 |
+
|
91 |
+
Default Install Location of Nsight Visual Studio Edition
|
92 |
+
|
93 |
+
Windows platform:
|
94 |
+
|
95 |
+
%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.#
|
96 |
+
|
97 |
+
|
98 |
+
1. License Agreement for NVIDIA Software Development Kits
|
99 |
+
---------------------------------------------------------
|
100 |
+
|
101 |
+
|
102 |
+
Release Date: July 26, 2018
|
103 |
+
---------------------------
|
104 |
+
|
105 |
+
|
106 |
+
Important NoticeRead before downloading, installing,
|
107 |
+
copying or using the licensed software:
|
108 |
+
-------------------------------------------------------
|
109 |
+
|
110 |
+
This license agreement, including exhibits attached
|
111 |
+
("Agreement”) is a legal agreement between you and NVIDIA
|
112 |
+
Corporation ("NVIDIA") and governs your use of a NVIDIA
|
113 |
+
software development kit (“SDK”).
|
114 |
+
|
115 |
+
Each SDK has its own set of software and materials, but here
|
116 |
+
is a description of the types of items that may be included in
|
117 |
+
a SDK: source code, header files, APIs, data sets and assets
|
118 |
+
(examples include images, textures, models, scenes, videos,
|
119 |
+
native API input/output files), binary software, sample code,
|
120 |
+
libraries, utility programs, programming code and
|
121 |
+
documentation.
|
122 |
+
|
123 |
+
This Agreement can be accepted only by an adult of legal age
|
124 |
+
of majority in the country in which the SDK is used.
|
125 |
+
|
126 |
+
If you are entering into this Agreement on behalf of a company
|
127 |
+
or other legal entity, you represent that you have the legal
|
128 |
+
authority to bind the entity to this Agreement, in which case
|
129 |
+
“you” will mean the entity you represent.
|
130 |
+
|
131 |
+
If you don’t have the required age or authority to accept
|
132 |
+
this Agreement, or if you don’t accept all the terms and
|
133 |
+
conditions of this Agreement, do not download, install or use
|
134 |
+
the SDK.
|
135 |
+
|
136 |
+
You agree to use the SDK only for purposes that are permitted
|
137 |
+
by (a) this Agreement, and (b) any applicable law, regulation
|
138 |
+
or generally accepted practices or guidelines in the relevant
|
139 |
+
jurisdictions.
|
140 |
+
|
141 |
+
|
142 |
+
1.1. License
|
143 |
+
|
144 |
+
|
145 |
+
1.1.1. License Grant
|
146 |
+
|
147 |
+
Subject to the terms of this Agreement, NVIDIA hereby grants
|
148 |
+
you a non-exclusive, non-transferable license, without the
|
149 |
+
right to sublicense (except as expressly provided in this
|
150 |
+
Agreement) to:
|
151 |
+
|
152 |
+
1. Install and use the SDK,
|
153 |
+
|
154 |
+
2. Modify and create derivative works of sample source code
|
155 |
+
delivered in the SDK, and
|
156 |
+
|
157 |
+
3. Distribute those portions of the SDK that are identified
|
158 |
+
in this Agreement as distributable, as incorporated in
|
159 |
+
object code format into a software application that meets
|
160 |
+
the distribution requirements indicated in this Agreement.
|
161 |
+
|
162 |
+
|
163 |
+
1.1.2. Distribution Requirements
|
164 |
+
|
165 |
+
These are the distribution requirements for you to exercise
|
166 |
+
the distribution grant:
|
167 |
+
|
168 |
+
1. Your application must have material additional
|
169 |
+
functionality, beyond the included portions of the SDK.
|
170 |
+
|
171 |
+
2. The distributable portions of the SDK shall only be
|
172 |
+
accessed by your application.
|
173 |
+
|
174 |
+
3. The following notice shall be included in modifications
|
175 |
+
and derivative works of sample source code distributed:
|
176 |
+
“This software contains source code provided by NVIDIA
|
177 |
+
Corporation.”
|
178 |
+
|
179 |
+
4. Unless a developer tool is identified in this Agreement
|
180 |
+
as distributable, it is delivered for your internal use
|
181 |
+
only.
|
182 |
+
|
183 |
+
5. The terms under which you distribute your application
|
184 |
+
must be consistent with the terms of this Agreement,
|
185 |
+
including (without limitation) terms relating to the
|
186 |
+
license grant and license restrictions and protection of
|
187 |
+
NVIDIA’s intellectual property rights. Additionally, you
|
188 |
+
agree that you will protect the privacy, security and
|
189 |
+
legal rights of your application users.
|
190 |
+
|
191 |
+
6. You agree to notify NVIDIA in writing of any known or
|
192 |
+
suspected distribution or use of the SDK not in compliance
|
193 |
+
with the requirements of this Agreement, and to enforce
|
194 |
+
the terms of your agreements with respect to distributed
|
195 |
+
SDK.
|
196 |
+
|
197 |
+
|
198 |
+
1.1.3. Authorized Users
|
199 |
+
|
200 |
+
You may allow employees and contractors of your entity or of
|
201 |
+
your subsidiary(ies) to access and use the SDK from your
|
202 |
+
secure network to perform work on your behalf.
|
203 |
+
|
204 |
+
If you are an academic institution you may allow users
|
205 |
+
enrolled or employed by the academic institution to access and
|
206 |
+
use the SDK from your secure network.
|
207 |
+
|
208 |
+
You are responsible for the compliance with the terms of this
|
209 |
+
Agreement by your authorized users. If you become aware that
|
210 |
+
your authorized users didn’t follow the terms of this
|
211 |
+
Agreement, you agree to take reasonable steps to resolve the
|
212 |
+
non-compliance and prevent new occurrences.
|
213 |
+
|
214 |
+
|
215 |
+
1.1.4. Pre-Release SDK
|
216 |
+
|
217 |
+
The SDK versions identified as alpha, beta, preview or
|
218 |
+
otherwise as pre-release, may not be fully functional, may
|
219 |
+
contain errors or design flaws, and may have reduced or
|
220 |
+
different security, privacy, accessibility, availability, and
|
221 |
+
reliability standards relative to commercial versions of
|
222 |
+
NVIDIA software and materials. Use of a pre-release SDK may
|
223 |
+
result in unexpected results, loss of data, project delays or
|
224 |
+
other unpredictable damage or loss.
|
225 |
+
|
226 |
+
You may use a pre-release SDK at your own risk, understanding
|
227 |
+
that pre-release SDKs are not intended for use in production
|
228 |
+
or business-critical systems.
|
229 |
+
|
230 |
+
NVIDIA may choose not to make available a commercial version
|
231 |
+
of any pre-release SDK. NVIDIA may also choose to abandon
|
232 |
+
development and terminate the availability of a pre-release
|
233 |
+
SDK at any time without liability.
|
234 |
+
|
235 |
+
|
236 |
+
1.1.5. Updates
|
237 |
+
|
238 |
+
NVIDIA may, at its option, make available patches, workarounds
|
239 |
+
or other updates to this SDK. Unless the updates are provided
|
240 |
+
with their separate governing terms, they are deemed part of
|
241 |
+
the SDK licensed to you as provided in this Agreement. You
|
242 |
+
agree that the form and content of the SDK that NVIDIA
|
243 |
+
provides may change without prior notice to you. While NVIDIA
|
244 |
+
generally maintains compatibility between versions, NVIDIA may
|
245 |
+
in some cases make changes that introduce incompatibilities in
|
246 |
+
future versions of the SDK.
|
247 |
+
|
248 |
+
|
249 |
+
1.1.6. Third Party Licenses
|
250 |
+
|
251 |
+
The SDK may come bundled with, or otherwise include or be
|
252 |
+
distributed with, third party software licensed by a NVIDIA
|
253 |
+
supplier and/or open source software provided under an open
|
254 |
+
source license. Use of third party software is subject to the
|
255 |
+
third-party license terms, or in the absence of third party
|
256 |
+
terms, the terms of this Agreement. Copyright to third party
|
257 |
+
software is held by the copyright holders indicated in the
|
258 |
+
third-party software or license.
|
259 |
+
|
260 |
+
|
261 |
+
1.1.7. Reservation of Rights
|
262 |
+
|
263 |
+
NVIDIA reserves all rights, title, and interest in and to the
|
264 |
+
SDK, not expressly granted to you under this Agreement.
|
265 |
+
|
266 |
+
|
267 |
+
1.2. Limitations
|
268 |
+
|
269 |
+
The following license limitations apply to your use of the
|
270 |
+
SDK:
|
271 |
+
|
272 |
+
1. You may not reverse engineer, decompile or disassemble,
|
273 |
+
or remove copyright or other proprietary notices from any
|
274 |
+
portion of the SDK or copies of the SDK.
|
275 |
+
|
276 |
+
2. Except as expressly provided in this Agreement, you may
|
277 |
+
not copy, sell, rent, sublicense, transfer, distribute,
|
278 |
+
modify, or create derivative works of any portion of the
|
279 |
+
SDK. For clarity, you may not distribute or sublicense the
|
280 |
+
SDK as a stand-alone product.
|
281 |
+
|
282 |
+
3. Unless you have an agreement with NVIDIA for this
|
283 |
+
purpose, you may not indicate that an application created
|
284 |
+
with the SDK is sponsored or endorsed by NVIDIA.
|
285 |
+
|
286 |
+
4. You may not bypass, disable, or circumvent any
|
287 |
+
encryption, security, digital rights management or
|
288 |
+
authentication mechanism in the SDK.
|
289 |
+
|
290 |
+
5. You may not use the SDK in any manner that would cause it
|
291 |
+
to become subject to an open source software license. As
|
292 |
+
examples, licenses that require as a condition of use,
|
293 |
+
modification, and/or distribution that the SDK be:
|
294 |
+
|
295 |
+
a. Disclosed or distributed in source code form;
|
296 |
+
|
297 |
+
b. Licensed for the purpose of making derivative works;
|
298 |
+
or
|
299 |
+
|
300 |
+
c. Redistributable at no charge.
|
301 |
+
|
302 |
+
6. Unless you have an agreement with NVIDIA for this
|
303 |
+
purpose, you may not use the SDK with any system or
|
304 |
+
application where the use or failure of the system or
|
305 |
+
application can reasonably be expected to threaten or
|
306 |
+
result in personal injury, death, or catastrophic loss.
|
307 |
+
Examples include use in avionics, navigation, military,
|
308 |
+
medical, life support or other life critical applications.
|
309 |
+
NVIDIA does not design, test or manufacture the SDK for
|
310 |
+
these critical uses and NVIDIA shall not be liable to you
|
311 |
+
or any third party, in whole or in part, for any claims or
|
312 |
+
damages arising from such uses.
|
313 |
+
|
314 |
+
7. You agree to defend, indemnify and hold harmless NVIDIA
|
315 |
+
and its affiliates, and their respective employees,
|
316 |
+
contractors, agents, officers and directors, from and
|
317 |
+
against any and all claims, damages, obligations, losses,
|
318 |
+
liabilities, costs or debt, fines, restitutions and
|
319 |
+
expenses (including but not limited to attorney’s fees
|
320 |
+
and costs incident to establishing the right of
|
321 |
+
indemnification) arising out of or related to your use of
|
322 |
+
the SDK outside of the scope of this Agreement, or not in
|
323 |
+
compliance with its terms.
|
324 |
+
|
325 |
+
|
326 |
+
1.3. Ownership
|
327 |
+
|
328 |
+
1. NVIDIA or its licensors hold all rights, title and
|
329 |
+
interest in and to the SDK and its modifications and
|
330 |
+
derivative works, including their respective intellectual
|
331 |
+
property rights, subject to your rights described in this
|
332 |
+
section. This SDK may include software and materials from
|
333 |
+
NVIDIA’s licensors, and these licensors are intended
|
334 |
+
third party beneficiaries that may enforce this Agreement
|
335 |
+
with respect to their intellectual property rights.
|
336 |
+
|
337 |
+
2. You hold all rights, title and interest in and to your
|
338 |
+
applications and your derivative works of the sample
|
339 |
+
source code delivered in the SDK, including their
|
340 |
+
respective intellectual property rights, subject to
|
341 |
+
NVIDIA’s rights described in this section.
|
342 |
+
|
343 |
+
3. You may, but don’t have to, provide to NVIDIA
|
344 |
+
suggestions, feature requests or other feedback regarding
|
345 |
+
the SDK, including possible enhancements or modifications
|
346 |
+
to the SDK. For any feedback that you voluntarily provide,
|
347 |
+
you hereby grant NVIDIA and its affiliates a perpetual,
|
348 |
+
non-exclusive, worldwide, irrevocable license to use,
|
349 |
+
reproduce, modify, license, sublicense (through multiple
|
350 |
+
tiers of sublicensees), and distribute (through multiple
|
351 |
+
tiers of distributors) it without the payment of any
|
352 |
+
royalties or fees to you. NVIDIA will use feedback at its
|
353 |
+
choice. NVIDIA is constantly looking for ways to improve
|
354 |
+
its products, so you may send feedback to NVIDIA through
|
355 |
+
the developer portal at https://developer.nvidia.com.
|
356 |
+
|
357 |
+
|
358 |
+
1.4. No Warranties
|
359 |
+
|
360 |
+
THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL
|
361 |
+
FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND
|
362 |
+
ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND
|
363 |
+
OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
|
364 |
+
BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
|
365 |
+
FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE
|
366 |
+
ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO
|
367 |
+
WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF
|
368 |
+
DEALING OR COURSE OF TRADE.
|
369 |
+
|
370 |
+
|
371 |
+
1.5. Limitation of Liability
|
372 |
+
|
373 |
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS
|
374 |
+
AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
375 |
+
PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS
|
376 |
+
OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF
|
377 |
+
PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION
|
378 |
+
WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF THE SDK,
|
379 |
+
WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH
|
380 |
+
OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE),
|
381 |
+
PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF
|
382 |
+
LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES
|
383 |
+
TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS
|
384 |
+
AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE
|
385 |
+
NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS
|
386 |
+
LIMIT.
|
387 |
+
|
388 |
+
These exclusions and limitations of liability shall apply
|
389 |
+
regardless if NVIDIA or its affiliates have been advised of
|
390 |
+
the possibility of such damages, and regardless of whether a
|
391 |
+
remedy fails its essential purpose. These exclusions and
|
392 |
+
limitations of liability form an essential basis of the
|
393 |
+
bargain between the parties, and, absent any of these
|
394 |
+
exclusions or limitations of liability, the provisions of this
|
395 |
+
Agreement, including, without limitation, the economic terms,
|
396 |
+
would be substantially different.
|
397 |
+
|
398 |
+
|
399 |
+
1.6. Termination
|
400 |
+
|
401 |
+
1. This Agreement will continue to apply until terminated by
|
402 |
+
either you or NVIDIA as described below.
|
403 |
+
|
404 |
+
2. If you want to terminate this Agreement, you may do so by
|
405 |
+
stopping to use the SDK.
|
406 |
+
|
407 |
+
3. NVIDIA may, at any time, terminate this Agreement if:
|
408 |
+
|
409 |
+
a. (i) you fail to comply with any term of this
|
410 |
+
Agreement and the non-compliance is not fixed within
|
411 |
+
thirty (30) days following notice from NVIDIA (or
|
412 |
+
immediately if you violate NVIDIA’s intellectual
|
413 |
+
property rights);
|
414 |
+
|
415 |
+
b. (ii) you commence or participate in any legal
|
416 |
+
proceeding against NVIDIA with respect to the SDK; or
|
417 |
+
|
418 |
+
c. (iii) NVIDIA decides to no longer provide the SDK in
|
419 |
+
a country or, in NVIDIA’s sole discretion, the
|
420 |
+
continued use of it is no longer commercially viable.
|
421 |
+
|
422 |
+
4. Upon any termination of this Agreement, you agree to
|
423 |
+
promptly discontinue use of the SDK and destroy all copies
|
424 |
+
in your possession or control. Your prior distributions in
|
425 |
+
accordance with this Agreement are not affected by the
|
426 |
+
termination of this Agreement. Upon written request, you
|
427 |
+
will certify in writing that you have complied with your
|
428 |
+
commitments under this section. Upon any termination of
|
429 |
+
this Agreement all provisions survive except for the
|
430 |
+
license grant provisions.
|
431 |
+
|
432 |
+
|
433 |
+
1.7. General
|
434 |
+
|
435 |
+
If you wish to assign this Agreement or your rights and
|
436 |
+
obligations, including by merger, consolidation, dissolution
|
437 |
+
or operation of law, contact NVIDIA to ask for permission. Any
|
438 |
+
attempted assignment not approved by NVIDIA in writing shall
|
439 |
+
be void and of no effect. NVIDIA may assign, delegate or
|
440 |
+
transfer this Agreement and its rights and obligations, and if
|
441 |
+
to a non-affiliate you will be notified.
|
442 |
+
|
443 |
+
You agree to cooperate with NVIDIA and provide reasonably
|
444 |
+
requested information to verify your compliance with this
|
445 |
+
Agreement.
|
446 |
+
|
447 |
+
This Agreement will be governed in all respects by the laws of
|
448 |
+
the United States and of the State of Delaware as those laws
|
449 |
+
are applied to contracts entered into and performed entirely
|
450 |
+
within Delaware by Delaware residents, without regard to the
|
451 |
+
conflicts of laws principles. The United Nations Convention on
|
452 |
+
Contracts for the International Sale of Goods is specifically
|
453 |
+
disclaimed. You agree to all terms of this Agreement in the
|
454 |
+
English language.
|
455 |
+
|
456 |
+
The state or federal courts residing in Santa Clara County,
|
457 |
+
California shall have exclusive jurisdiction over any dispute
|
458 |
+
or claim arising out of this Agreement. Notwithstanding this,
|
459 |
+
you agree that NVIDIA shall still be allowed to apply for
|
460 |
+
injunctive remedies or an equivalent type of urgent legal
|
461 |
+
relief in any jurisdiction.
|
462 |
+
|
463 |
+
If any court of competent jurisdiction determines that any
|
464 |
+
provision of this Agreement is illegal, invalid or
|
465 |
+
unenforceable, such provision will be construed as limited to
|
466 |
+
the extent necessary to be consistent with and fully
|
467 |
+
enforceable under the law and the remaining provisions will
|
468 |
+
remain in full force and effect. Unless otherwise specified,
|
469 |
+
remedies are cumulative.
|
470 |
+
|
471 |
+
Each party acknowledges and agrees that the other is an
|
472 |
+
independent contractor in the performance of this Agreement.
|
473 |
+
|
474 |
+
The SDK has been developed entirely at private expense and is
|
475 |
+
“commercial items” consisting of “commercial computer
|
476 |
+
software” and “commercial computer software
|
477 |
+
documentation” provided with RESTRICTED RIGHTS. Use,
|
478 |
+
duplication or disclosure by the U.S. Government or a U.S.
|
479 |
+
Government subcontractor is subject to the restrictions in
|
480 |
+
this Agreement pursuant to DFARS 227.7202-3(a) or as set forth
|
481 |
+
in subparagraphs (c)(1) and (2) of the Commercial Computer
|
482 |
+
Software - Restricted Rights clause at FAR 52.227-19, as
|
483 |
+
applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas
|
484 |
+
Expressway, Santa Clara, CA 95051.
|
485 |
+
|
486 |
+
The SDK is subject to United States export laws and
|
487 |
+
regulations. You agree that you will not ship, transfer or
|
488 |
+
export the SDK into any country, or use the SDK in any manner,
|
489 |
+
prohibited by the United States Bureau of Industry and
|
490 |
+
Security or economic sanctions regulations administered by the
|
491 |
+
U.S. Department of Treasury’s Office of Foreign Assets
|
492 |
+
Control (OFAC), or any applicable export laws, restrictions or
|
493 |
+
regulations. These laws include restrictions on destinations,
|
494 |
+
end users and end use. By accepting this Agreement, you
|
495 |
+
confirm that you are not a resident or citizen of any country
|
496 |
+
currently embargoed by the U.S. and that you are not otherwise
|
497 |
+
prohibited from receiving the SDK.
|
498 |
+
|
499 |
+
Any notice delivered by NVIDIA to you under this Agreement
|
500 |
+
will be delivered via mail, email or fax. You agree that any
|
501 |
+
notices that NVIDIA sends you electronically will satisfy any
|
502 |
+
legal communication requirements. Please direct your legal
|
503 |
+
notices or other correspondence to NVIDIA Corporation, 2788
|
504 |
+
San Tomas Expressway, Santa Clara, California 95051, United
|
505 |
+
States of America, Attention: Legal Department.
|
506 |
+
|
507 |
+
This Agreement and any exhibits incorporated into this
|
508 |
+
Agreement constitute the entire agreement of the parties with
|
509 |
+
respect to the subject matter of this Agreement and supersede
|
510 |
+
all prior negotiations or documentation exchanged between the
|
511 |
+
parties relating to this SDK license. Any additional and/or
|
512 |
+
conflicting terms on documents issued by you are null, void,
|
513 |
+
and invalid. Any amendment or waiver under this Agreement
|
514 |
+
shall be in writing and signed by representatives of both
|
515 |
+
parties.
|
516 |
+
|
517 |
+
|
518 |
+
2. CUDA Toolkit Supplement to Software License Agreement for
|
519 |
+
NVIDIA Software Development Kits
|
520 |
+
------------------------------------------------------------
|
521 |
+
|
522 |
+
|
523 |
+
Release date: August 16, 2018
|
524 |
+
-----------------------------
|
525 |
+
|
526 |
+
The terms in this supplement govern your use of the NVIDIA
|
527 |
+
CUDA Toolkit SDK under the terms of your license agreement
|
528 |
+
(“Agreement”) as modified by this supplement. Capitalized
|
529 |
+
terms used but not defined below have the meaning assigned to
|
530 |
+
them in the Agreement.
|
531 |
+
|
532 |
+
This supplement is an exhibit to the Agreement and is
|
533 |
+
incorporated as an integral part of the Agreement. In the
|
534 |
+
event of conflict between the terms in this supplement and the
|
535 |
+
terms in the Agreement, the terms in this supplement govern.
|
536 |
+
|
537 |
+
|
538 |
+
2.1. License Scope
|
539 |
+
|
540 |
+
The SDK is licensed for you to develop applications only for
|
541 |
+
use in systems with NVIDIA GPUs.
|
542 |
+
|
543 |
+
|
544 |
+
2.2. Distribution
|
545 |
+
|
546 |
+
The portions of the SDK that are distributable under the
|
547 |
+
Agreement are listed in Attachment A.
|
548 |
+
|
549 |
+
|
550 |
+
2.3. Operating Systems
|
551 |
+
|
552 |
+
Those portions of the SDK designed exclusively for use on the
|
553 |
+
Linux or FreeBSD operating systems, or other operating systems
|
554 |
+
derived from the source code to these operating systems, may
|
555 |
+
be copied and redistributed for use in accordance with this
|
556 |
+
Agreement, provided that the object code files are not
|
557 |
+
modified in any way (except for unzipping of compressed
|
558 |
+
files).
|
559 |
+
|
560 |
+
|
561 |
+
2.4. Audio and Video Encoders and Decoders
|
562 |
+
|
563 |
+
You acknowledge and agree that it is your sole responsibility
|
564 |
+
to obtain any additional third-party licenses required to
|
565 |
+
make, have made, use, have used, sell, import, and offer for
|
566 |
+
sale your products or services that include or incorporate any
|
567 |
+
third-party software and content relating to audio and/or
|
568 |
+
video encoders and decoders from, including but not limited
|
569 |
+
to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A.,
|
570 |
+
MPEG-LA, and Coding Technologies. NVIDIA does not grant to you
|
571 |
+
under this Agreement any necessary patent or other rights with
|
572 |
+
respect to any audio and/or video encoders and decoders.
|
573 |
+
|
574 |
+
|
575 |
+
2.5. Licensing
|
576 |
+
|
577 |
+
If the distribution terms in this Agreement are not suitable
|
578 |
+
for your organization, or for any questions regarding this
|
579 |
+
Agreement, please contact NVIDIA at
|
580 | |
581 |
+
|
582 |
+
|
583 |
+
2.6. Attachment A
|
584 |
+
|
585 |
+
The following portions of the SDK are distributable under the
|
586 |
+
Agreement:
|
587 |
+
|
588 |
+
Component
|
589 |
+
|
590 |
+
CUDA Runtime
|
591 |
+
|
592 |
+
Windows
|
593 |
+
|
594 |
+
cudart.dll, cudart_static.lib, cudadevrt.lib
|
595 |
+
|
596 |
+
Mac OSX
|
597 |
+
|
598 |
+
libcudart.dylib, libcudart_static.a, libcudadevrt.a
|
599 |
+
|
600 |
+
Linux
|
601 |
+
|
602 |
+
libcudart.so, libcudart_static.a, libcudadevrt.a
|
603 |
+
|
604 |
+
Android
|
605 |
+
|
606 |
+
libcudart.so, libcudart_static.a, libcudadevrt.a
|
607 |
+
|
608 |
+
Component
|
609 |
+
|
610 |
+
CUDA FFT Library
|
611 |
+
|
612 |
+
Windows
|
613 |
+
|
614 |
+
cufft.dll, cufftw.dll, cufft.lib, cufftw.lib
|
615 |
+
|
616 |
+
Mac OSX
|
617 |
+
|
618 |
+
libcufft.dylib, libcufft_static.a, libcufftw.dylib,
|
619 |
+
libcufftw_static.a
|
620 |
+
|
621 |
+
Linux
|
622 |
+
|
623 |
+
libcufft.so, libcufft_static.a, libcufftw.so,
|
624 |
+
libcufftw_static.a
|
625 |
+
|
626 |
+
Android
|
627 |
+
|
628 |
+
libcufft.so, libcufft_static.a, libcufftw.so,
|
629 |
+
libcufftw_static.a
|
630 |
+
|
631 |
+
Component
|
632 |
+
|
633 |
+
CUDA BLAS Library
|
634 |
+
|
635 |
+
Windows
|
636 |
+
|
637 |
+
cublas.dll, cublasLt.dll
|
638 |
+
|
639 |
+
Mac OSX
|
640 |
+
|
641 |
+
libcublas.dylib, libcublasLt.dylib, libcublas_static.a,
|
642 |
+
libcublasLt_static.a
|
643 |
+
|
644 |
+
Linux
|
645 |
+
|
646 |
+
libcublas.so, libcublasLt.so, libcublas_static.a,
|
647 |
+
libcublasLt_static.a
|
648 |
+
|
649 |
+
Android
|
650 |
+
|
651 |
+
libcublas.so, libcublasLt.so, libcublas_static.a,
|
652 |
+
libcublasLt_static.a
|
653 |
+
|
654 |
+
Component
|
655 |
+
|
656 |
+
NVIDIA "Drop-in" BLAS Library
|
657 |
+
|
658 |
+
Windows
|
659 |
+
|
660 |
+
nvblas.dll
|
661 |
+
|
662 |
+
Mac OSX
|
663 |
+
|
664 |
+
libnvblas.dylib
|
665 |
+
|
666 |
+
Linux
|
667 |
+
|
668 |
+
libnvblas.so
|
669 |
+
|
670 |
+
Component
|
671 |
+
|
672 |
+
CUDA Sparse Matrix Library
|
673 |
+
|
674 |
+
Windows
|
675 |
+
|
676 |
+
cusparse.dll, cusparse.lib
|
677 |
+
|
678 |
+
Mac OSX
|
679 |
+
|
680 |
+
libcusparse.dylib, libcusparse_static.a
|
681 |
+
|
682 |
+
Linux
|
683 |
+
|
684 |
+
libcusparse.so, libcusparse_static.a
|
685 |
+
|
686 |
+
Android
|
687 |
+
|
688 |
+
libcusparse.so, libcusparse_static.a
|
689 |
+
|
690 |
+
Component
|
691 |
+
|
692 |
+
CUDA Linear Solver Library
|
693 |
+
|
694 |
+
Windows
|
695 |
+
|
696 |
+
cusolver.dll, cusolver.lib
|
697 |
+
|
698 |
+
Mac OSX
|
699 |
+
|
700 |
+
libcusolver.dylib, libcusolver_static.a
|
701 |
+
|
702 |
+
Linux
|
703 |
+
|
704 |
+
libcusolver.so, libcusolver_static.a
|
705 |
+
|
706 |
+
Android
|
707 |
+
|
708 |
+
libcusolver.so, libcusolver_static.a
|
709 |
+
|
710 |
+
Component
|
711 |
+
|
712 |
+
CUDA Random Number Generation Library
|
713 |
+
|
714 |
+
Windows
|
715 |
+
|
716 |
+
curand.dll, curand.lib
|
717 |
+
|
718 |
+
Mac OSX
|
719 |
+
|
720 |
+
libcurand.dylib, libcurand_static.a
|
721 |
+
|
722 |
+
Linux
|
723 |
+
|
724 |
+
libcurand.so, libcurand_static.a
|
725 |
+
|
726 |
+
Android
|
727 |
+
|
728 |
+
libcurand.so, libcurand_static.a
|
729 |
+
|
730 |
+
Component
|
731 |
+
|
732 |
+
CUDA Accelerated Graph Library
|
733 |
+
|
734 |
+
Component
|
735 |
+
|
736 |
+
NVIDIA Performance Primitives Library
|
737 |
+
|
738 |
+
Windows
|
739 |
+
|
740 |
+
nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll,
|
741 |
+
nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll,
|
742 |
+
nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib,
|
743 |
+
nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll,
|
744 |
+
nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib
|
745 |
+
|
746 |
+
Mac OSX
|
747 |
+
|
748 |
+
libnppc.dylib, libnppc_static.a, libnppial.dylib,
|
749 |
+
libnppial_static.a, libnppicc.dylib, libnppicc_static.a,
|
750 |
+
libnppicom.dylib, libnppicom_static.a, libnppidei.dylib,
|
751 |
+
libnppidei_static.a, libnppif.dylib, libnppif_static.a,
|
752 |
+
libnppig.dylib, libnppig_static.a, libnppim.dylib,
|
753 |
+
libnppisu_static.a, libnppitc.dylib, libnppitc_static.a,
|
754 |
+
libnpps.dylib, libnpps_static.a
|
755 |
+
|
756 |
+
Linux
|
757 |
+
|
758 |
+
libnppc.so, libnppc_static.a, libnppial.so,
|
759 |
+
libnppial_static.a, libnppicc.so, libnppicc_static.a,
|
760 |
+
libnppicom.so, libnppicom_static.a, libnppidei.so,
|
761 |
+
libnppidei_static.a, libnppif.so, libnppif_static.a
|
762 |
+
libnppig.so, libnppig_static.a, libnppim.so,
|
763 |
+
libnppim_static.a, libnppist.so, libnppist_static.a,
|
764 |
+
libnppisu.so, libnppisu_static.a, libnppitc.so
|
765 |
+
libnppitc_static.a, libnpps.so, libnpps_static.a
|
766 |
+
|
767 |
+
Android
|
768 |
+
|
769 |
+
libnppc.so, libnppc_static.a, libnppial.so,
|
770 |
+
libnppial_static.a, libnppicc.so, libnppicc_static.a,
|
771 |
+
libnppicom.so, libnppicom_static.a, libnppidei.so,
|
772 |
+
libnppidei_static.a, libnppif.so, libnppif_static.a
|
773 |
+
libnppig.so, libnppig_static.a, libnppim.so,
|
774 |
+
libnppim_static.a, libnppist.so, libnppist_static.a,
|
775 |
+
libnppisu.so, libnppisu_static.a, libnppitc.so
|
776 |
+
libnppitc_static.a, libnpps.so, libnpps_static.a
|
777 |
+
|
778 |
+
Component
|
779 |
+
|
780 |
+
NVIDIA JPEG Library
|
781 |
+
|
782 |
+
Linux
|
783 |
+
|
784 |
+
libnvjpeg.so, libnvjpeg_static.a
|
785 |
+
|
786 |
+
Component
|
787 |
+
|
788 |
+
Internal common library required for statically linking to
|
789 |
+
cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP
|
790 |
+
|
791 |
+
Mac OSX
|
792 |
+
|
793 |
+
libculibos.a
|
794 |
+
|
795 |
+
Linux
|
796 |
+
|
797 |
+
libculibos.a
|
798 |
+
|
799 |
+
Component
|
800 |
+
|
801 |
+
NVIDIA Runtime Compilation Library and Header
|
802 |
+
|
803 |
+
All
|
804 |
+
|
805 |
+
nvrtc.h
|
806 |
+
|
807 |
+
Windows
|
808 |
+
|
809 |
+
nvrtc.dll, nvrtc-builtins.dll
|
810 |
+
|
811 |
+
Mac OSX
|
812 |
+
|
813 |
+
libnvrtc.dylib, libnvrtc-builtins.dylib
|
814 |
+
|
815 |
+
Linux
|
816 |
+
|
817 |
+
libnvrtc.so, libnvrtc-builtins.so
|
818 |
+
|
819 |
+
Component
|
820 |
+
|
821 |
+
NVIDIA Optimizing Compiler Library
|
822 |
+
|
823 |
+
Windows
|
824 |
+
|
825 |
+
nvvm.dll
|
826 |
+
|
827 |
+
Mac OSX
|
828 |
+
|
829 |
+
libnvvm.dylib
|
830 |
+
|
831 |
+
Linux
|
832 |
+
|
833 |
+
libnvvm.so
|
834 |
+
|
835 |
+
Component
|
836 |
+
|
837 |
+
NVIDIA Common Device Math Functions Library
|
838 |
+
|
839 |
+
Windows
|
840 |
+
|
841 |
+
libdevice.10.bc
|
842 |
+
|
843 |
+
Mac OSX
|
844 |
+
|
845 |
+
libdevice.10.bc
|
846 |
+
|
847 |
+
Linux
|
848 |
+
|
849 |
+
libdevice.10.bc
|
850 |
+
|
851 |
+
Component
|
852 |
+
|
853 |
+
CUDA Occupancy Calculation Header Library
|
854 |
+
|
855 |
+
All
|
856 |
+
|
857 |
+
cuda_occupancy.h
|
858 |
+
|
859 |
+
Component
|
860 |
+
|
861 |
+
CUDA Half Precision Headers
|
862 |
+
|
863 |
+
All
|
864 |
+
|
865 |
+
cuda_fp16.h, cuda_fp16.hpp
|
866 |
+
|
867 |
+
Component
|
868 |
+
|
869 |
+
CUDA Profiling Tools Interface (CUPTI) Library
|
870 |
+
|
871 |
+
Windows
|
872 |
+
|
873 |
+
cupti.dll
|
874 |
+
|
875 |
+
Mac OSX
|
876 |
+
|
877 |
+
libcupti.dylib
|
878 |
+
|
879 |
+
Linux
|
880 |
+
|
881 |
+
libcupti.so
|
882 |
+
|
883 |
+
Component
|
884 |
+
|
885 |
+
NVIDIA Tools Extension Library
|
886 |
+
|
887 |
+
Windows
|
888 |
+
|
889 |
+
nvToolsExt.dll, nvToolsExt.lib
|
890 |
+
|
891 |
+
Mac OSX
|
892 |
+
|
893 |
+
libnvToolsExt.dylib
|
894 |
+
|
895 |
+
Linux
|
896 |
+
|
897 |
+
libnvToolsExt.so
|
898 |
+
|
899 |
+
Component
|
900 |
+
|
901 |
+
NVIDIA CUDA Driver Libraries
|
902 |
+
|
903 |
+
Linux
|
904 |
+
|
905 |
+
libcuda.so, libnvidia-fatbinaryloader.so,
|
906 |
+
libnvidia-ptxjitcompiler.so
|
907 |
+
|
908 |
+
The NVIDIA CUDA Driver Libraries are only distributable in
|
909 |
+
applications that meet this criteria:
|
910 |
+
|
911 |
+
1. The application was developed starting from a NVIDIA CUDA
|
912 |
+
container obtained from Docker Hub or the NVIDIA GPU
|
913 |
+
Cloud, and
|
914 |
+
|
915 |
+
2. The resulting application is packaged as a Docker
|
916 |
+
container and distributed to users on Docker Hub or the
|
917 |
+
NVIDIA GPU Cloud only.
|
918 |
+
|
919 |
+
|
920 |
+
2.7. Attachment B
|
921 |
+
|
922 |
+
|
923 |
+
Additional Licensing Obligations
|
924 |
+
|
925 |
+
The following third party components included in the SOFTWARE
|
926 |
+
are licensed to Licensee pursuant to the following terms and
|
927 |
+
conditions:
|
928 |
+
|
929 |
+
1. Licensee's use of the GDB third party component is
|
930 |
+
subject to the terms and conditions of GNU GPL v3:
|
931 |
+
|
932 |
+
This product includes copyrighted third-party software licensed
|
933 |
+
under the terms of the GNU General Public License v3 ("GPL v3").
|
934 |
+
All third-party software packages are copyright by their respective
|
935 |
+
authors. GPL v3 terms and conditions are hereby incorporated into
|
936 |
+
the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt
|
937 |
+
|
938 |
+
Consistent with these licensing requirements, the software
|
939 |
+
listed below is provided under the terms of the specified
|
940 |
+
open source software licenses. To obtain source code for
|
941 |
+
software provided under licenses that require
|
942 |
+
redistribution of source code, including the GNU General
|
943 |
+
Public License (GPL) and GNU Lesser General Public License
|
944 |
+
(LGPL), contact [email protected]. This offer is
|
945 |
+
valid for a period of three (3) years from the date of the
|
946 |
+
distribution of this product by NVIDIA CORPORATION.
|
947 |
+
|
948 |
+
Component License
|
949 |
+
CUDA-GDB GPL v3
|
950 |
+
|
951 |
+
2. Licensee represents and warrants that any and all third
|
952 |
+
party licensing and/or royalty payment obligations in
|
953 |
+
connection with Licensee's use of the H.264 video codecs
|
954 |
+
are solely the responsibility of Licensee.
|
955 |
+
|
956 |
+
3. Licensee's use of the Thrust library is subject to the
|
957 |
+
terms and conditions of the Apache License Version 2.0.
|
958 |
+
All third-party software packages are copyright by their
|
959 |
+
respective authors. Apache License Version 2.0 terms and
|
960 |
+
conditions are hereby incorporated into the Agreement by
|
961 |
+
this reference.
|
962 |
+
http://www.apache.org/licenses/LICENSE-2.0.html
|
963 |
+
|
964 |
+
In addition, Licensee acknowledges the following notice:
|
965 |
+
Thrust includes source code from the Boost Iterator,
|
966 |
+
Tuple, System, and Random Number libraries.
|
967 |
+
|
968 |
+
Boost Software License - Version 1.0 - August 17th, 2003
|
969 |
+
. . . .
|
970 |
+
|
971 |
+
Permission is hereby granted, free of charge, to any person or
|
972 |
+
organization obtaining a copy of the software and accompanying
|
973 |
+
documentation covered by this license (the "Software") to use,
|
974 |
+
reproduce, display, distribute, execute, and transmit the Software,
|
975 |
+
and to prepare derivative works of the Software, and to permit
|
976 |
+
third-parties to whom the Software is furnished to do so, all
|
977 |
+
subject to the following:
|
978 |
+
|
979 |
+
The copyright notices in the Software and this entire statement,
|
980 |
+
including the above license grant, this restriction and the following
|
981 |
+
disclaimer, must be included in all copies of the Software, in whole
|
982 |
+
or in part, and all derivative works of the Software, unless such
|
983 |
+
copies or derivative works are solely in the form of machine-executable
|
984 |
+
object code generated by a source language processor.
|
985 |
+
|
986 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
987 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
988 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
989 |
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
990 |
+
ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
|
991 |
+
OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
|
992 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
993 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
994 |
+
|
995 |
+
4. Licensee's use of the LLVM third party component is
|
996 |
+
subject to the following terms and conditions:
|
997 |
+
|
998 |
+
======================================================
|
999 |
+
LLVM Release License
|
1000 |
+
======================================================
|
1001 |
+
University of Illinois/NCSA
|
1002 |
+
Open Source License
|
1003 |
+
|
1004 |
+
Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
|
1005 |
+
All rights reserved.
|
1006 |
+
|
1007 |
+
Developed by:
|
1008 |
+
|
1009 |
+
LLVM Team
|
1010 |
+
|
1011 |
+
University of Illinois at Urbana-Champaign
|
1012 |
+
|
1013 |
+
http://llvm.org
|
1014 |
+
|
1015 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
1016 |
+
of this software and associated documentation files (the "Software"), to
|
1017 |
+
deal with the Software without restriction, including without limitation the
|
1018 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
1019 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
1020 |
+
furnished to do so, subject to the following conditions:
|
1021 |
+
|
1022 |
+
* Redistributions of source code must retain the above copyright notice,
|
1023 |
+
this list of conditions and the following disclaimers.
|
1024 |
+
|
1025 |
+
* Redistributions in binary form must reproduce the above copyright
|
1026 |
+
notice, this list of conditions and the following disclaimers in the
|
1027 |
+
documentation and/or other materials provided with the distribution.
|
1028 |
+
|
1029 |
+
* Neither the names of the LLVM Team, University of Illinois at Urbana-
|
1030 |
+
Champaign, nor the names of its contributors may be used to endorse or
|
1031 |
+
promote products derived from this Software without specific prior
|
1032 |
+
written permission.
|
1033 |
+
|
1034 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1035 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1036 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
1037 |
+
THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
1038 |
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
1039 |
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
1040 |
+
DEALINGS WITH THE SOFTWARE.
|
1041 |
+
|
1042 |
+
5. Licensee's use (e.g. nvprof) of the PCRE third party
|
1043 |
+
component is subject to the following terms and
|
1044 |
+
conditions:
|
1045 |
+
|
1046 |
+
------------
|
1047 |
+
PCRE LICENCE
|
1048 |
+
------------
|
1049 |
+
PCRE is a library of functions to support regular expressions whose syntax
|
1050 |
+
and semantics are as close as possible to those of the Perl 5 language.
|
1051 |
+
Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
|
1052 |
+
specified below. The documentation for PCRE, supplied in the "doc"
|
1053 |
+
directory, is distributed under the same terms as the software itself. The
|
1054 |
+
basic library functions are written in C and are freestanding. Also
|
1055 |
+
included in the distribution is a set of C++ wrapper functions, and a just-
|
1056 |
+
in-time compiler that can be used to optimize pattern matching. These are
|
1057 |
+
both optional features that can be omitted when the library is built.
|
1058 |
+
|
1059 |
+
THE BASIC LIBRARY FUNCTIONS
|
1060 |
+
---------------------------
|
1061 |
+
Written by: Philip Hazel
|
1062 |
+
Email local part: ph10
|
1063 |
+
Email domain: cam.ac.uk
|
1064 |
+
University of Cambridge Computing Service,
|
1065 |
+
Cambridge, England.
|
1066 |
+
Copyright (c) 1997-2012 University of Cambridge
|
1067 |
+
All rights reserved.
|
1068 |
+
|
1069 |
+
PCRE JUST-IN-TIME COMPILATION SUPPORT
|
1070 |
+
-------------------------------------
|
1071 |
+
Written by: Zoltan Herczeg
|
1072 |
+
Email local part: hzmester
|
1073 |
+
Emain domain: freemail.hu
|
1074 |
+
Copyright(c) 2010-2012 Zoltan Herczeg
|
1075 |
+
All rights reserved.
|
1076 |
+
|
1077 |
+
STACK-LESS JUST-IN-TIME COMPILER
|
1078 |
+
--------------------------------
|
1079 |
+
Written by: Zoltan Herczeg
|
1080 |
+
Email local part: hzmester
|
1081 |
+
Emain domain: freemail.hu
|
1082 |
+
Copyright(c) 2009-2012 Zoltan Herczeg
|
1083 |
+
All rights reserved.
|
1084 |
+
|
1085 |
+
THE C++ WRAPPER FUNCTIONS
|
1086 |
+
-------------------------
|
1087 |
+
Contributed by: Google Inc.
|
1088 |
+
Copyright (c) 2007-2012, Google Inc.
|
1089 |
+
All rights reserved.
|
1090 |
+
|
1091 |
+
THE "BSD" LICENCE
|
1092 |
+
-----------------
|
1093 |
+
Redistribution and use in source and binary forms, with or without
|
1094 |
+
modification, are permitted provided that the following conditions are met:
|
1095 |
+
|
1096 |
+
* Redistributions of source code must retain the above copyright notice,
|
1097 |
+
this list of conditions and the following disclaimer.
|
1098 |
+
|
1099 |
+
* Redistributions in binary form must reproduce the above copyright
|
1100 |
+
notice, this list of conditions and the following disclaimer in the
|
1101 |
+
documentation and/or other materials provided with the distribution.
|
1102 |
+
|
1103 |
+
* Neither the name of the University of Cambridge nor the name of Google
|
1104 |
+
Inc. nor the names of their contributors may be used to endorse or
|
1105 |
+
promote products derived from this software without specific prior
|
1106 |
+
written permission.
|
1107 |
+
|
1108 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
1109 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
1110 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
1111 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
1112 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1113 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
1114 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
1115 |
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
1116 |
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
1117 |
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1118 |
+
POSSIBILITY OF SUCH DAMAGE.
|
1119 |
+
|
1120 |
+
6. Some of the cuBLAS library routines were written by or
|
1121 |
+
derived from code written by Vasily Volkov and are subject
|
1122 |
+
to the Modified Berkeley Software Distribution License as
|
1123 |
+
follows:
|
1124 |
+
|
1125 |
+
Copyright (c) 2007-2009, Regents of the University of California
|
1126 |
+
|
1127 |
+
All rights reserved.
|
1128 |
+
|
1129 |
+
Redistribution and use in source and binary forms, with or without
|
1130 |
+
modification, are permitted provided that the following conditions are
|
1131 |
+
met:
|
1132 |
+
* Redistributions of source code must retain the above copyright
|
1133 |
+
notice, this list of conditions and the following disclaimer.
|
1134 |
+
* Redistributions in binary form must reproduce the above
|
1135 |
+
copyright notice, this list of conditions and the following
|
1136 |
+
disclaimer in the documentation and/or other materials provided
|
1137 |
+
with the distribution.
|
1138 |
+
* Neither the name of the University of California, Berkeley nor
|
1139 |
+
the names of its contributors may be used to endorse or promote
|
1140 |
+
products derived from this software without specific prior
|
1141 |
+
written permission.
|
1142 |
+
|
1143 |
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
1144 |
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
1145 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
1146 |
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
1147 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
1148 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
1149 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
1150 |
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
1151 |
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
1152 |
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1153 |
+
POSSIBILITY OF SUCH DAMAGE.
|
1154 |
+
|
1155 |
+
7. Some of the cuBLAS library routines were written by or
|
1156 |
+
derived from code written by Davide Barbieri and are
|
1157 |
+
subject to the Modified Berkeley Software Distribution
|
1158 |
+
License as follows:
|
1159 |
+
|
1160 |
+
Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata.
|
1161 |
+
|
1162 |
+
All rights reserved.
|
1163 |
+
|
1164 |
+
Redistribution and use in source and binary forms, with or without
|
1165 |
+
modification, are permitted provided that the following conditions are
|
1166 |
+
met:
|
1167 |
+
* Redistributions of source code must retain the above copyright
|
1168 |
+
notice, this list of conditions and the following disclaimer.
|
1169 |
+
* Redistributions in binary form must reproduce the above
|
1170 |
+
copyright notice, this list of conditions and the following
|
1171 |
+
disclaimer in the documentation and/or other materials provided
|
1172 |
+
with the distribution.
|
1173 |
+
* The name of the author may not be used to endorse or promote
|
1174 |
+
products derived from this software without specific prior
|
1175 |
+
written permission.
|
1176 |
+
|
1177 |
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
1178 |
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
1179 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
1180 |
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
1181 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
1182 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
1183 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
1184 |
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
1185 |
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
1186 |
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1187 |
+
POSSIBILITY OF SUCH DAMAGE.
|
1188 |
+
|
1189 |
+
8. Some of the cuBLAS library routines were derived from
|
1190 |
+
code developed by the University of Tennessee and are
|
1191 |
+
subject to the Modified Berkeley Software Distribution
|
1192 |
+
License as follows:
|
1193 |
+
|
1194 |
+
Copyright (c) 2010 The University of Tennessee.
|
1195 |
+
|
1196 |
+
All rights reserved.
|
1197 |
+
|
1198 |
+
Redistribution and use in source and binary forms, with or without
|
1199 |
+
modification, are permitted provided that the following conditions are
|
1200 |
+
met:
|
1201 |
+
* Redistributions of source code must retain the above copyright
|
1202 |
+
notice, this list of conditions and the following disclaimer.
|
1203 |
+
* Redistributions in binary form must reproduce the above
|
1204 |
+
copyright notice, this list of conditions and the following
|
1205 |
+
disclaimer listed in this license in the documentation and/or
|
1206 |
+
other materials provided with the distribution.
|
1207 |
+
* Neither the name of the copyright holders nor the names of its
|
1208 |
+
contributors may be used to endorse or promote products derived
|
1209 |
+
from this software without specific prior written permission.
|
1210 |
+
|
1211 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1212 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1213 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1214 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1215 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1216 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1217 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1218 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1219 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1220 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1221 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1222 |
+
|
1223 |
+
9. Some of the cuBLAS library routines were written by or
|
1224 |
+
derived from code written by Jonathan Hogg and are subject
|
1225 |
+
to the Modified Berkeley Software Distribution License as
|
1226 |
+
follows:
|
1227 |
+
|
1228 |
+
Copyright (c) 2012, The Science and Technology Facilities Council (STFC).
|
1229 |
+
|
1230 |
+
All rights reserved.
|
1231 |
+
|
1232 |
+
Redistribution and use in source and binary forms, with or without
|
1233 |
+
modification, are permitted provided that the following conditions are
|
1234 |
+
met:
|
1235 |
+
* Redistributions of source code must retain the above copyright
|
1236 |
+
notice, this list of conditions and the following disclaimer.
|
1237 |
+
* Redistributions in binary form must reproduce the above
|
1238 |
+
copyright notice, this list of conditions and the following
|
1239 |
+
disclaimer in the documentation and/or other materials provided
|
1240 |
+
with the distribution.
|
1241 |
+
* Neither the name of the STFC nor the names of its contributors
|
1242 |
+
may be used to endorse or promote products derived from this
|
1243 |
+
software without specific prior written permission.
|
1244 |
+
|
1245 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1246 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1247 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1248 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE
|
1249 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1250 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
1251 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
1252 |
+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
1253 |
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
1254 |
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
1255 |
+
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1256 |
+
|
1257 |
+
10. Some of the cuBLAS library routines were written by or
|
1258 |
+
derived from code written by Ahmad M. Abdelfattah, David
|
1259 |
+
Keyes, and Hatem Ltaief, and are subject to the Apache
|
1260 |
+
License, Version 2.0, as follows:
|
1261 |
+
|
1262 |
+
-- (C) Copyright 2013 King Abdullah University of Science and Technology
|
1263 |
+
Authors:
|
1264 |
+
Ahmad Abdelfattah ([email protected])
|
1265 |
+
David Keyes ([email protected])
|
1266 |
+
Hatem Ltaief ([email protected])
|
1267 |
+
|
1268 |
+
Redistribution and use in source and binary forms, with or without
|
1269 |
+
modification, are permitted provided that the following conditions
|
1270 |
+
are met:
|
1271 |
+
|
1272 |
+
* Redistributions of source code must retain the above copyright
|
1273 |
+
notice, this list of conditions and the following disclaimer.
|
1274 |
+
* Redistributions in binary form must reproduce the above copyright
|
1275 |
+
notice, this list of conditions and the following disclaimer in the
|
1276 |
+
documentation and/or other materials provided with the distribution.
|
1277 |
+
* Neither the name of the King Abdullah University of Science and
|
1278 |
+
Technology nor the names of its contributors may be used to endorse
|
1279 |
+
or promote products derived from this software without specific prior
|
1280 |
+
written permission.
|
1281 |
+
|
1282 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1283 |
+
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1284 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1285 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1286 |
+
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1287 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1288 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1289 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1290 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1291 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1292 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
1293 |
+
|
1294 |
+
11. Some of the cuSPARSE library routines were written by or
|
1295 |
+
derived from code written by Li-Wen Chang and are subject
|
1296 |
+
to the NCSA Open Source License as follows:
|
1297 |
+
|
1298 |
+
Copyright (c) 2012, University of Illinois.
|
1299 |
+
|
1300 |
+
All rights reserved.
|
1301 |
+
|
1302 |
+
Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu
|
1303 |
+
|
1304 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
1305 |
+
a copy of this software and associated documentation files (the
|
1306 |
+
"Software"), to deal with the Software without restriction, including
|
1307 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
1308 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
1309 |
+
permit persons to whom the Software is furnished to do so, subject to
|
1310 |
+
the following conditions:
|
1311 |
+
* Redistributions of source code must retain the above copyright
|
1312 |
+
notice, this list of conditions and the following disclaimer.
|
1313 |
+
* Redistributions in binary form must reproduce the above
|
1314 |
+
copyright notice, this list of conditions and the following
|
1315 |
+
disclaimers in the documentation and/or other materials provided
|
1316 |
+
with the distribution.
|
1317 |
+
* Neither the names of IMPACT Group, University of Illinois, nor
|
1318 |
+
the names of its contributors may be used to endorse or promote
|
1319 |
+
products derived from this Software without specific prior
|
1320 |
+
written permission.
|
1321 |
+
|
1322 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
1323 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
1324 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
1325 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
|
1326 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
1327 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
1328 |
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
1329 |
+
SOFTWARE.
|
1330 |
+
|
1331 |
+
12. Some of the cuRAND library routines were written by or
|
1332 |
+
derived from code written by Mutsuo Saito and Makoto
|
1333 |
+
Matsumoto and are subject to the following license:
|
1334 |
+
|
1335 |
+
Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima
|
1336 |
+
University. All rights reserved.
|
1337 |
+
|
1338 |
+
Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima
|
1339 |
+
University and University of Tokyo. All rights reserved.
|
1340 |
+
|
1341 |
+
Redistribution and use in source and binary forms, with or without
|
1342 |
+
modification, are permitted provided that the following conditions are
|
1343 |
+
met:
|
1344 |
+
* Redistributions of source code must retain the above copyright
|
1345 |
+
notice, this list of conditions and the following disclaimer.
|
1346 |
+
* Redistributions in binary form must reproduce the above
|
1347 |
+
copyright notice, this list of conditions and the following
|
1348 |
+
disclaimer in the documentation and/or other materials provided
|
1349 |
+
with the distribution.
|
1350 |
+
* Neither the name of the Hiroshima University nor the names of
|
1351 |
+
its contributors may be used to endorse or promote products
|
1352 |
+
derived from this software without specific prior written
|
1353 |
+
permission.
|
1354 |
+
|
1355 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1356 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1357 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1358 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1359 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1360 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1361 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1362 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1363 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1364 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1365 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1366 |
+
|
1367 |
+
13. Some of the cuRAND library routines were derived from
|
1368 |
+
code developed by D. E. Shaw Research and are subject to
|
1369 |
+
the following license:
|
1370 |
+
|
1371 |
+
Copyright 2010-2011, D. E. Shaw Research.
|
1372 |
+
|
1373 |
+
All rights reserved.
|
1374 |
+
|
1375 |
+
Redistribution and use in source and binary forms, with or without
|
1376 |
+
modification, are permitted provided that the following conditions are
|
1377 |
+
met:
|
1378 |
+
* Redistributions of source code must retain the above copyright
|
1379 |
+
notice, this list of conditions, and the following disclaimer.
|
1380 |
+
* Redistributions in binary form must reproduce the above
|
1381 |
+
copyright notice, this list of conditions, and the following
|
1382 |
+
disclaimer in the documentation and/or other materials provided
|
1383 |
+
with the distribution.
|
1384 |
+
* Neither the name of D. E. Shaw Research nor the names of its
|
1385 |
+
contributors may be used to endorse or promote products derived
|
1386 |
+
from this software without specific prior written permission.
|
1387 |
+
|
1388 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1389 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1390 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1391 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1392 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1393 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1394 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1395 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1396 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1397 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1398 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1399 |
+
|
1400 |
+
14. Some of the Math library routines were written by or
|
1401 |
+
derived from code developed by Norbert Juffa and are
|
1402 |
+
subject to the following license:
|
1403 |
+
|
1404 |
+
Copyright (c) 2015-2017, Norbert Juffa
|
1405 |
+
All rights reserved.
|
1406 |
+
|
1407 |
+
Redistribution and use in source and binary forms, with or without
|
1408 |
+
modification, are permitted provided that the following conditions
|
1409 |
+
are met:
|
1410 |
+
|
1411 |
+
1. Redistributions of source code must retain the above copyright
|
1412 |
+
notice, this list of conditions and the following disclaimer.
|
1413 |
+
|
1414 |
+
2. Redistributions in binary form must reproduce the above copyright
|
1415 |
+
notice, this list of conditions and the following disclaimer in the
|
1416 |
+
documentation and/or other materials provided with the distribution.
|
1417 |
+
|
1418 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1419 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1420 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1421 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1422 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1423 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1424 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1425 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1426 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1427 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1428 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1429 |
+
|
1430 |
+
15. Licensee's use of the lz4 third party component is
|
1431 |
+
subject to the following terms and conditions:
|
1432 |
+
|
1433 |
+
Copyright (C) 2011-2013, Yann Collet.
|
1434 |
+
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
1435 |
+
|
1436 |
+
Redistribution and use in source and binary forms, with or without
|
1437 |
+
modification, are permitted provided that the following conditions are
|
1438 |
+
met:
|
1439 |
+
|
1440 |
+
* Redistributions of source code must retain the above copyright
|
1441 |
+
notice, this list of conditions and the following disclaimer.
|
1442 |
+
* Redistributions in binary form must reproduce the above
|
1443 |
+
copyright notice, this list of conditions and the following disclaimer
|
1444 |
+
in the documentation and/or other materials provided with the
|
1445 |
+
distribution.
|
1446 |
+
|
1447 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1448 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1449 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1450 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1451 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1452 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1453 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1454 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1455 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1456 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1457 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1458 |
+
|
1459 |
+
16. The NPP library uses code from the Boost Math Toolkit,
|
1460 |
+
and is subject to the following license:
|
1461 |
+
|
1462 |
+
Boost Software License - Version 1.0 - August 17th, 2003
|
1463 |
+
. . . .
|
1464 |
+
|
1465 |
+
Permission is hereby granted, free of charge, to any person or
|
1466 |
+
organization obtaining a copy of the software and accompanying
|
1467 |
+
documentation covered by this license (the "Software") to use,
|
1468 |
+
reproduce, display, distribute, execute, and transmit the Software,
|
1469 |
+
and to prepare derivative works of the Software, and to permit
|
1470 |
+
third-parties to whom the Software is furnished to do so, all
|
1471 |
+
subject to the following:
|
1472 |
+
|
1473 |
+
The copyright notices in the Software and this entire statement,
|
1474 |
+
including the above license grant, this restriction and the following
|
1475 |
+
disclaimer, must be included in all copies of the Software, in whole
|
1476 |
+
or in part, and all derivative works of the Software, unless such
|
1477 |
+
copies or derivative works are solely in the form of machine-executable
|
1478 |
+
object code generated by a source language processor.
|
1479 |
+
|
1480 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
1481 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
1482 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
1483 |
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
1484 |
+
ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
|
1485 |
+
OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
|
1486 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
1487 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
1488 |
+
|
1489 |
+
17. Portions of the Nsight Eclipse Edition is subject to the
|
1490 |
+
following license:
|
1491 |
+
|
1492 |
+
The Eclipse Foundation makes available all content in this plug-in
|
1493 |
+
("Content"). Unless otherwise indicated below, the Content is provided
|
1494 |
+
to you under the terms and conditions of the Eclipse Public License
|
1495 |
+
Version 1.0 ("EPL"). A copy of the EPL is available at http://
|
1496 |
+
www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program"
|
1497 |
+
will mean the Content.
|
1498 |
+
|
1499 |
+
If you did not receive this Content directly from the Eclipse
|
1500 |
+
Foundation, the Content is being redistributed by another party
|
1501 |
+
("Redistributor") and different terms and conditions may apply to your
|
1502 |
+
use of any object code in the Content. Check the Redistributor's
|
1503 |
+
license that was provided with the Content. If no such license exists,
|
1504 |
+
contact the Redistributor. Unless otherwise indicated below, the terms
|
1505 |
+
and conditions of the EPL still apply to any source code in the
|
1506 |
+
Content and such source code may be obtained at http://www.eclipse.org.
|
1507 |
+
|
1508 |
+
18. Some of the cuBLAS library routines uses code from
|
1509 |
+
OpenAI, which is subject to the following license:
|
1510 |
+
|
1511 |
+
License URL
|
1512 |
+
https://github.com/openai/openai-gemm/blob/master/LICENSE
|
1513 |
+
|
1514 |
+
License Text
|
1515 |
+
The MIT License
|
1516 |
+
|
1517 |
+
Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc.
|
1518 |
+
|
1519 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
1520 |
+
of this software and associated documentation files (the "Software"), to deal
|
1521 |
+
in the Software without restriction, including without limitation the rights
|
1522 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
1523 |
+
copies of the Software, and to permit persons to whom the Software is
|
1524 |
+
furnished to do so, subject to the following conditions:
|
1525 |
+
|
1526 |
+
The above copyright notice and this permission notice shall be included in
|
1527 |
+
all copies or substantial portions of the Software.
|
1528 |
+
|
1529 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1530 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1531 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1532 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1533 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1534 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1535 |
+
THE SOFTWARE.
|
1536 |
+
|
1537 |
+
19. Licensee's use of the Visual Studio Setup Configuration
|
1538 |
+
Samples is subject to the following license:
|
1539 |
+
|
1540 |
+
The MIT License (MIT)
|
1541 |
+
Copyright (C) Microsoft Corporation. All rights reserved.
|
1542 |
+
|
1543 |
+
Permission is hereby granted, free of charge, to any person
|
1544 |
+
obtaining a copy of this software and associated documentation
|
1545 |
+
files (the "Software"), to deal in the Software without restriction,
|
1546 |
+
including without limitation the rights to use, copy, modify, merge,
|
1547 |
+
publish, distribute, sublicense, and/or sell copies of the Software,
|
1548 |
+
and to permit persons to whom the Software is furnished to do so,
|
1549 |
+
subject to the following conditions:
|
1550 |
+
|
1551 |
+
The above copyright notice and this permission notice shall be included
|
1552 |
+
in all copies or substantial portions of the Software.
|
1553 |
+
|
1554 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
1555 |
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1556 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1557 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1558 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1559 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1560 |
+
|
1561 |
+
20. Licensee's use of linmath.h header for CPU functions for
|
1562 |
+
GL vector/matrix operations from lunarG is subject to the
|
1563 |
+
Apache License Version 2.0.
|
1564 |
+
|
1565 |
+
21. The DX12-CUDA sample uses the d3dx12.h header, which is
|
1566 |
+
subject to the MIT license .
|
1567 |
+
|
1568 |
+
-----------------
|
venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/METADATA
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: nvidia-cuda-nvrtc-cu12
|
3 |
+
Version: 12.1.105
|
4 |
+
Summary: NVRTC native runtime libraries
|
5 |
+
Home-page: https://developer.nvidia.com/cuda-zone
|
6 |
+
Author: Nvidia CUDA Installer Team
|
7 |
+
Author-email: [email protected]
|
8 |
+
License: NVIDIA Proprietary Software
|
9 |
+
Keywords: cuda,nvidia,runtime,machine learning,deep learning
|
10 |
+
Classifier: Development Status :: 4 - Beta
|
11 |
+
Classifier: Intended Audience :: Developers
|
12 |
+
Classifier: Intended Audience :: Education
|
13 |
+
Classifier: Intended Audience :: Science/Research
|
14 |
+
Classifier: License :: Other/Proprietary License
|
15 |
+
Classifier: Natural Language :: English
|
16 |
+
Classifier: Programming Language :: Python :: 3
|
17 |
+
Classifier: Programming Language :: Python :: 3.5
|
18 |
+
Classifier: Programming Language :: Python :: 3.6
|
19 |
+
Classifier: Programming Language :: Python :: 3.7
|
20 |
+
Classifier: Programming Language :: Python :: 3.8
|
21 |
+
Classifier: Programming Language :: Python :: 3.9
|
22 |
+
Classifier: Programming Language :: Python :: 3.10
|
23 |
+
Classifier: Programming Language :: Python :: 3.11
|
24 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
25 |
+
Classifier: Topic :: Scientific/Engineering
|
26 |
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
27 |
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
28 |
+
Classifier: Topic :: Software Development
|
29 |
+
Classifier: Topic :: Software Development :: Libraries
|
30 |
+
Classifier: Operating System :: Microsoft :: Windows
|
31 |
+
Classifier: Operating System :: POSIX :: Linux
|
32 |
+
Requires-Python: >=3
|
33 |
+
License-File: License.txt
|
34 |
+
|
35 |
+
NVRTC native runtime libraries
|
venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/RECORD
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
nvidia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2 |
+
nvidia/__pycache__/__init__.cpython-310.pyc,,
|
3 |
+
nvidia/cuda_nvrtc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4 |
+
nvidia/cuda_nvrtc/__pycache__/__init__.cpython-310.pyc,,
|
5 |
+
nvidia/cuda_nvrtc/include/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6 |
+
nvidia/cuda_nvrtc/include/__pycache__/__init__.cpython-310.pyc,,
|
7 |
+
nvidia/cuda_nvrtc/include/nvrtc.h,sha256=iNclpPXz5S0Gu4RUfVpW30spNLF9VcuhNLg-JS3gxKs,34200
|
8 |
+
nvidia/cuda_nvrtc/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9 |
+
nvidia/cuda_nvrtc/lib/__pycache__/__init__.cpython-310.pyc,,
|
10 |
+
nvidia/cuda_nvrtc/lib/libnvrtc-builtins.so.12.1,sha256=bFY5zjl6n1uCzSd0MtFGNwZ0NYM0pM4NM_qaXKCQrIo,6842248
|
11 |
+
nvidia/cuda_nvrtc/lib/libnvrtc.so.12,sha256=g-ya13deifYoAoa6EeudKMr-ScL3d6PgUbzIgd50Sfw,56875328
|
12 |
+
nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
13 |
+
nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/License.txt,sha256=rW9YU_ugyg0VnQ9Y1JrkmDDC-Mk_epJki5zpCttMbM0,59262
|
14 |
+
nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/METADATA,sha256=GunIC2DggSlw3gc15QJPreXg5CdAN6HOqdvSLF9Y62s,1507
|
15 |
+
nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/RECORD,,
|
16 |
+
nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/WHEEL,sha256=-kQi_VMfvRQozZJT7HUPMfY-5vLo0LVTmAylNJ3Ft98,106
|
17 |
+
nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/top_level.txt,sha256=fTkAtiFuL16nUrB9ytDDtpytz2t0B4NvYTnRzwAhO14,7
|
venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.37.1)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-manylinux1_x86_64
|
5 |
+
|
venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.1.105.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nvidia
|
venv/lib/python3.10/site-packages/sympy/__init__.py
ADDED
@@ -0,0 +1,535 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
SymPy is a Python library for symbolic mathematics. It aims to become a
|
3 |
+
full-featured computer algebra system (CAS) while keeping the code as simple
|
4 |
+
as possible in order to be comprehensible and easily extensible. SymPy is
|
5 |
+
written entirely in Python. It depends on mpmath, and other external libraries
|
6 |
+
may be optionally for things like plotting support.
|
7 |
+
|
8 |
+
See the webpage for more information and documentation:
|
9 |
+
|
10 |
+
https://sympy.org
|
11 |
+
|
12 |
+
"""
|
13 |
+
|
14 |
+
|
15 |
+
import sys
|
16 |
+
if sys.version_info < (3, 8):
|
17 |
+
raise ImportError("Python version 3.8 or above is required for SymPy.")
|
18 |
+
del sys
|
19 |
+
|
20 |
+
|
21 |
+
try:
|
22 |
+
import mpmath
|
23 |
+
except ImportError:
|
24 |
+
raise ImportError("SymPy now depends on mpmath as an external library. "
|
25 |
+
"See https://docs.sympy.org/latest/install.html#mpmath for more information.")
|
26 |
+
|
27 |
+
del mpmath
|
28 |
+
|
29 |
+
from sympy.release import __version__
|
30 |
+
from sympy.core.cache import lazy_function
|
31 |
+
|
32 |
+
if 'dev' in __version__:
|
33 |
+
def enable_warnings():
|
34 |
+
import warnings
|
35 |
+
warnings.filterwarnings('default', '.*', DeprecationWarning, module='sympy.*')
|
36 |
+
del warnings
|
37 |
+
enable_warnings()
|
38 |
+
del enable_warnings
|
39 |
+
|
40 |
+
|
41 |
+
def __sympy_debug():
|
42 |
+
# helper function so we don't import os globally
|
43 |
+
import os
|
44 |
+
debug_str = os.getenv('SYMPY_DEBUG', 'False')
|
45 |
+
if debug_str in ('True', 'False'):
|
46 |
+
return eval(debug_str)
|
47 |
+
else:
|
48 |
+
raise RuntimeError("unrecognized value for SYMPY_DEBUG: %s" %
|
49 |
+
debug_str)
|
50 |
+
SYMPY_DEBUG = __sympy_debug() # type: bool
|
51 |
+
|
52 |
+
from .core import (sympify, SympifyError, cacheit, Basic, Atom,
|
53 |
+
preorder_traversal, S, Expr, AtomicExpr, UnevaluatedExpr, Symbol,
|
54 |
+
Wild, Dummy, symbols, var, Number, Float, Rational, Integer,
|
55 |
+
NumberSymbol, RealNumber, igcd, ilcm, seterr, E, I, nan, oo, pi, zoo,
|
56 |
+
AlgebraicNumber, comp, mod_inverse, Pow, integer_nthroot, integer_log,
|
57 |
+
Mul, prod, Add, Mod, Rel, Eq, Ne, Lt, Le, Gt, Ge, Equality,
|
58 |
+
GreaterThan, LessThan, Unequality, StrictGreaterThan, StrictLessThan,
|
59 |
+
vectorize, Lambda, WildFunction, Derivative, diff, FunctionClass,
|
60 |
+
Function, Subs, expand, PoleError, count_ops, expand_mul, expand_log,
|
61 |
+
expand_func, expand_trig, expand_complex, expand_multinomial, nfloat,
|
62 |
+
expand_power_base, expand_power_exp, arity, PrecisionExhausted, N,
|
63 |
+
evalf, Tuple, Dict, gcd_terms, factor_terms, factor_nc, evaluate,
|
64 |
+
Catalan, EulerGamma, GoldenRatio, TribonacciConstant, bottom_up, use,
|
65 |
+
postorder_traversal, default_sort_key, ordered)
|
66 |
+
|
67 |
+
from .logic import (to_cnf, to_dnf, to_nnf, And, Or, Not, Xor, Nand, Nor,
|
68 |
+
Implies, Equivalent, ITE, POSform, SOPform, simplify_logic, bool_map,
|
69 |
+
true, false, satisfiable)
|
70 |
+
|
71 |
+
from .assumptions import (AppliedPredicate, Predicate, AssumptionsContext,
|
72 |
+
assuming, Q, ask, register_handler, remove_handler, refine)
|
73 |
+
|
74 |
+
from .polys import (Poly, PurePoly, poly_from_expr, parallel_poly_from_expr,
|
75 |
+
degree, total_degree, degree_list, LC, LM, LT, pdiv, prem, pquo,
|
76 |
+
pexquo, div, rem, quo, exquo, half_gcdex, gcdex, invert,
|
77 |
+
subresultants, resultant, discriminant, cofactors, gcd_list, gcd,
|
78 |
+
lcm_list, lcm, terms_gcd, trunc, monic, content, primitive, compose,
|
79 |
+
decompose, sturm, gff_list, gff, sqf_norm, sqf_part, sqf_list, sqf,
|
80 |
+
factor_list, factor, intervals, refine_root, count_roots, real_roots,
|
81 |
+
nroots, ground_roots, nth_power_roots_poly, cancel, reduced, groebner,
|
82 |
+
is_zero_dimensional, GroebnerBasis, poly, symmetrize, horner,
|
83 |
+
interpolate, rational_interpolate, viete, together,
|
84 |
+
BasePolynomialError, ExactQuotientFailed, PolynomialDivisionFailed,
|
85 |
+
OperationNotSupported, HeuristicGCDFailed, HomomorphismFailed,
|
86 |
+
IsomorphismFailed, ExtraneousFactors, EvaluationFailed,
|
87 |
+
RefinementFailed, CoercionFailed, NotInvertible, NotReversible,
|
88 |
+
NotAlgebraic, DomainError, PolynomialError, UnificationFailed,
|
89 |
+
GeneratorsError, GeneratorsNeeded, ComputationFailed,
|
90 |
+
UnivariatePolynomialError, MultivariatePolynomialError,
|
91 |
+
PolificationFailed, OptionError, FlagError, minpoly,
|
92 |
+
minimal_polynomial, primitive_element, field_isomorphism,
|
93 |
+
to_number_field, isolate, round_two, prime_decomp, prime_valuation,
|
94 |
+
galois_group, itermonomials, Monomial, lex, grlex,
|
95 |
+
grevlex, ilex, igrlex, igrevlex, CRootOf, rootof, RootOf,
|
96 |
+
ComplexRootOf, RootSum, roots, Domain, FiniteField, IntegerRing,
|
97 |
+
RationalField, RealField, ComplexField, PythonFiniteField,
|
98 |
+
GMPYFiniteField, PythonIntegerRing, GMPYIntegerRing, PythonRational,
|
99 |
+
GMPYRationalField, AlgebraicField, PolynomialRing, FractionField,
|
100 |
+
ExpressionDomain, FF_python, FF_gmpy, ZZ_python, ZZ_gmpy, QQ_python,
|
101 |
+
QQ_gmpy, GF, FF, ZZ, QQ, ZZ_I, QQ_I, RR, CC, EX, EXRAW,
|
102 |
+
construct_domain, swinnerton_dyer_poly, cyclotomic_poly,
|
103 |
+
symmetric_poly, random_poly, interpolating_poly, jacobi_poly,
|
104 |
+
chebyshevt_poly, chebyshevu_poly, hermite_poly, hermite_prob_poly,
|
105 |
+
legendre_poly, laguerre_poly, apart, apart_list, assemble_partfrac_list,
|
106 |
+
Options, ring, xring, vring, sring, field, xfield, vfield, sfield)
|
107 |
+
|
108 |
+
from .series import (Order, O, limit, Limit, gruntz, series, approximants,
|
109 |
+
residue, EmptySequence, SeqPer, SeqFormula, sequence, SeqAdd, SeqMul,
|
110 |
+
fourier_series, fps, difference_delta, limit_seq)
|
111 |
+
|
112 |
+
from .functions import (factorial, factorial2, rf, ff, binomial,
|
113 |
+
RisingFactorial, FallingFactorial, subfactorial, carmichael,
|
114 |
+
fibonacci, lucas, motzkin, tribonacci, harmonic, bernoulli, bell, euler,
|
115 |
+
catalan, genocchi, andre, partition, sqrt, root, Min, Max, Id,
|
116 |
+
real_root, Rem, cbrt, re, im, sign, Abs, conjugate, arg, polar_lift,
|
117 |
+
periodic_argument, unbranched_argument, principal_branch, transpose,
|
118 |
+
adjoint, polarify, unpolarify, sin, cos, tan, sec, csc, cot, sinc,
|
119 |
+
asin, acos, atan, asec, acsc, acot, atan2, exp_polar, exp, ln, log,
|
120 |
+
LambertW, sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh,
|
121 |
+
acoth, asech, acsch, floor, ceiling, frac, Piecewise, piecewise_fold,
|
122 |
+
piecewise_exclusive, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv,
|
123 |
+
Ei, expint, E1, li, Li, Si, Ci, Shi, Chi, fresnels, fresnelc, gamma,
|
124 |
+
lowergamma, uppergamma, polygamma, loggamma, digamma, trigamma,
|
125 |
+
multigamma, dirichlet_eta, zeta, lerchphi, polylog, stieltjes, Eijk,
|
126 |
+
LeviCivita, KroneckerDelta, SingularityFunction, DiracDelta, Heaviside,
|
127 |
+
bspline_basis, bspline_basis_set, interpolating_spline, besselj,
|
128 |
+
bessely, besseli, besselk, hankel1, hankel2, jn, yn, jn_zeros, hn1,
|
129 |
+
hn2, airyai, airybi, airyaiprime, airybiprime, marcumq, hyper,
|
130 |
+
meijerg, appellf1, legendre, assoc_legendre, hermite, hermite_prob,
|
131 |
+
chebyshevt, chebyshevu, chebyshevu_root, chebyshevt_root, laguerre,
|
132 |
+
assoc_laguerre, gegenbauer, jacobi, jacobi_normalized, Ynm, Ynm_c,
|
133 |
+
Znm, elliptic_k, elliptic_f, elliptic_e, elliptic_pi, beta, mathieus,
|
134 |
+
mathieuc, mathieusprime, mathieucprime, riemann_xi, betainc, betainc_regularized)
|
135 |
+
|
136 |
+
from .ntheory import (nextprime, prevprime, prime, primepi, primerange,
|
137 |
+
randprime, Sieve, sieve, primorial, cycle_length, composite,
|
138 |
+
compositepi, isprime, divisors, proper_divisors, factorint,
|
139 |
+
multiplicity, perfect_power, pollard_pm1, pollard_rho, primefactors,
|
140 |
+
totient, trailing, divisor_count, proper_divisor_count, divisor_sigma,
|
141 |
+
factorrat, reduced_totient, primenu, primeomega,
|
142 |
+
mersenne_prime_exponent, is_perfect, is_mersenne_prime, is_abundant,
|
143 |
+
is_deficient, is_amicable, abundance, npartitions, is_primitive_root,
|
144 |
+
is_quad_residue, legendre_symbol, jacobi_symbol, n_order, sqrt_mod,
|
145 |
+
quadratic_residues, primitive_root, nthroot_mod, is_nthpow_residue,
|
146 |
+
sqrt_mod_iter, mobius, discrete_log, quadratic_congruence,
|
147 |
+
binomial_coefficients, binomial_coefficients_list,
|
148 |
+
multinomial_coefficients, continued_fraction_periodic,
|
149 |
+
continued_fraction_iterator, continued_fraction_reduce,
|
150 |
+
continued_fraction_convergents, continued_fraction, egyptian_fraction)
|
151 |
+
|
152 |
+
from .concrete import product, Product, summation, Sum
|
153 |
+
|
154 |
+
from .discrete import (fft, ifft, ntt, intt, fwht, ifwht, mobius_transform,
|
155 |
+
inverse_mobius_transform, convolution, covering_product,
|
156 |
+
intersecting_product)
|
157 |
+
|
158 |
+
from .simplify import (simplify, hypersimp, hypersimilar, logcombine,
|
159 |
+
separatevars, posify, besselsimp, kroneckersimp, signsimp,
|
160 |
+
nsimplify, FU, fu, sqrtdenest, cse, epath, EPath, hyperexpand,
|
161 |
+
collect, rcollect, radsimp, collect_const, fraction, numer, denom,
|
162 |
+
trigsimp, exptrigsimp, powsimp, powdenest, combsimp, gammasimp,
|
163 |
+
ratsimp, ratsimpmodprime)
|
164 |
+
|
165 |
+
from .sets import (Set, Interval, Union, EmptySet, FiniteSet, ProductSet,
|
166 |
+
Intersection, DisjointUnion, imageset, Complement, SymmetricDifference, ImageSet,
|
167 |
+
Range, ComplexRegion, Complexes, Reals, Contains, ConditionSet, Ordinal,
|
168 |
+
OmegaPower, ord0, PowerSet, Naturals, Naturals0, UniversalSet,
|
169 |
+
Integers, Rationals)
|
170 |
+
|
171 |
+
from .solvers import (solve, solve_linear_system, solve_linear_system_LU,
|
172 |
+
solve_undetermined_coeffs, nsolve, solve_linear, checksol, det_quick,
|
173 |
+
inv_quick, check_assumptions, failing_assumptions, diophantine,
|
174 |
+
rsolve, rsolve_poly, rsolve_ratio, rsolve_hyper, checkodesol,
|
175 |
+
classify_ode, dsolve, homogeneous_order, solve_poly_system,
|
176 |
+
solve_triangulated, pde_separate, pde_separate_add, pde_separate_mul,
|
177 |
+
pdsolve, classify_pde, checkpdesol, ode_order, reduce_inequalities,
|
178 |
+
reduce_abs_inequality, reduce_abs_inequalities, solve_poly_inequality,
|
179 |
+
solve_rational_inequalities, solve_univariate_inequality, decompogen,
|
180 |
+
solveset, linsolve, linear_eq_to_matrix, nonlinsolve, substitution)
|
181 |
+
|
182 |
+
from .matrices import (ShapeError, NonSquareMatrixError, GramSchmidt,
|
183 |
+
casoratian, diag, eye, hessian, jordan_cell, list2numpy, matrix2numpy,
|
184 |
+
matrix_multiply_elementwise, ones, randMatrix, rot_axis1, rot_axis2,
|
185 |
+
rot_axis3, symarray, wronskian, zeros, MutableDenseMatrix,
|
186 |
+
DeferredVector, MatrixBase, Matrix, MutableMatrix,
|
187 |
+
MutableSparseMatrix, banded, ImmutableDenseMatrix,
|
188 |
+
ImmutableSparseMatrix, ImmutableMatrix, SparseMatrix, MatrixSlice,
|
189 |
+
BlockDiagMatrix, BlockMatrix, FunctionMatrix, Identity, Inverse,
|
190 |
+
MatAdd, MatMul, MatPow, MatrixExpr, MatrixSymbol, Trace, Transpose,
|
191 |
+
ZeroMatrix, OneMatrix, blockcut, block_collapse, matrix_symbols,
|
192 |
+
Adjoint, hadamard_product, HadamardProduct, HadamardPower,
|
193 |
+
Determinant, det, diagonalize_vector, DiagMatrix, DiagonalMatrix,
|
194 |
+
DiagonalOf, trace, DotProduct, kronecker_product, KroneckerProduct,
|
195 |
+
PermutationMatrix, MatrixPermute, Permanent, per, rot_ccw_axis1,
|
196 |
+
rot_ccw_axis2, rot_ccw_axis3, rot_givens)
|
197 |
+
|
198 |
+
from .geometry import (Point, Point2D, Point3D, Line, Ray, Segment, Line2D,
|
199 |
+
Segment2D, Ray2D, Line3D, Segment3D, Ray3D, Plane, Ellipse, Circle,
|
200 |
+
Polygon, RegularPolygon, Triangle, rad, deg, are_similar, centroid,
|
201 |
+
convex_hull, idiff, intersection, closest_points, farthest_points,
|
202 |
+
GeometryError, Curve, Parabola)
|
203 |
+
|
204 |
+
from .utilities import (flatten, group, take, subsets, variations,
|
205 |
+
numbered_symbols, cartes, capture, dict_merge, prefixes, postfixes,
|
206 |
+
sift, topological_sort, unflatten, has_dups, has_variety, reshape,
|
207 |
+
rotations, filldedent, lambdify,
|
208 |
+
threaded, xthreaded, public, memoize_property, timed)
|
209 |
+
|
210 |
+
from .integrals import (integrate, Integral, line_integrate, mellin_transform,
|
211 |
+
inverse_mellin_transform, MellinTransform, InverseMellinTransform,
|
212 |
+
laplace_transform, inverse_laplace_transform, LaplaceTransform,
|
213 |
+
InverseLaplaceTransform, fourier_transform, inverse_fourier_transform,
|
214 |
+
FourierTransform, InverseFourierTransform, sine_transform,
|
215 |
+
inverse_sine_transform, SineTransform, InverseSineTransform,
|
216 |
+
cosine_transform, inverse_cosine_transform, CosineTransform,
|
217 |
+
InverseCosineTransform, hankel_transform, inverse_hankel_transform,
|
218 |
+
HankelTransform, InverseHankelTransform, singularityintegrate)
|
219 |
+
|
220 |
+
from .tensor import (IndexedBase, Idx, Indexed, get_contraction_structure,
|
221 |
+
get_indices, shape, MutableDenseNDimArray, ImmutableDenseNDimArray,
|
222 |
+
MutableSparseNDimArray, ImmutableSparseNDimArray, NDimArray,
|
223 |
+
tensorproduct, tensorcontraction, tensordiagonal, derive_by_array,
|
224 |
+
permutedims, Array, DenseNDimArray, SparseNDimArray)
|
225 |
+
|
226 |
+
from .parsing import parse_expr
|
227 |
+
|
228 |
+
from .calculus import (euler_equations, singularities, is_increasing,
|
229 |
+
is_strictly_increasing, is_decreasing, is_strictly_decreasing,
|
230 |
+
is_monotonic, finite_diff_weights, apply_finite_diff,
|
231 |
+
differentiate_finite, periodicity, not_empty_in, AccumBounds,
|
232 |
+
is_convex, stationary_points, minimum, maximum)
|
233 |
+
|
234 |
+
from .algebras import Quaternion
|
235 |
+
|
236 |
+
from .printing import (pager_print, pretty, pretty_print, pprint,
|
237 |
+
pprint_use_unicode, pprint_try_use_unicode, latex, print_latex,
|
238 |
+
multiline_latex, mathml, print_mathml, python, print_python, pycode,
|
239 |
+
ccode, print_ccode, smtlib_code, glsl_code, print_glsl, cxxcode, fcode,
|
240 |
+
print_fcode, rcode, print_rcode, jscode, print_jscode, julia_code,
|
241 |
+
mathematica_code, octave_code, rust_code, print_gtk, preview, srepr,
|
242 |
+
print_tree, StrPrinter, sstr, sstrrepr, TableForm, dotprint,
|
243 |
+
maple_code, print_maple_code)
|
244 |
+
|
245 |
+
test = lazy_function('sympy.testing.runtests', 'test')
|
246 |
+
doctest = lazy_function('sympy.testing.runtests', 'doctest')
|
247 |
+
|
248 |
+
# This module causes conflicts with other modules:
|
249 |
+
# from .stats import *
|
250 |
+
# Adds about .04-.05 seconds of import time
|
251 |
+
# from combinatorics import *
|
252 |
+
# This module is slow to import:
|
253 |
+
#from physics import units
|
254 |
+
from .plotting import plot, textplot, plot_backends, plot_implicit, plot_parametric
|
255 |
+
from .interactive import init_session, init_printing, interactive_traversal
|
256 |
+
|
257 |
+
evalf._create_evalf_table()
|
258 |
+
|
259 |
+
__all__ = [
|
260 |
+
'__version__',
|
261 |
+
|
262 |
+
# sympy.core
|
263 |
+
'sympify', 'SympifyError', 'cacheit', 'Basic', 'Atom',
|
264 |
+
'preorder_traversal', 'S', 'Expr', 'AtomicExpr', 'UnevaluatedExpr',
|
265 |
+
'Symbol', 'Wild', 'Dummy', 'symbols', 'var', 'Number', 'Float',
|
266 |
+
'Rational', 'Integer', 'NumberSymbol', 'RealNumber', 'igcd', 'ilcm',
|
267 |
+
'seterr', 'E', 'I', 'nan', 'oo', 'pi', 'zoo', 'AlgebraicNumber', 'comp',
|
268 |
+
'mod_inverse', 'Pow', 'integer_nthroot', 'integer_log', 'Mul', 'prod',
|
269 |
+
'Add', 'Mod', 'Rel', 'Eq', 'Ne', 'Lt', 'Le', 'Gt', 'Ge', 'Equality',
|
270 |
+
'GreaterThan', 'LessThan', 'Unequality', 'StrictGreaterThan',
|
271 |
+
'StrictLessThan', 'vectorize', 'Lambda', 'WildFunction', 'Derivative',
|
272 |
+
'diff', 'FunctionClass', 'Function', 'Subs', 'expand', 'PoleError',
|
273 |
+
'count_ops', 'expand_mul', 'expand_log', 'expand_func', 'expand_trig',
|
274 |
+
'expand_complex', 'expand_multinomial', 'nfloat', 'expand_power_base',
|
275 |
+
'expand_power_exp', 'arity', 'PrecisionExhausted', 'N', 'evalf', 'Tuple',
|
276 |
+
'Dict', 'gcd_terms', 'factor_terms', 'factor_nc', 'evaluate', 'Catalan',
|
277 |
+
'EulerGamma', 'GoldenRatio', 'TribonacciConstant', 'bottom_up', 'use',
|
278 |
+
'postorder_traversal', 'default_sort_key', 'ordered',
|
279 |
+
|
280 |
+
# sympy.logic
|
281 |
+
'to_cnf', 'to_dnf', 'to_nnf', 'And', 'Or', 'Not', 'Xor', 'Nand', 'Nor',
|
282 |
+
'Implies', 'Equivalent', 'ITE', 'POSform', 'SOPform', 'simplify_logic',
|
283 |
+
'bool_map', 'true', 'false', 'satisfiable',
|
284 |
+
|
285 |
+
# sympy.assumptions
|
286 |
+
'AppliedPredicate', 'Predicate', 'AssumptionsContext', 'assuming', 'Q',
|
287 |
+
'ask', 'register_handler', 'remove_handler', 'refine',
|
288 |
+
|
289 |
+
# sympy.polys
|
290 |
+
'Poly', 'PurePoly', 'poly_from_expr', 'parallel_poly_from_expr', 'degree',
|
291 |
+
'total_degree', 'degree_list', 'LC', 'LM', 'LT', 'pdiv', 'prem', 'pquo',
|
292 |
+
'pexquo', 'div', 'rem', 'quo', 'exquo', 'half_gcdex', 'gcdex', 'invert',
|
293 |
+
'subresultants', 'resultant', 'discriminant', 'cofactors', 'gcd_list',
|
294 |
+
'gcd', 'lcm_list', 'lcm', 'terms_gcd', 'trunc', 'monic', 'content',
|
295 |
+
'primitive', 'compose', 'decompose', 'sturm', 'gff_list', 'gff',
|
296 |
+
'sqf_norm', 'sqf_part', 'sqf_list', 'sqf', 'factor_list', 'factor',
|
297 |
+
'intervals', 'refine_root', 'count_roots', 'real_roots', 'nroots',
|
298 |
+
'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced', 'groebner',
|
299 |
+
'is_zero_dimensional', 'GroebnerBasis', 'poly', 'symmetrize', 'horner',
|
300 |
+
'interpolate', 'rational_interpolate', 'viete', 'together',
|
301 |
+
'BasePolynomialError', 'ExactQuotientFailed', 'PolynomialDivisionFailed',
|
302 |
+
'OperationNotSupported', 'HeuristicGCDFailed', 'HomomorphismFailed',
|
303 |
+
'IsomorphismFailed', 'ExtraneousFactors', 'EvaluationFailed',
|
304 |
+
'RefinementFailed', 'CoercionFailed', 'NotInvertible', 'NotReversible',
|
305 |
+
'NotAlgebraic', 'DomainError', 'PolynomialError', 'UnificationFailed',
|
306 |
+
'GeneratorsError', 'GeneratorsNeeded', 'ComputationFailed',
|
307 |
+
'UnivariatePolynomialError', 'MultivariatePolynomialError',
|
308 |
+
'PolificationFailed', 'OptionError', 'FlagError', 'minpoly',
|
309 |
+
'minimal_polynomial', 'primitive_element', 'field_isomorphism',
|
310 |
+
'to_number_field', 'isolate', 'round_two', 'prime_decomp',
|
311 |
+
'prime_valuation', 'galois_group', 'itermonomials', 'Monomial', 'lex', 'grlex',
|
312 |
+
'grevlex', 'ilex', 'igrlex', 'igrevlex', 'CRootOf', 'rootof', 'RootOf',
|
313 |
+
'ComplexRootOf', 'RootSum', 'roots', 'Domain', 'FiniteField',
|
314 |
+
'IntegerRing', 'RationalField', 'RealField', 'ComplexField',
|
315 |
+
'PythonFiniteField', 'GMPYFiniteField', 'PythonIntegerRing',
|
316 |
+
'GMPYIntegerRing', 'PythonRational', 'GMPYRationalField',
|
317 |
+
'AlgebraicField', 'PolynomialRing', 'FractionField', 'ExpressionDomain',
|
318 |
+
'FF_python', 'FF_gmpy', 'ZZ_python', 'ZZ_gmpy', 'QQ_python', 'QQ_gmpy',
|
319 |
+
'GF', 'FF', 'ZZ', 'QQ', 'ZZ_I', 'QQ_I', 'RR', 'CC', 'EX', 'EXRAW',
|
320 |
+
'construct_domain', 'swinnerton_dyer_poly', 'cyclotomic_poly',
|
321 |
+
'symmetric_poly', 'random_poly', 'interpolating_poly', 'jacobi_poly',
|
322 |
+
'chebyshevt_poly', 'chebyshevu_poly', 'hermite_poly', 'hermite_prob_poly',
|
323 |
+
'legendre_poly', 'laguerre_poly', 'apart', 'apart_list', 'assemble_partfrac_list',
|
324 |
+
'Options', 'ring', 'xring', 'vring', 'sring', 'field', 'xfield', 'vfield',
|
325 |
+
'sfield',
|
326 |
+
|
327 |
+
# sympy.series
|
328 |
+
'Order', 'O', 'limit', 'Limit', 'gruntz', 'series', 'approximants',
|
329 |
+
'residue', 'EmptySequence', 'SeqPer', 'SeqFormula', 'sequence', 'SeqAdd',
|
330 |
+
'SeqMul', 'fourier_series', 'fps', 'difference_delta', 'limit_seq',
|
331 |
+
|
332 |
+
# sympy.functions
|
333 |
+
'factorial', 'factorial2', 'rf', 'ff', 'binomial', 'RisingFactorial',
|
334 |
+
'FallingFactorial', 'subfactorial', 'carmichael', 'fibonacci', 'lucas',
|
335 |
+
'motzkin', 'tribonacci', 'harmonic', 'bernoulli', 'bell', 'euler', 'catalan',
|
336 |
+
'genocchi', 'andre', 'partition', 'sqrt', 'root', 'Min', 'Max', 'Id', 'real_root',
|
337 |
+
'Rem', 'cbrt', 're', 'im', 'sign', 'Abs', 'conjugate', 'arg', 'polar_lift',
|
338 |
+
'periodic_argument', 'unbranched_argument', 'principal_branch',
|
339 |
+
'transpose', 'adjoint', 'polarify', 'unpolarify', 'sin', 'cos', 'tan',
|
340 |
+
'sec', 'csc', 'cot', 'sinc', 'asin', 'acos', 'atan', 'asec', 'acsc',
|
341 |
+
'acot', 'atan2', 'exp_polar', 'exp', 'ln', 'log', 'LambertW', 'sinh',
|
342 |
+
'cosh', 'tanh', 'coth', 'sech', 'csch', 'asinh', 'acosh', 'atanh',
|
343 |
+
'acoth', 'asech', 'acsch', 'floor', 'ceiling', 'frac', 'Piecewise',
|
344 |
+
'piecewise_fold', 'piecewise_exclusive', 'erf', 'erfc', 'erfi', 'erf2',
|
345 |
+
'erfinv', 'erfcinv', 'erf2inv', 'Ei', 'expint', 'E1', 'li', 'Li', 'Si',
|
346 |
+
'Ci', 'Shi', 'Chi', 'fresnels', 'fresnelc', 'gamma', 'lowergamma',
|
347 |
+
'uppergamma', 'polygamma', 'loggamma', 'digamma', 'trigamma', 'multigamma',
|
348 |
+
'dirichlet_eta', 'zeta', 'lerchphi', 'polylog', 'stieltjes', 'Eijk', 'LeviCivita',
|
349 |
+
'KroneckerDelta', 'SingularityFunction', 'DiracDelta', 'Heaviside',
|
350 |
+
'bspline_basis', 'bspline_basis_set', 'interpolating_spline', 'besselj',
|
351 |
+
'bessely', 'besseli', 'besselk', 'hankel1', 'hankel2', 'jn', 'yn',
|
352 |
+
'jn_zeros', 'hn1', 'hn2', 'airyai', 'airybi', 'airyaiprime',
|
353 |
+
'airybiprime', 'marcumq', 'hyper', 'meijerg', 'appellf1', 'legendre',
|
354 |
+
'assoc_legendre', 'hermite', 'hermite_prob', 'chebyshevt', 'chebyshevu',
|
355 |
+
'chebyshevu_root', 'chebyshevt_root', 'laguerre', 'assoc_laguerre',
|
356 |
+
'gegenbauer', 'jacobi', 'jacobi_normalized', 'Ynm', 'Ynm_c', 'Znm',
|
357 |
+
'elliptic_k', 'elliptic_f', 'elliptic_e', 'elliptic_pi', 'beta',
|
358 |
+
'mathieus', 'mathieuc', 'mathieusprime', 'mathieucprime', 'riemann_xi','betainc',
|
359 |
+
'betainc_regularized',
|
360 |
+
|
361 |
+
# sympy.ntheory
|
362 |
+
'nextprime', 'prevprime', 'prime', 'primepi', 'primerange', 'randprime',
|
363 |
+
'Sieve', 'sieve', 'primorial', 'cycle_length', 'composite', 'compositepi',
|
364 |
+
'isprime', 'divisors', 'proper_divisors', 'factorint', 'multiplicity',
|
365 |
+
'perfect_power', 'pollard_pm1', 'pollard_rho', 'primefactors', 'totient',
|
366 |
+
'trailing', 'divisor_count', 'proper_divisor_count', 'divisor_sigma',
|
367 |
+
'factorrat', 'reduced_totient', 'primenu', 'primeomega',
|
368 |
+
'mersenne_prime_exponent', 'is_perfect', 'is_mersenne_prime',
|
369 |
+
'is_abundant', 'is_deficient', 'is_amicable', 'abundance', 'npartitions',
|
370 |
+
'is_primitive_root', 'is_quad_residue', 'legendre_symbol',
|
371 |
+
'jacobi_symbol', 'n_order', 'sqrt_mod', 'quadratic_residues',
|
372 |
+
'primitive_root', 'nthroot_mod', 'is_nthpow_residue', 'sqrt_mod_iter',
|
373 |
+
'mobius', 'discrete_log', 'quadratic_congruence', 'binomial_coefficients',
|
374 |
+
'binomial_coefficients_list', 'multinomial_coefficients',
|
375 |
+
'continued_fraction_periodic', 'continued_fraction_iterator',
|
376 |
+
'continued_fraction_reduce', 'continued_fraction_convergents',
|
377 |
+
'continued_fraction', 'egyptian_fraction',
|
378 |
+
|
379 |
+
# sympy.concrete
|
380 |
+
'product', 'Product', 'summation', 'Sum',
|
381 |
+
|
382 |
+
# sympy.discrete
|
383 |
+
'fft', 'ifft', 'ntt', 'intt', 'fwht', 'ifwht', 'mobius_transform',
|
384 |
+
'inverse_mobius_transform', 'convolution', 'covering_product',
|
385 |
+
'intersecting_product',
|
386 |
+
|
387 |
+
# sympy.simplify
|
388 |
+
'simplify', 'hypersimp', 'hypersimilar', 'logcombine', 'separatevars',
|
389 |
+
'posify', 'besselsimp', 'kroneckersimp', 'signsimp',
|
390 |
+
'nsimplify', 'FU', 'fu', 'sqrtdenest', 'cse', 'epath', 'EPath',
|
391 |
+
'hyperexpand', 'collect', 'rcollect', 'radsimp', 'collect_const',
|
392 |
+
'fraction', 'numer', 'denom', 'trigsimp', 'exptrigsimp', 'powsimp',
|
393 |
+
'powdenest', 'combsimp', 'gammasimp', 'ratsimp', 'ratsimpmodprime',
|
394 |
+
|
395 |
+
# sympy.sets
|
396 |
+
'Set', 'Interval', 'Union', 'EmptySet', 'FiniteSet', 'ProductSet',
|
397 |
+
'Intersection', 'imageset', 'DisjointUnion', 'Complement', 'SymmetricDifference',
|
398 |
+
'ImageSet', 'Range', 'ComplexRegion', 'Reals', 'Contains', 'ConditionSet',
|
399 |
+
'Ordinal', 'OmegaPower', 'ord0', 'PowerSet', 'Naturals',
|
400 |
+
'Naturals0', 'UniversalSet', 'Integers', 'Rationals', 'Complexes',
|
401 |
+
|
402 |
+
# sympy.solvers
|
403 |
+
'solve', 'solve_linear_system', 'solve_linear_system_LU',
|
404 |
+
'solve_undetermined_coeffs', 'nsolve', 'solve_linear', 'checksol',
|
405 |
+
'det_quick', 'inv_quick', 'check_assumptions', 'failing_assumptions',
|
406 |
+
'diophantine', 'rsolve', 'rsolve_poly', 'rsolve_ratio', 'rsolve_hyper',
|
407 |
+
'checkodesol', 'classify_ode', 'dsolve', 'homogeneous_order',
|
408 |
+
'solve_poly_system', 'solve_triangulated', 'pde_separate',
|
409 |
+
'pde_separate_add', 'pde_separate_mul', 'pdsolve', 'classify_pde',
|
410 |
+
'checkpdesol', 'ode_order', 'reduce_inequalities',
|
411 |
+
'reduce_abs_inequality', 'reduce_abs_inequalities',
|
412 |
+
'solve_poly_inequality', 'solve_rational_inequalities',
|
413 |
+
'solve_univariate_inequality', 'decompogen', 'solveset', 'linsolve',
|
414 |
+
'linear_eq_to_matrix', 'nonlinsolve', 'substitution',
|
415 |
+
|
416 |
+
# sympy.matrices
|
417 |
+
'ShapeError', 'NonSquareMatrixError', 'GramSchmidt', 'casoratian', 'diag',
|
418 |
+
'eye', 'hessian', 'jordan_cell', 'list2numpy', 'matrix2numpy',
|
419 |
+
'matrix_multiply_elementwise', 'ones', 'randMatrix', 'rot_axis1',
|
420 |
+
'rot_axis2', 'rot_axis3', 'symarray', 'wronskian', 'zeros',
|
421 |
+
'MutableDenseMatrix', 'DeferredVector', 'MatrixBase', 'Matrix',
|
422 |
+
'MutableMatrix', 'MutableSparseMatrix', 'banded', 'ImmutableDenseMatrix',
|
423 |
+
'ImmutableSparseMatrix', 'ImmutableMatrix', 'SparseMatrix', 'MatrixSlice',
|
424 |
+
'BlockDiagMatrix', 'BlockMatrix', 'FunctionMatrix', 'Identity', 'Inverse',
|
425 |
+
'MatAdd', 'MatMul', 'MatPow', 'MatrixExpr', 'MatrixSymbol', 'Trace',
|
426 |
+
'Transpose', 'ZeroMatrix', 'OneMatrix', 'blockcut', 'block_collapse',
|
427 |
+
'matrix_symbols', 'Adjoint', 'hadamard_product', 'HadamardProduct',
|
428 |
+
'HadamardPower', 'Determinant', 'det', 'diagonalize_vector', 'DiagMatrix',
|
429 |
+
'DiagonalMatrix', 'DiagonalOf', 'trace', 'DotProduct',
|
430 |
+
'kronecker_product', 'KroneckerProduct', 'PermutationMatrix',
|
431 |
+
'MatrixPermute', 'Permanent', 'per', 'rot_ccw_axis1', 'rot_ccw_axis2',
|
432 |
+
'rot_ccw_axis3', 'rot_givens',
|
433 |
+
|
434 |
+
# sympy.geometry
|
435 |
+
'Point', 'Point2D', 'Point3D', 'Line', 'Ray', 'Segment', 'Line2D',
|
436 |
+
'Segment2D', 'Ray2D', 'Line3D', 'Segment3D', 'Ray3D', 'Plane', 'Ellipse',
|
437 |
+
'Circle', 'Polygon', 'RegularPolygon', 'Triangle', 'rad', 'deg',
|
438 |
+
'are_similar', 'centroid', 'convex_hull', 'idiff', 'intersection',
|
439 |
+
'closest_points', 'farthest_points', 'GeometryError', 'Curve', 'Parabola',
|
440 |
+
|
441 |
+
# sympy.utilities
|
442 |
+
'flatten', 'group', 'take', 'subsets', 'variations', 'numbered_symbols',
|
443 |
+
'cartes', 'capture', 'dict_merge', 'prefixes', 'postfixes', 'sift',
|
444 |
+
'topological_sort', 'unflatten', 'has_dups', 'has_variety', 'reshape',
|
445 |
+
'rotations', 'filldedent', 'lambdify', 'threaded', 'xthreaded',
|
446 |
+
'public', 'memoize_property', 'timed',
|
447 |
+
|
448 |
+
# sympy.integrals
|
449 |
+
'integrate', 'Integral', 'line_integrate', 'mellin_transform',
|
450 |
+
'inverse_mellin_transform', 'MellinTransform', 'InverseMellinTransform',
|
451 |
+
'laplace_transform', 'inverse_laplace_transform', 'LaplaceTransform',
|
452 |
+
'InverseLaplaceTransform', 'fourier_transform',
|
453 |
+
'inverse_fourier_transform', 'FourierTransform',
|
454 |
+
'InverseFourierTransform', 'sine_transform', 'inverse_sine_transform',
|
455 |
+
'SineTransform', 'InverseSineTransform', 'cosine_transform',
|
456 |
+
'inverse_cosine_transform', 'CosineTransform', 'InverseCosineTransform',
|
457 |
+
'hankel_transform', 'inverse_hankel_transform', 'HankelTransform',
|
458 |
+
'InverseHankelTransform', 'singularityintegrate',
|
459 |
+
|
460 |
+
# sympy.tensor
|
461 |
+
'IndexedBase', 'Idx', 'Indexed', 'get_contraction_structure',
|
462 |
+
'get_indices', 'shape', 'MutableDenseNDimArray', 'ImmutableDenseNDimArray',
|
463 |
+
'MutableSparseNDimArray', 'ImmutableSparseNDimArray', 'NDimArray',
|
464 |
+
'tensorproduct', 'tensorcontraction', 'tensordiagonal', 'derive_by_array',
|
465 |
+
'permutedims', 'Array', 'DenseNDimArray', 'SparseNDimArray',
|
466 |
+
|
467 |
+
# sympy.parsing
|
468 |
+
'parse_expr',
|
469 |
+
|
470 |
+
# sympy.calculus
|
471 |
+
'euler_equations', 'singularities', 'is_increasing',
|
472 |
+
'is_strictly_increasing', 'is_decreasing', 'is_strictly_decreasing',
|
473 |
+
'is_monotonic', 'finite_diff_weights', 'apply_finite_diff',
|
474 |
+
'differentiate_finite', 'periodicity', 'not_empty_in',
|
475 |
+
'AccumBounds', 'is_convex', 'stationary_points', 'minimum', 'maximum',
|
476 |
+
|
477 |
+
# sympy.algebras
|
478 |
+
'Quaternion',
|
479 |
+
|
480 |
+
# sympy.printing
|
481 |
+
'pager_print', 'pretty', 'pretty_print', 'pprint', 'pprint_use_unicode',
|
482 |
+
'pprint_try_use_unicode', 'latex', 'print_latex', 'multiline_latex',
|
483 |
+
'mathml', 'print_mathml', 'python', 'print_python', 'pycode', 'ccode',
|
484 |
+
'print_ccode', 'smtlib_code', 'glsl_code', 'print_glsl', 'cxxcode', 'fcode',
|
485 |
+
'print_fcode', 'rcode', 'print_rcode', 'jscode', 'print_jscode',
|
486 |
+
'julia_code', 'mathematica_code', 'octave_code', 'rust_code', 'print_gtk',
|
487 |
+
'preview', 'srepr', 'print_tree', 'StrPrinter', 'sstr', 'sstrrepr',
|
488 |
+
'TableForm', 'dotprint', 'maple_code', 'print_maple_code',
|
489 |
+
|
490 |
+
# sympy.plotting
|
491 |
+
'plot', 'textplot', 'plot_backends', 'plot_implicit', 'plot_parametric',
|
492 |
+
|
493 |
+
# sympy.interactive
|
494 |
+
'init_session', 'init_printing', 'interactive_traversal',
|
495 |
+
|
496 |
+
# sympy.testing
|
497 |
+
'test', 'doctest',
|
498 |
+
]
|
499 |
+
|
500 |
+
|
501 |
+
#===========================================================================#
|
502 |
+
# #
|
503 |
+
# XXX: The names below were importable before SymPy 1.6 using #
|
504 |
+
# #
|
505 |
+
# from sympy import * #
|
506 |
+
# #
|
507 |
+
# This happened implicitly because there was no __all__ defined in this #
|
508 |
+
# __init__.py file. Not every package is imported. The list matches what #
|
509 |
+
# would have been imported before. It is possible that these packages will #
|
510 |
+
# not be imported by a star-import from sympy in future. #
|
511 |
+
# #
|
512 |
+
#===========================================================================#
|
513 |
+
|
514 |
+
|
515 |
+
__all__.extend((
|
516 |
+
'algebras',
|
517 |
+
'assumptions',
|
518 |
+
'calculus',
|
519 |
+
'concrete',
|
520 |
+
'discrete',
|
521 |
+
'external',
|
522 |
+
'functions',
|
523 |
+
'geometry',
|
524 |
+
'interactive',
|
525 |
+
'multipledispatch',
|
526 |
+
'ntheory',
|
527 |
+
'parsing',
|
528 |
+
'plotting',
|
529 |
+
'polys',
|
530 |
+
'printing',
|
531 |
+
'release',
|
532 |
+
'strategies',
|
533 |
+
'tensor',
|
534 |
+
'utilities',
|
535 |
+
))
|
venv/lib/python3.10/site-packages/sympy/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (28.1 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/__pycache__/abc.cpython-310.pyc
ADDED
Binary file (3.53 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/__pycache__/conftest.cpython-310.pyc
ADDED
Binary file (2.55 kB). View file
|
|
venv/lib/python3.10/site-packages/sympy/__pycache__/galgebra.cpython-310.pyc
ADDED
Binary file (285 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/__pycache__/release.cpython-310.pyc
ADDED
Binary file (192 Bytes). View file
|
|
venv/lib/python3.10/site-packages/sympy/__pycache__/this.cpython-310.pyc
ADDED
Binary file (733 Bytes). View file
|
|