Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +4 -0
- .venv/lib/python3.11/site-packages/attr/__init__.pyi +389 -0
- .venv/lib/python3.11/site-packages/attr/_cmp.py +160 -0
- .venv/lib/python3.11/site-packages/attr/_cmp.pyi +13 -0
- .venv/lib/python3.11/site-packages/attr/_make.py +3055 -0
- .venv/lib/python3.11/site-packages/attr/_next_gen.py +623 -0
- .venv/lib/python3.11/site-packages/attr/_typing_compat.pyi +15 -0
- .venv/lib/python3.11/site-packages/attr/_version_info.py +86 -0
- .venv/lib/python3.11/site-packages/attr/converters.py +162 -0
- .venv/lib/python3.11/site-packages/attr/converters.pyi +19 -0
- .venv/lib/python3.11/site-packages/attr/exceptions.py +95 -0
- .venv/lib/python3.11/site-packages/attr/filters.py +72 -0
- .venv/lib/python3.11/site-packages/attr/filters.pyi +6 -0
- .venv/lib/python3.11/site-packages/attr/py.typed +0 -0
- .venv/lib/python3.11/site-packages/attr/setters.py +79 -0
- .venv/lib/python3.11/site-packages/attr/setters.pyi +20 -0
- .venv/lib/python3.11/site-packages/attr/validators.py +710 -0
- .venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/INSTALLER +1 -0
- .venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/LICENSE +20 -0
- .venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/METADATA +151 -0
- .venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/RECORD +12 -0
- .venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/WHEEL +5 -0
- .venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/top_level.txt +1 -0
- .venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/INSTALLER +1 -0
- .venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/LICENSE.txt +971 -0
- .venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/METADATA +1092 -0
- .venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/RECORD +0 -0
- .venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/WHEEL +6 -0
- .venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/entry_points.txt +9 -0
- .venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/INSTALLER +1 -0
- .venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/License.txt +1568 -0
- .venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/METADATA +35 -0
- .venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/RECORD +32 -0
- .venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/WHEEL +5 -0
- .venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/top_level.txt +1 -0
- .venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/INSTALLER +1 -0
- .venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/License.txt +1568 -0
- .venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/METADATA +38 -0
- .venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/RECORD +22 -0
- .venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/WHEEL +5 -0
- .venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/top_level.txt +1 -0
- .venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/INSTALLER +1 -0
- .venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/LICENSE +32 -0
- .venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/METADATA +17 -0
- .venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/RECORD +116 -0
- .venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/WHEEL +4 -0
- .venv/lib/python3.11/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo +3 -0
- .venv/lib/python3.11/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo +3 -0
- .venv/lib/python3.11/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo +3 -0
- .venv/lib/python3.11/site-packages/pycparser-2.22.dist-info/INSTALLER +1 -0
.gitattributes
CHANGED
|
@@ -245,3 +245,7 @@ tuning-competition-baseline/.venv/lib/python3.11/site-packages/torch/_inductor/_
|
|
| 245 |
.venv/lib/python3.11/site-packages/pycountry/locales/gl/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
| 246 |
.venv/lib/python3.11/site-packages/pycountry/locales/sv/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text
|
| 247 |
.venv/lib/python3.11/site-packages/pycountry/locales/sv/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
.venv/lib/python3.11/site-packages/pycountry/locales/gl/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
| 246 |
.venv/lib/python3.11/site-packages/pycountry/locales/sv/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text
|
| 247 |
.venv/lib/python3.11/site-packages/pycountry/locales/sv/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
| 248 |
+
.venv/lib/python3.11/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
| 249 |
+
.venv/lib/python3.11/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
| 250 |
+
.venv/lib/python3.11/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text
|
| 251 |
+
.venv/lib/python3.11/site-packages/pycparser/ply/__pycache__/yacc.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
|
.venv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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import enum
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
from typing import (
|
| 5 |
+
Any,
|
| 6 |
+
Callable,
|
| 7 |
+
Generic,
|
| 8 |
+
Literal,
|
| 9 |
+
Mapping,
|
| 10 |
+
Protocol,
|
| 11 |
+
Sequence,
|
| 12 |
+
TypeVar,
|
| 13 |
+
overload,
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
# `import X as X` is required to make these public
|
| 17 |
+
from . import converters as converters
|
| 18 |
+
from . import exceptions as exceptions
|
| 19 |
+
from . import filters as filters
|
| 20 |
+
from . import setters as setters
|
| 21 |
+
from . import validators as validators
|
| 22 |
+
from ._cmp import cmp_using as cmp_using
|
| 23 |
+
from ._typing_compat import AttrsInstance_
|
| 24 |
+
from ._version_info import VersionInfo
|
| 25 |
+
from attrs import (
|
| 26 |
+
define as define,
|
| 27 |
+
field as field,
|
| 28 |
+
mutable as mutable,
|
| 29 |
+
frozen as frozen,
|
| 30 |
+
_EqOrderType,
|
| 31 |
+
_ValidatorType,
|
| 32 |
+
_ConverterType,
|
| 33 |
+
_ReprArgType,
|
| 34 |
+
_OnSetAttrType,
|
| 35 |
+
_OnSetAttrArgType,
|
| 36 |
+
_FieldTransformer,
|
| 37 |
+
_ValidatorArgType,
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
if sys.version_info >= (3, 10):
|
| 41 |
+
from typing import TypeGuard, TypeAlias
|
| 42 |
+
else:
|
| 43 |
+
from typing_extensions import TypeGuard, TypeAlias
|
| 44 |
+
|
| 45 |
+
if sys.version_info >= (3, 11):
|
| 46 |
+
from typing import dataclass_transform
|
| 47 |
+
else:
|
| 48 |
+
from typing_extensions import dataclass_transform
|
| 49 |
+
|
| 50 |
+
__version__: str
|
| 51 |
+
__version_info__: VersionInfo
|
| 52 |
+
__title__: str
|
| 53 |
+
__description__: str
|
| 54 |
+
__url__: str
|
| 55 |
+
__uri__: str
|
| 56 |
+
__author__: str
|
| 57 |
+
__email__: str
|
| 58 |
+
__license__: str
|
| 59 |
+
__copyright__: str
|
| 60 |
+
|
| 61 |
+
_T = TypeVar("_T")
|
| 62 |
+
_C = TypeVar("_C", bound=type)
|
| 63 |
+
|
| 64 |
+
_FilterType = Callable[["Attribute[_T]", _T], bool]
|
| 65 |
+
|
| 66 |
+
# We subclass this here to keep the protocol's qualified name clean.
|
| 67 |
+
class AttrsInstance(AttrsInstance_, Protocol):
|
| 68 |
+
pass
|
| 69 |
+
|
| 70 |
+
_A = TypeVar("_A", bound=type[AttrsInstance])
|
| 71 |
+
|
| 72 |
+
class _Nothing(enum.Enum):
|
| 73 |
+
NOTHING = enum.auto()
|
| 74 |
+
|
| 75 |
+
NOTHING = _Nothing.NOTHING
|
| 76 |
+
NothingType: TypeAlias = Literal[_Nothing.NOTHING]
|
| 77 |
+
|
| 78 |
+
# NOTE: Factory lies about its return type to make this possible:
|
| 79 |
+
# `x: List[int] # = Factory(list)`
|
| 80 |
+
# Work around mypy issue #4554 in the common case by using an overload.
|
| 81 |
+
|
| 82 |
+
@overload
|
| 83 |
+
def Factory(factory: Callable[[], _T]) -> _T: ...
|
| 84 |
+
@overload
|
| 85 |
+
def Factory(
|
| 86 |
+
factory: Callable[[Any], _T],
|
| 87 |
+
takes_self: Literal[True],
|
| 88 |
+
) -> _T: ...
|
| 89 |
+
@overload
|
| 90 |
+
def Factory(
|
| 91 |
+
factory: Callable[[], _T],
|
| 92 |
+
takes_self: Literal[False],
|
| 93 |
+
) -> _T: ...
|
| 94 |
+
|
| 95 |
+
In = TypeVar("In")
|
| 96 |
+
Out = TypeVar("Out")
|
| 97 |
+
|
| 98 |
+
class Converter(Generic[In, Out]):
|
| 99 |
+
@overload
|
| 100 |
+
def __init__(self, converter: Callable[[In], Out]) -> None: ...
|
| 101 |
+
@overload
|
| 102 |
+
def __init__(
|
| 103 |
+
self,
|
| 104 |
+
converter: Callable[[In, AttrsInstance, Attribute], Out],
|
| 105 |
+
*,
|
| 106 |
+
takes_self: Literal[True],
|
| 107 |
+
takes_field: Literal[True],
|
| 108 |
+
) -> None: ...
|
| 109 |
+
@overload
|
| 110 |
+
def __init__(
|
| 111 |
+
self,
|
| 112 |
+
converter: Callable[[In, Attribute], Out],
|
| 113 |
+
*,
|
| 114 |
+
takes_field: Literal[True],
|
| 115 |
+
) -> None: ...
|
| 116 |
+
@overload
|
| 117 |
+
def __init__(
|
| 118 |
+
self,
|
| 119 |
+
converter: Callable[[In, AttrsInstance], Out],
|
| 120 |
+
*,
|
| 121 |
+
takes_self: Literal[True],
|
| 122 |
+
) -> None: ...
|
| 123 |
+
|
| 124 |
+
class Attribute(Generic[_T]):
|
| 125 |
+
name: str
|
| 126 |
+
default: _T | None
|
| 127 |
+
validator: _ValidatorType[_T] | None
|
| 128 |
+
repr: _ReprArgType
|
| 129 |
+
cmp: _EqOrderType
|
| 130 |
+
eq: _EqOrderType
|
| 131 |
+
order: _EqOrderType
|
| 132 |
+
hash: bool | None
|
| 133 |
+
init: bool
|
| 134 |
+
converter: Converter | None
|
| 135 |
+
metadata: dict[Any, Any]
|
| 136 |
+
type: type[_T] | None
|
| 137 |
+
kw_only: bool
|
| 138 |
+
on_setattr: _OnSetAttrType
|
| 139 |
+
alias: str | None
|
| 140 |
+
|
| 141 |
+
def evolve(self, **changes: Any) -> "Attribute[Any]": ...
|
| 142 |
+
|
| 143 |
+
# NOTE: We had several choices for the annotation to use for type arg:
|
| 144 |
+
# 1) Type[_T]
|
| 145 |
+
# - Pros: Handles simple cases correctly
|
| 146 |
+
# - Cons: Might produce less informative errors in the case of conflicting
|
| 147 |
+
# TypeVars e.g. `attr.ib(default='bad', type=int)`
|
| 148 |
+
# 2) Callable[..., _T]
|
| 149 |
+
# - Pros: Better error messages than #1 for conflicting TypeVars
|
| 150 |
+
# - Cons: Terrible error messages for validator checks.
|
| 151 |
+
# e.g. attr.ib(type=int, validator=validate_str)
|
| 152 |
+
# -> error: Cannot infer function type argument
|
| 153 |
+
# 3) type (and do all of the work in the mypy plugin)
|
| 154 |
+
# - Pros: Simple here, and we could customize the plugin with our own errors.
|
| 155 |
+
# - Cons: Would need to write mypy plugin code to handle all the cases.
|
| 156 |
+
# We chose option #1.
|
| 157 |
+
|
| 158 |
+
# `attr` lies about its return type to make the following possible:
|
| 159 |
+
# attr() -> Any
|
| 160 |
+
# attr(8) -> int
|
| 161 |
+
# attr(validator=<some callable>) -> Whatever the callable expects.
|
| 162 |
+
# This makes this type of assignments possible:
|
| 163 |
+
# x: int = attr(8)
|
| 164 |
+
#
|
| 165 |
+
# This form catches explicit None or no default but with no other arguments
|
| 166 |
+
# returns Any.
|
| 167 |
+
@overload
|
| 168 |
+
def attrib(
|
| 169 |
+
default: None = ...,
|
| 170 |
+
validator: None = ...,
|
| 171 |
+
repr: _ReprArgType = ...,
|
| 172 |
+
cmp: _EqOrderType | None = ...,
|
| 173 |
+
hash: bool | None = ...,
|
| 174 |
+
init: bool = ...,
|
| 175 |
+
metadata: Mapping[Any, Any] | None = ...,
|
| 176 |
+
type: None = ...,
|
| 177 |
+
converter: None = ...,
|
| 178 |
+
factory: None = ...,
|
| 179 |
+
kw_only: bool = ...,
|
| 180 |
+
eq: _EqOrderType | None = ...,
|
| 181 |
+
order: _EqOrderType | None = ...,
|
| 182 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 183 |
+
alias: str | None = ...,
|
| 184 |
+
) -> Any: ...
|
| 185 |
+
|
| 186 |
+
# This form catches an explicit None or no default and infers the type from the
|
| 187 |
+
# other arguments.
|
| 188 |
+
@overload
|
| 189 |
+
def attrib(
|
| 190 |
+
default: None = ...,
|
| 191 |
+
validator: _ValidatorArgType[_T] | None = ...,
|
| 192 |
+
repr: _ReprArgType = ...,
|
| 193 |
+
cmp: _EqOrderType | None = ...,
|
| 194 |
+
hash: bool | None = ...,
|
| 195 |
+
init: bool = ...,
|
| 196 |
+
metadata: Mapping[Any, Any] | None = ...,
|
| 197 |
+
type: type[_T] | None = ...,
|
| 198 |
+
converter: _ConverterType
|
| 199 |
+
| list[_ConverterType]
|
| 200 |
+
| tuple[_ConverterType]
|
| 201 |
+
| None = ...,
|
| 202 |
+
factory: Callable[[], _T] | None = ...,
|
| 203 |
+
kw_only: bool = ...,
|
| 204 |
+
eq: _EqOrderType | None = ...,
|
| 205 |
+
order: _EqOrderType | None = ...,
|
| 206 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 207 |
+
alias: str | None = ...,
|
| 208 |
+
) -> _T: ...
|
| 209 |
+
|
| 210 |
+
# This form catches an explicit default argument.
|
| 211 |
+
@overload
|
| 212 |
+
def attrib(
|
| 213 |
+
default: _T,
|
| 214 |
+
validator: _ValidatorArgType[_T] | None = ...,
|
| 215 |
+
repr: _ReprArgType = ...,
|
| 216 |
+
cmp: _EqOrderType | None = ...,
|
| 217 |
+
hash: bool | None = ...,
|
| 218 |
+
init: bool = ...,
|
| 219 |
+
metadata: Mapping[Any, Any] | None = ...,
|
| 220 |
+
type: type[_T] | None = ...,
|
| 221 |
+
converter: _ConverterType
|
| 222 |
+
| list[_ConverterType]
|
| 223 |
+
| tuple[_ConverterType]
|
| 224 |
+
| None = ...,
|
| 225 |
+
factory: Callable[[], _T] | None = ...,
|
| 226 |
+
kw_only: bool = ...,
|
| 227 |
+
eq: _EqOrderType | None = ...,
|
| 228 |
+
order: _EqOrderType | None = ...,
|
| 229 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 230 |
+
alias: str | None = ...,
|
| 231 |
+
) -> _T: ...
|
| 232 |
+
|
| 233 |
+
# This form covers type=non-Type: e.g. forward references (str), Any
|
| 234 |
+
@overload
|
| 235 |
+
def attrib(
|
| 236 |
+
default: _T | None = ...,
|
| 237 |
+
validator: _ValidatorArgType[_T] | None = ...,
|
| 238 |
+
repr: _ReprArgType = ...,
|
| 239 |
+
cmp: _EqOrderType | None = ...,
|
| 240 |
+
hash: bool | None = ...,
|
| 241 |
+
init: bool = ...,
|
| 242 |
+
metadata: Mapping[Any, Any] | None = ...,
|
| 243 |
+
type: object = ...,
|
| 244 |
+
converter: _ConverterType
|
| 245 |
+
| list[_ConverterType]
|
| 246 |
+
| tuple[_ConverterType]
|
| 247 |
+
| None = ...,
|
| 248 |
+
factory: Callable[[], _T] | None = ...,
|
| 249 |
+
kw_only: bool = ...,
|
| 250 |
+
eq: _EqOrderType | None = ...,
|
| 251 |
+
order: _EqOrderType | None = ...,
|
| 252 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 253 |
+
alias: str | None = ...,
|
| 254 |
+
) -> Any: ...
|
| 255 |
+
@overload
|
| 256 |
+
@dataclass_transform(order_default=True, field_specifiers=(attrib, field))
|
| 257 |
+
def attrs(
|
| 258 |
+
maybe_cls: _C,
|
| 259 |
+
these: dict[str, Any] | None = ...,
|
| 260 |
+
repr_ns: str | None = ...,
|
| 261 |
+
repr: bool = ...,
|
| 262 |
+
cmp: _EqOrderType | None = ...,
|
| 263 |
+
hash: bool | None = ...,
|
| 264 |
+
init: bool = ...,
|
| 265 |
+
slots: bool = ...,
|
| 266 |
+
frozen: bool = ...,
|
| 267 |
+
weakref_slot: bool = ...,
|
| 268 |
+
str: bool = ...,
|
| 269 |
+
auto_attribs: bool = ...,
|
| 270 |
+
kw_only: bool = ...,
|
| 271 |
+
cache_hash: bool = ...,
|
| 272 |
+
auto_exc: bool = ...,
|
| 273 |
+
eq: _EqOrderType | None = ...,
|
| 274 |
+
order: _EqOrderType | None = ...,
|
| 275 |
+
auto_detect: bool = ...,
|
| 276 |
+
collect_by_mro: bool = ...,
|
| 277 |
+
getstate_setstate: bool | None = ...,
|
| 278 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 279 |
+
field_transformer: _FieldTransformer | None = ...,
|
| 280 |
+
match_args: bool = ...,
|
| 281 |
+
unsafe_hash: bool | None = ...,
|
| 282 |
+
) -> _C: ...
|
| 283 |
+
@overload
|
| 284 |
+
@dataclass_transform(order_default=True, field_specifiers=(attrib, field))
|
| 285 |
+
def attrs(
|
| 286 |
+
maybe_cls: None = ...,
|
| 287 |
+
these: dict[str, Any] | None = ...,
|
| 288 |
+
repr_ns: str | None = ...,
|
| 289 |
+
repr: bool = ...,
|
| 290 |
+
cmp: _EqOrderType | None = ...,
|
| 291 |
+
hash: bool | None = ...,
|
| 292 |
+
init: bool = ...,
|
| 293 |
+
slots: bool = ...,
|
| 294 |
+
frozen: bool = ...,
|
| 295 |
+
weakref_slot: bool = ...,
|
| 296 |
+
str: bool = ...,
|
| 297 |
+
auto_attribs: bool = ...,
|
| 298 |
+
kw_only: bool = ...,
|
| 299 |
+
cache_hash: bool = ...,
|
| 300 |
+
auto_exc: bool = ...,
|
| 301 |
+
eq: _EqOrderType | None = ...,
|
| 302 |
+
order: _EqOrderType | None = ...,
|
| 303 |
+
auto_detect: bool = ...,
|
| 304 |
+
collect_by_mro: bool = ...,
|
| 305 |
+
getstate_setstate: bool | None = ...,
|
| 306 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 307 |
+
field_transformer: _FieldTransformer | None = ...,
|
| 308 |
+
match_args: bool = ...,
|
| 309 |
+
unsafe_hash: bool | None = ...,
|
| 310 |
+
) -> Callable[[_C], _C]: ...
|
| 311 |
+
def fields(cls: type[AttrsInstance]) -> Any: ...
|
| 312 |
+
def fields_dict(cls: type[AttrsInstance]) -> dict[str, Attribute[Any]]: ...
|
| 313 |
+
def validate(inst: AttrsInstance) -> None: ...
|
| 314 |
+
def resolve_types(
|
| 315 |
+
cls: _A,
|
| 316 |
+
globalns: dict[str, Any] | None = ...,
|
| 317 |
+
localns: dict[str, Any] | None = ...,
|
| 318 |
+
attribs: list[Attribute[Any]] | None = ...,
|
| 319 |
+
include_extras: bool = ...,
|
| 320 |
+
) -> _A: ...
|
| 321 |
+
|
| 322 |
+
# TODO: add support for returning a proper attrs class from the mypy plugin
|
| 323 |
+
# we use Any instead of _CountingAttr so that e.g. `make_class('Foo',
|
| 324 |
+
# [attr.ib()])` is valid
|
| 325 |
+
def make_class(
|
| 326 |
+
name: str,
|
| 327 |
+
attrs: list[str] | tuple[str, ...] | dict[str, Any],
|
| 328 |
+
bases: tuple[type, ...] = ...,
|
| 329 |
+
class_body: dict[str, Any] | None = ...,
|
| 330 |
+
repr_ns: str | None = ...,
|
| 331 |
+
repr: bool = ...,
|
| 332 |
+
cmp: _EqOrderType | None = ...,
|
| 333 |
+
hash: bool | None = ...,
|
| 334 |
+
init: bool = ...,
|
| 335 |
+
slots: bool = ...,
|
| 336 |
+
frozen: bool = ...,
|
| 337 |
+
weakref_slot: bool = ...,
|
| 338 |
+
str: bool = ...,
|
| 339 |
+
auto_attribs: bool = ...,
|
| 340 |
+
kw_only: bool = ...,
|
| 341 |
+
cache_hash: bool = ...,
|
| 342 |
+
auto_exc: bool = ...,
|
| 343 |
+
eq: _EqOrderType | None = ...,
|
| 344 |
+
order: _EqOrderType | None = ...,
|
| 345 |
+
collect_by_mro: bool = ...,
|
| 346 |
+
on_setattr: _OnSetAttrArgType | None = ...,
|
| 347 |
+
field_transformer: _FieldTransformer | None = ...,
|
| 348 |
+
) -> type: ...
|
| 349 |
+
|
| 350 |
+
# _funcs --
|
| 351 |
+
|
| 352 |
+
# TODO: add support for returning TypedDict from the mypy plugin
|
| 353 |
+
# FIXME: asdict/astuple do not honor their factory args. Waiting on one of
|
| 354 |
+
# these:
|
| 355 |
+
# https://github.com/python/mypy/issues/4236
|
| 356 |
+
# https://github.com/python/typing/issues/253
|
| 357 |
+
# XXX: remember to fix attrs.asdict/astuple too!
|
| 358 |
+
def asdict(
|
| 359 |
+
inst: AttrsInstance,
|
| 360 |
+
recurse: bool = ...,
|
| 361 |
+
filter: _FilterType[Any] | None = ...,
|
| 362 |
+
dict_factory: type[Mapping[Any, Any]] = ...,
|
| 363 |
+
retain_collection_types: bool = ...,
|
| 364 |
+
value_serializer: Callable[[type, Attribute[Any], Any], Any] | None = ...,
|
| 365 |
+
tuple_keys: bool | None = ...,
|
| 366 |
+
) -> dict[str, Any]: ...
|
| 367 |
+
|
| 368 |
+
# TODO: add support for returning NamedTuple from the mypy plugin
|
| 369 |
+
def astuple(
|
| 370 |
+
inst: AttrsInstance,
|
| 371 |
+
recurse: bool = ...,
|
| 372 |
+
filter: _FilterType[Any] | None = ...,
|
| 373 |
+
tuple_factory: type[Sequence[Any]] = ...,
|
| 374 |
+
retain_collection_types: bool = ...,
|
| 375 |
+
) -> tuple[Any, ...]: ...
|
| 376 |
+
def has(cls: type) -> TypeGuard[type[AttrsInstance]]: ...
|
| 377 |
+
def assoc(inst: _T, **changes: Any) -> _T: ...
|
| 378 |
+
def evolve(inst: _T, **changes: Any) -> _T: ...
|
| 379 |
+
|
| 380 |
+
# _config --
|
| 381 |
+
|
| 382 |
+
def set_run_validators(run: bool) -> None: ...
|
| 383 |
+
def get_run_validators() -> bool: ...
|
| 384 |
+
|
| 385 |
+
# aliases --
|
| 386 |
+
|
| 387 |
+
s = attributes = attrs
|
| 388 |
+
ib = attr = attrib
|
| 389 |
+
dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;)
|
.venv/lib/python3.11/site-packages/attr/_cmp.py
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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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 |
+
Args:
|
| 30 |
+
eq (typing.Callable | None):
|
| 31 |
+
Callable used to evaluate equality of two objects.
|
| 32 |
+
|
| 33 |
+
lt (typing.Callable | None):
|
| 34 |
+
Callable used to evaluate whether one object is less than another
|
| 35 |
+
object.
|
| 36 |
+
|
| 37 |
+
le (typing.Callable | None):
|
| 38 |
+
Callable used to evaluate whether one object is less than or equal
|
| 39 |
+
to another object.
|
| 40 |
+
|
| 41 |
+
gt (typing.Callable | None):
|
| 42 |
+
Callable used to evaluate whether one object is greater than
|
| 43 |
+
another object.
|
| 44 |
+
|
| 45 |
+
ge (typing.Callable | None):
|
| 46 |
+
Callable used to evaluate whether one object is greater than or
|
| 47 |
+
equal to another object.
|
| 48 |
+
|
| 49 |
+
require_same_type (bool):
|
| 50 |
+
When `True`, equality and ordering methods will return
|
| 51 |
+
`NotImplemented` if objects are not of the same type.
|
| 52 |
+
|
| 53 |
+
class_name (str | None): Name of class. Defaults to "Comparable".
|
| 54 |
+
|
| 55 |
+
See `comparison` for more details.
|
| 56 |
+
|
| 57 |
+
.. versionadded:: 21.1.0
|
| 58 |
+
"""
|
| 59 |
+
|
| 60 |
+
body = {
|
| 61 |
+
"__slots__": ["value"],
|
| 62 |
+
"__init__": _make_init(),
|
| 63 |
+
"_requirements": [],
|
| 64 |
+
"_is_comparable_to": _is_comparable_to,
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
# Add operations.
|
| 68 |
+
num_order_functions = 0
|
| 69 |
+
has_eq_function = False
|
| 70 |
+
|
| 71 |
+
if eq is not None:
|
| 72 |
+
has_eq_function = True
|
| 73 |
+
body["__eq__"] = _make_operator("eq", eq)
|
| 74 |
+
body["__ne__"] = _make_ne()
|
| 75 |
+
|
| 76 |
+
if lt is not None:
|
| 77 |
+
num_order_functions += 1
|
| 78 |
+
body["__lt__"] = _make_operator("lt", lt)
|
| 79 |
+
|
| 80 |
+
if le is not None:
|
| 81 |
+
num_order_functions += 1
|
| 82 |
+
body["__le__"] = _make_operator("le", le)
|
| 83 |
+
|
| 84 |
+
if gt is not None:
|
| 85 |
+
num_order_functions += 1
|
| 86 |
+
body["__gt__"] = _make_operator("gt", gt)
|
| 87 |
+
|
| 88 |
+
if ge is not None:
|
| 89 |
+
num_order_functions += 1
|
| 90 |
+
body["__ge__"] = _make_operator("ge", ge)
|
| 91 |
+
|
| 92 |
+
type_ = types.new_class(
|
| 93 |
+
class_name, (object,), {}, lambda ns: ns.update(body)
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
# Add same type requirement.
|
| 97 |
+
if require_same_type:
|
| 98 |
+
type_._requirements.append(_check_same_type)
|
| 99 |
+
|
| 100 |
+
# Add total ordering if at least one operation was defined.
|
| 101 |
+
if 0 < num_order_functions < 4:
|
| 102 |
+
if not has_eq_function:
|
| 103 |
+
# functools.total_ordering requires __eq__ to be defined,
|
| 104 |
+
# so raise early error here to keep a nice stack.
|
| 105 |
+
msg = "eq must be define is order to complete ordering from lt, le, gt, ge."
|
| 106 |
+
raise ValueError(msg)
|
| 107 |
+
type_ = functools.total_ordering(type_)
|
| 108 |
+
|
| 109 |
+
return type_
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def _make_init():
|
| 113 |
+
"""
|
| 114 |
+
Create __init__ method.
|
| 115 |
+
"""
|
| 116 |
+
|
| 117 |
+
def __init__(self, value):
|
| 118 |
+
"""
|
| 119 |
+
Initialize object with *value*.
|
| 120 |
+
"""
|
| 121 |
+
self.value = value
|
| 122 |
+
|
| 123 |
+
return __init__
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def _make_operator(name, func):
|
| 127 |
+
"""
|
| 128 |
+
Create operator method.
|
| 129 |
+
"""
|
| 130 |
+
|
| 131 |
+
def method(self, other):
|
| 132 |
+
if not self._is_comparable_to(other):
|
| 133 |
+
return NotImplemented
|
| 134 |
+
|
| 135 |
+
result = func(self.value, other.value)
|
| 136 |
+
if result is NotImplemented:
|
| 137 |
+
return NotImplemented
|
| 138 |
+
|
| 139 |
+
return result
|
| 140 |
+
|
| 141 |
+
method.__name__ = f"__{name}__"
|
| 142 |
+
method.__doc__ = (
|
| 143 |
+
f"Return a {_operation_names[name]} b. Computed by attrs."
|
| 144 |
+
)
|
| 145 |
+
|
| 146 |
+
return method
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
def _is_comparable_to(self, other):
|
| 150 |
+
"""
|
| 151 |
+
Check whether `other` is comparable to `self`.
|
| 152 |
+
"""
|
| 153 |
+
return all(func(self, other) for func in self._requirements)
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def _check_same_type(self, other):
|
| 157 |
+
"""
|
| 158 |
+
Return True if *self* and *other* are of the same type, False otherwise.
|
| 159 |
+
"""
|
| 160 |
+
return other.value.__class__ is self.value.__class__
|
.venv/lib/python3.11/site-packages/attr/_cmp.pyi
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, Callable
|
| 2 |
+
|
| 3 |
+
_CompareWithType = Callable[[Any, Any], bool]
|
| 4 |
+
|
| 5 |
+
def cmp_using(
|
| 6 |
+
eq: _CompareWithType | None = ...,
|
| 7 |
+
lt: _CompareWithType | None = ...,
|
| 8 |
+
le: _CompareWithType | None = ...,
|
| 9 |
+
gt: _CompareWithType | None = ...,
|
| 10 |
+
ge: _CompareWithType | None = ...,
|
| 11 |
+
require_same_type: bool = ...,
|
| 12 |
+
class_name: str = ...,
|
| 13 |
+
) -> type: ...
|
.venv/lib/python3.11/site-packages/attr/_make.py
ADDED
|
@@ -0,0 +1,3055 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: MIT
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import abc
|
| 6 |
+
import contextlib
|
| 7 |
+
import copy
|
| 8 |
+
import enum
|
| 9 |
+
import functools
|
| 10 |
+
import inspect
|
| 11 |
+
import itertools
|
| 12 |
+
import linecache
|
| 13 |
+
import sys
|
| 14 |
+
import types
|
| 15 |
+
import typing
|
| 16 |
+
|
| 17 |
+
from operator import itemgetter
|
| 18 |
+
|
| 19 |
+
# We need to import _compat itself in addition to the _compat members to avoid
|
| 20 |
+
# having the thread-local in the globals here.
|
| 21 |
+
from . import _compat, _config, setters
|
| 22 |
+
from ._compat import (
|
| 23 |
+
PY_3_10_PLUS,
|
| 24 |
+
PY_3_11_PLUS,
|
| 25 |
+
PY_3_13_PLUS,
|
| 26 |
+
_AnnotationExtractor,
|
| 27 |
+
_get_annotations,
|
| 28 |
+
get_generic_base,
|
| 29 |
+
)
|
| 30 |
+
from .exceptions import (
|
| 31 |
+
DefaultAlreadySetError,
|
| 32 |
+
FrozenInstanceError,
|
| 33 |
+
NotAnAttrsClassError,
|
| 34 |
+
UnannotatedAttributeError,
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
# This is used at least twice, so cache it here.
|
| 39 |
+
_OBJ_SETATTR = object.__setattr__
|
| 40 |
+
_INIT_FACTORY_PAT = "__attr_factory_%s"
|
| 41 |
+
_CLASSVAR_PREFIXES = (
|
| 42 |
+
"typing.ClassVar",
|
| 43 |
+
"t.ClassVar",
|
| 44 |
+
"ClassVar",
|
| 45 |
+
"typing_extensions.ClassVar",
|
| 46 |
+
)
|
| 47 |
+
# we don't use a double-underscore prefix because that triggers
|
| 48 |
+
# name mangling when trying to create a slot for the field
|
| 49 |
+
# (when slots=True)
|
| 50 |
+
_HASH_CACHE_FIELD = "_attrs_cached_hash"
|
| 51 |
+
|
| 52 |
+
_EMPTY_METADATA_SINGLETON = types.MappingProxyType({})
|
| 53 |
+
|
| 54 |
+
# Unique object for unequivocal getattr() defaults.
|
| 55 |
+
_SENTINEL = object()
|
| 56 |
+
|
| 57 |
+
_DEFAULT_ON_SETATTR = setters.pipe(setters.convert, setters.validate)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class _Nothing(enum.Enum):
|
| 61 |
+
"""
|
| 62 |
+
Sentinel to indicate the lack of a value when `None` is ambiguous.
|
| 63 |
+
|
| 64 |
+
If extending attrs, you can use ``typing.Literal[NOTHING]`` to show
|
| 65 |
+
that a value may be ``NOTHING``.
|
| 66 |
+
|
| 67 |
+
.. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
|
| 68 |
+
.. versionchanged:: 22.2.0 ``NOTHING`` is now an ``enum.Enum`` variant.
|
| 69 |
+
"""
|
| 70 |
+
|
| 71 |
+
NOTHING = enum.auto()
|
| 72 |
+
|
| 73 |
+
def __repr__(self):
|
| 74 |
+
return "NOTHING"
|
| 75 |
+
|
| 76 |
+
def __bool__(self):
|
| 77 |
+
return False
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
NOTHING = _Nothing.NOTHING
|
| 81 |
+
"""
|
| 82 |
+
Sentinel to indicate the lack of a value when `None` is ambiguous.
|
| 83 |
+
|
| 84 |
+
When using in 3rd party code, use `attrs.NothingType` for type annotations.
|
| 85 |
+
"""
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
class _CacheHashWrapper(int):
|
| 89 |
+
"""
|
| 90 |
+
An integer subclass that pickles / copies as None
|
| 91 |
+
|
| 92 |
+
This is used for non-slots classes with ``cache_hash=True``, to avoid
|
| 93 |
+
serializing a potentially (even likely) invalid hash value. Since `None`
|
| 94 |
+
is the default value for uncalculated hashes, whenever this is copied,
|
| 95 |
+
the copy's value for the hash should automatically reset.
|
| 96 |
+
|
| 97 |
+
See GH #613 for more details.
|
| 98 |
+
"""
|
| 99 |
+
|
| 100 |
+
def __reduce__(self, _none_constructor=type(None), _args=()): # noqa: B008
|
| 101 |
+
return _none_constructor, _args
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def attrib(
|
| 105 |
+
default=NOTHING,
|
| 106 |
+
validator=None,
|
| 107 |
+
repr=True,
|
| 108 |
+
cmp=None,
|
| 109 |
+
hash=None,
|
| 110 |
+
init=True,
|
| 111 |
+
metadata=None,
|
| 112 |
+
type=None,
|
| 113 |
+
converter=None,
|
| 114 |
+
factory=None,
|
| 115 |
+
kw_only=False,
|
| 116 |
+
eq=None,
|
| 117 |
+
order=None,
|
| 118 |
+
on_setattr=None,
|
| 119 |
+
alias=None,
|
| 120 |
+
):
|
| 121 |
+
"""
|
| 122 |
+
Create a new field / attribute on a class.
|
| 123 |
+
|
| 124 |
+
Identical to `attrs.field`, except it's not keyword-only.
|
| 125 |
+
|
| 126 |
+
Consider using `attrs.field` in new code (``attr.ib`` will *never* go away,
|
| 127 |
+
though).
|
| 128 |
+
|
| 129 |
+
.. warning::
|
| 130 |
+
|
| 131 |
+
Does **nothing** unless the class is also decorated with
|
| 132 |
+
`attr.s` (or similar)!
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
.. versionadded:: 15.2.0 *convert*
|
| 136 |
+
.. versionadded:: 16.3.0 *metadata*
|
| 137 |
+
.. versionchanged:: 17.1.0 *validator* can be a ``list`` now.
|
| 138 |
+
.. versionchanged:: 17.1.0
|
| 139 |
+
*hash* is `None` and therefore mirrors *eq* by default.
|
| 140 |
+
.. versionadded:: 17.3.0 *type*
|
| 141 |
+
.. deprecated:: 17.4.0 *convert*
|
| 142 |
+
.. versionadded:: 17.4.0
|
| 143 |
+
*converter* as a replacement for the deprecated *convert* to achieve
|
| 144 |
+
consistency with other noun-based arguments.
|
| 145 |
+
.. versionadded:: 18.1.0
|
| 146 |
+
``factory=f`` is syntactic sugar for ``default=attr.Factory(f)``.
|
| 147 |
+
.. versionadded:: 18.2.0 *kw_only*
|
| 148 |
+
.. versionchanged:: 19.2.0 *convert* keyword argument removed.
|
| 149 |
+
.. versionchanged:: 19.2.0 *repr* also accepts a custom callable.
|
| 150 |
+
.. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
|
| 151 |
+
.. versionadded:: 19.2.0 *eq* and *order*
|
| 152 |
+
.. versionadded:: 20.1.0 *on_setattr*
|
| 153 |
+
.. versionchanged:: 20.3.0 *kw_only* backported to Python 2
|
| 154 |
+
.. versionchanged:: 21.1.0
|
| 155 |
+
*eq*, *order*, and *cmp* also accept a custom callable
|
| 156 |
+
.. versionchanged:: 21.1.0 *cmp* undeprecated
|
| 157 |
+
.. versionadded:: 22.2.0 *alias*
|
| 158 |
+
"""
|
| 159 |
+
eq, eq_key, order, order_key = _determine_attrib_eq_order(
|
| 160 |
+
cmp, eq, order, True
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
if hash is not None and hash is not True and hash is not False:
|
| 164 |
+
msg = "Invalid value for hash. Must be True, False, or None."
|
| 165 |
+
raise TypeError(msg)
|
| 166 |
+
|
| 167 |
+
if factory is not None:
|
| 168 |
+
if default is not NOTHING:
|
| 169 |
+
msg = (
|
| 170 |
+
"The `default` and `factory` arguments are mutually exclusive."
|
| 171 |
+
)
|
| 172 |
+
raise ValueError(msg)
|
| 173 |
+
if not callable(factory):
|
| 174 |
+
msg = "The `factory` argument must be a callable."
|
| 175 |
+
raise ValueError(msg)
|
| 176 |
+
default = Factory(factory)
|
| 177 |
+
|
| 178 |
+
if metadata is None:
|
| 179 |
+
metadata = {}
|
| 180 |
+
|
| 181 |
+
# Apply syntactic sugar by auto-wrapping.
|
| 182 |
+
if isinstance(on_setattr, (list, tuple)):
|
| 183 |
+
on_setattr = setters.pipe(*on_setattr)
|
| 184 |
+
|
| 185 |
+
if validator and isinstance(validator, (list, tuple)):
|
| 186 |
+
validator = and_(*validator)
|
| 187 |
+
|
| 188 |
+
if converter and isinstance(converter, (list, tuple)):
|
| 189 |
+
converter = pipe(*converter)
|
| 190 |
+
|
| 191 |
+
return _CountingAttr(
|
| 192 |
+
default=default,
|
| 193 |
+
validator=validator,
|
| 194 |
+
repr=repr,
|
| 195 |
+
cmp=None,
|
| 196 |
+
hash=hash,
|
| 197 |
+
init=init,
|
| 198 |
+
converter=converter,
|
| 199 |
+
metadata=metadata,
|
| 200 |
+
type=type,
|
| 201 |
+
kw_only=kw_only,
|
| 202 |
+
eq=eq,
|
| 203 |
+
eq_key=eq_key,
|
| 204 |
+
order=order,
|
| 205 |
+
order_key=order_key,
|
| 206 |
+
on_setattr=on_setattr,
|
| 207 |
+
alias=alias,
|
| 208 |
+
)
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
def _compile_and_eval(script, globs, locs=None, filename=""):
|
| 212 |
+
"""
|
| 213 |
+
Evaluate the script with the given global (globs) and local (locs)
|
| 214 |
+
variables.
|
| 215 |
+
"""
|
| 216 |
+
bytecode = compile(script, filename, "exec")
|
| 217 |
+
eval(bytecode, globs, locs)
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
def _make_method(name, script, filename, globs, locals=None):
|
| 221 |
+
"""
|
| 222 |
+
Create the method with the script given and return the method object.
|
| 223 |
+
"""
|
| 224 |
+
locs = {} if locals is None else locals
|
| 225 |
+
|
| 226 |
+
# In order of debuggers like PDB being able to step through the code,
|
| 227 |
+
# we add a fake linecache entry.
|
| 228 |
+
count = 1
|
| 229 |
+
base_filename = filename
|
| 230 |
+
while True:
|
| 231 |
+
linecache_tuple = (
|
| 232 |
+
len(script),
|
| 233 |
+
None,
|
| 234 |
+
script.splitlines(True),
|
| 235 |
+
filename,
|
| 236 |
+
)
|
| 237 |
+
old_val = linecache.cache.setdefault(filename, linecache_tuple)
|
| 238 |
+
if old_val == linecache_tuple:
|
| 239 |
+
break
|
| 240 |
+
|
| 241 |
+
filename = f"{base_filename[:-1]}-{count}>"
|
| 242 |
+
count += 1
|
| 243 |
+
|
| 244 |
+
_compile_and_eval(script, globs, locs, filename)
|
| 245 |
+
|
| 246 |
+
return locs[name]
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def _make_attr_tuple_class(cls_name, attr_names):
|
| 250 |
+
"""
|
| 251 |
+
Create a tuple subclass to hold `Attribute`s for an `attrs` class.
|
| 252 |
+
|
| 253 |
+
The subclass is a bare tuple with properties for names.
|
| 254 |
+
|
| 255 |
+
class MyClassAttributes(tuple):
|
| 256 |
+
__slots__ = ()
|
| 257 |
+
x = property(itemgetter(0))
|
| 258 |
+
"""
|
| 259 |
+
attr_class_name = f"{cls_name}Attributes"
|
| 260 |
+
attr_class_template = [
|
| 261 |
+
f"class {attr_class_name}(tuple):",
|
| 262 |
+
" __slots__ = ()",
|
| 263 |
+
]
|
| 264 |
+
if attr_names:
|
| 265 |
+
for i, attr_name in enumerate(attr_names):
|
| 266 |
+
attr_class_template.append(
|
| 267 |
+
f" {attr_name} = _attrs_property(_attrs_itemgetter({i}))"
|
| 268 |
+
)
|
| 269 |
+
else:
|
| 270 |
+
attr_class_template.append(" pass")
|
| 271 |
+
globs = {"_attrs_itemgetter": itemgetter, "_attrs_property": property}
|
| 272 |
+
_compile_and_eval("\n".join(attr_class_template), globs)
|
| 273 |
+
return globs[attr_class_name]
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
# Tuple class for extracted attributes from a class definition.
|
| 277 |
+
# `base_attrs` is a subset of `attrs`.
|
| 278 |
+
_Attributes = _make_attr_tuple_class(
|
| 279 |
+
"_Attributes",
|
| 280 |
+
[
|
| 281 |
+
# all attributes to build dunder methods for
|
| 282 |
+
"attrs",
|
| 283 |
+
# attributes that have been inherited
|
| 284 |
+
"base_attrs",
|
| 285 |
+
# map inherited attributes to their originating classes
|
| 286 |
+
"base_attrs_map",
|
| 287 |
+
],
|
| 288 |
+
)
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
def _is_class_var(annot):
|
| 292 |
+
"""
|
| 293 |
+
Check whether *annot* is a typing.ClassVar.
|
| 294 |
+
|
| 295 |
+
The string comparison hack is used to avoid evaluating all string
|
| 296 |
+
annotations which would put attrs-based classes at a performance
|
| 297 |
+
disadvantage compared to plain old classes.
|
| 298 |
+
"""
|
| 299 |
+
annot = str(annot)
|
| 300 |
+
|
| 301 |
+
# Annotation can be quoted.
|
| 302 |
+
if annot.startswith(("'", '"')) and annot.endswith(("'", '"')):
|
| 303 |
+
annot = annot[1:-1]
|
| 304 |
+
|
| 305 |
+
return annot.startswith(_CLASSVAR_PREFIXES)
|
| 306 |
+
|
| 307 |
+
|
| 308 |
+
def _has_own_attribute(cls, attrib_name):
|
| 309 |
+
"""
|
| 310 |
+
Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
|
| 311 |
+
"""
|
| 312 |
+
return attrib_name in cls.__dict__
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
def _collect_base_attrs(cls, taken_attr_names):
|
| 316 |
+
"""
|
| 317 |
+
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
|
| 318 |
+
"""
|
| 319 |
+
base_attrs = []
|
| 320 |
+
base_attr_map = {} # A dictionary of base attrs to their classes.
|
| 321 |
+
|
| 322 |
+
# Traverse the MRO and collect attributes.
|
| 323 |
+
for base_cls in reversed(cls.__mro__[1:-1]):
|
| 324 |
+
for a in getattr(base_cls, "__attrs_attrs__", []):
|
| 325 |
+
if a.inherited or a.name in taken_attr_names:
|
| 326 |
+
continue
|
| 327 |
+
|
| 328 |
+
a = a.evolve(inherited=True) # noqa: PLW2901
|
| 329 |
+
base_attrs.append(a)
|
| 330 |
+
base_attr_map[a.name] = base_cls
|
| 331 |
+
|
| 332 |
+
# For each name, only keep the freshest definition i.e. the furthest at the
|
| 333 |
+
# back. base_attr_map is fine because it gets overwritten with every new
|
| 334 |
+
# instance.
|
| 335 |
+
filtered = []
|
| 336 |
+
seen = set()
|
| 337 |
+
for a in reversed(base_attrs):
|
| 338 |
+
if a.name in seen:
|
| 339 |
+
continue
|
| 340 |
+
filtered.insert(0, a)
|
| 341 |
+
seen.add(a.name)
|
| 342 |
+
|
| 343 |
+
return filtered, base_attr_map
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
def _collect_base_attrs_broken(cls, taken_attr_names):
|
| 347 |
+
"""
|
| 348 |
+
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
|
| 349 |
+
|
| 350 |
+
N.B. *taken_attr_names* will be mutated.
|
| 351 |
+
|
| 352 |
+
Adhere to the old incorrect behavior.
|
| 353 |
+
|
| 354 |
+
Notably it collects from the front and considers inherited attributes which
|
| 355 |
+
leads to the buggy behavior reported in #428.
|
| 356 |
+
"""
|
| 357 |
+
base_attrs = []
|
| 358 |
+
base_attr_map = {} # A dictionary of base attrs to their classes.
|
| 359 |
+
|
| 360 |
+
# Traverse the MRO and collect attributes.
|
| 361 |
+
for base_cls in cls.__mro__[1:-1]:
|
| 362 |
+
for a in getattr(base_cls, "__attrs_attrs__", []):
|
| 363 |
+
if a.name in taken_attr_names:
|
| 364 |
+
continue
|
| 365 |
+
|
| 366 |
+
a = a.evolve(inherited=True) # noqa: PLW2901
|
| 367 |
+
taken_attr_names.add(a.name)
|
| 368 |
+
base_attrs.append(a)
|
| 369 |
+
base_attr_map[a.name] = base_cls
|
| 370 |
+
|
| 371 |
+
return base_attrs, base_attr_map
|
| 372 |
+
|
| 373 |
+
|
| 374 |
+
def _transform_attrs(
|
| 375 |
+
cls, these, auto_attribs, kw_only, collect_by_mro, field_transformer
|
| 376 |
+
):
|
| 377 |
+
"""
|
| 378 |
+
Transform all `_CountingAttr`s on a class into `Attribute`s.
|
| 379 |
+
|
| 380 |
+
If *these* is passed, use that and don't look for them on the class.
|
| 381 |
+
|
| 382 |
+
If *collect_by_mro* is True, collect them in the correct MRO order,
|
| 383 |
+
otherwise use the old -- incorrect -- order. See #428.
|
| 384 |
+
|
| 385 |
+
Return an `_Attributes`.
|
| 386 |
+
"""
|
| 387 |
+
cd = cls.__dict__
|
| 388 |
+
anns = _get_annotations(cls)
|
| 389 |
+
|
| 390 |
+
if these is not None:
|
| 391 |
+
ca_list = list(these.items())
|
| 392 |
+
elif auto_attribs is True:
|
| 393 |
+
ca_names = {
|
| 394 |
+
name
|
| 395 |
+
for name, attr in cd.items()
|
| 396 |
+
if isinstance(attr, _CountingAttr)
|
| 397 |
+
}
|
| 398 |
+
ca_list = []
|
| 399 |
+
annot_names = set()
|
| 400 |
+
for attr_name, type in anns.items():
|
| 401 |
+
if _is_class_var(type):
|
| 402 |
+
continue
|
| 403 |
+
annot_names.add(attr_name)
|
| 404 |
+
a = cd.get(attr_name, NOTHING)
|
| 405 |
+
|
| 406 |
+
if not isinstance(a, _CountingAttr):
|
| 407 |
+
a = attrib() if a is NOTHING else attrib(default=a)
|
| 408 |
+
ca_list.append((attr_name, a))
|
| 409 |
+
|
| 410 |
+
unannotated = ca_names - annot_names
|
| 411 |
+
if len(unannotated) > 0:
|
| 412 |
+
raise UnannotatedAttributeError(
|
| 413 |
+
"The following `attr.ib`s lack a type annotation: "
|
| 414 |
+
+ ", ".join(
|
| 415 |
+
sorted(unannotated, key=lambda n: cd.get(n).counter)
|
| 416 |
+
)
|
| 417 |
+
+ "."
|
| 418 |
+
)
|
| 419 |
+
else:
|
| 420 |
+
ca_list = sorted(
|
| 421 |
+
(
|
| 422 |
+
(name, attr)
|
| 423 |
+
for name, attr in cd.items()
|
| 424 |
+
if isinstance(attr, _CountingAttr)
|
| 425 |
+
),
|
| 426 |
+
key=lambda e: e[1].counter,
|
| 427 |
+
)
|
| 428 |
+
|
| 429 |
+
own_attrs = [
|
| 430 |
+
Attribute.from_counting_attr(
|
| 431 |
+
name=attr_name, ca=ca, type=anns.get(attr_name)
|
| 432 |
+
)
|
| 433 |
+
for attr_name, ca in ca_list
|
| 434 |
+
]
|
| 435 |
+
|
| 436 |
+
if collect_by_mro:
|
| 437 |
+
base_attrs, base_attr_map = _collect_base_attrs(
|
| 438 |
+
cls, {a.name for a in own_attrs}
|
| 439 |
+
)
|
| 440 |
+
else:
|
| 441 |
+
base_attrs, base_attr_map = _collect_base_attrs_broken(
|
| 442 |
+
cls, {a.name for a in own_attrs}
|
| 443 |
+
)
|
| 444 |
+
|
| 445 |
+
if kw_only:
|
| 446 |
+
own_attrs = [a.evolve(kw_only=True) for a in own_attrs]
|
| 447 |
+
base_attrs = [a.evolve(kw_only=True) for a in base_attrs]
|
| 448 |
+
|
| 449 |
+
attrs = base_attrs + own_attrs
|
| 450 |
+
|
| 451 |
+
# Mandatory vs non-mandatory attr order only matters when they are part of
|
| 452 |
+
# the __init__ signature and when they aren't kw_only (which are moved to
|
| 453 |
+
# the end and can be mandatory or non-mandatory in any order, as they will
|
| 454 |
+
# be specified as keyword args anyway). Check the order of those attrs:
|
| 455 |
+
had_default = False
|
| 456 |
+
for a in (a for a in attrs if a.init is not False and a.kw_only is False):
|
| 457 |
+
if had_default is True and a.default is NOTHING:
|
| 458 |
+
msg = f"No mandatory attributes allowed after an attribute with a default value or factory. Attribute in question: {a!r}"
|
| 459 |
+
raise ValueError(msg)
|
| 460 |
+
|
| 461 |
+
if had_default is False and a.default is not NOTHING:
|
| 462 |
+
had_default = True
|
| 463 |
+
|
| 464 |
+
if field_transformer is not None:
|
| 465 |
+
attrs = field_transformer(cls, attrs)
|
| 466 |
+
|
| 467 |
+
# Resolve default field alias after executing field_transformer.
|
| 468 |
+
# This allows field_transformer to differentiate between explicit vs
|
| 469 |
+
# default aliases and supply their own defaults.
|
| 470 |
+
attrs = [
|
| 471 |
+
a.evolve(alias=_default_init_alias_for(a.name)) if not a.alias else a
|
| 472 |
+
for a in attrs
|
| 473 |
+
]
|
| 474 |
+
|
| 475 |
+
# Create AttrsClass *after* applying the field_transformer since it may
|
| 476 |
+
# add or remove attributes!
|
| 477 |
+
attr_names = [a.name for a in attrs]
|
| 478 |
+
AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)
|
| 479 |
+
|
| 480 |
+
return _Attributes((AttrsClass(attrs), base_attrs, base_attr_map))
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
def _make_cached_property_getattr(cached_properties, original_getattr, cls):
|
| 484 |
+
lines = [
|
| 485 |
+
# Wrapped to get `__class__` into closure cell for super()
|
| 486 |
+
# (It will be replaced with the newly constructed class after construction).
|
| 487 |
+
"def wrapper(_cls):",
|
| 488 |
+
" __class__ = _cls",
|
| 489 |
+
" def __getattr__(self, item, cached_properties=cached_properties, original_getattr=original_getattr, _cached_setattr_get=_cached_setattr_get):",
|
| 490 |
+
" func = cached_properties.get(item)",
|
| 491 |
+
" if func is not None:",
|
| 492 |
+
" result = func(self)",
|
| 493 |
+
" _setter = _cached_setattr_get(self)",
|
| 494 |
+
" _setter(item, result)",
|
| 495 |
+
" return result",
|
| 496 |
+
]
|
| 497 |
+
if original_getattr is not None:
|
| 498 |
+
lines.append(
|
| 499 |
+
" return original_getattr(self, item)",
|
| 500 |
+
)
|
| 501 |
+
else:
|
| 502 |
+
lines.extend(
|
| 503 |
+
[
|
| 504 |
+
" try:",
|
| 505 |
+
" return super().__getattribute__(item)",
|
| 506 |
+
" except AttributeError:",
|
| 507 |
+
" if not hasattr(super(), '__getattr__'):",
|
| 508 |
+
" raise",
|
| 509 |
+
" return super().__getattr__(item)",
|
| 510 |
+
" original_error = f\"'{self.__class__.__name__}' object has no attribute '{item}'\"",
|
| 511 |
+
" raise AttributeError(original_error)",
|
| 512 |
+
]
|
| 513 |
+
)
|
| 514 |
+
|
| 515 |
+
lines.extend(
|
| 516 |
+
[
|
| 517 |
+
" return __getattr__",
|
| 518 |
+
"__getattr__ = wrapper(_cls)",
|
| 519 |
+
]
|
| 520 |
+
)
|
| 521 |
+
|
| 522 |
+
unique_filename = _generate_unique_filename(cls, "getattr")
|
| 523 |
+
|
| 524 |
+
glob = {
|
| 525 |
+
"cached_properties": cached_properties,
|
| 526 |
+
"_cached_setattr_get": _OBJ_SETATTR.__get__,
|
| 527 |
+
"original_getattr": original_getattr,
|
| 528 |
+
}
|
| 529 |
+
|
| 530 |
+
return _make_method(
|
| 531 |
+
"__getattr__",
|
| 532 |
+
"\n".join(lines),
|
| 533 |
+
unique_filename,
|
| 534 |
+
glob,
|
| 535 |
+
locals={
|
| 536 |
+
"_cls": cls,
|
| 537 |
+
},
|
| 538 |
+
)
|
| 539 |
+
|
| 540 |
+
|
| 541 |
+
def _frozen_setattrs(self, name, value):
|
| 542 |
+
"""
|
| 543 |
+
Attached to frozen classes as __setattr__.
|
| 544 |
+
"""
|
| 545 |
+
if isinstance(self, BaseException) and name in (
|
| 546 |
+
"__cause__",
|
| 547 |
+
"__context__",
|
| 548 |
+
"__traceback__",
|
| 549 |
+
"__suppress_context__",
|
| 550 |
+
"__notes__",
|
| 551 |
+
):
|
| 552 |
+
BaseException.__setattr__(self, name, value)
|
| 553 |
+
return
|
| 554 |
+
|
| 555 |
+
raise FrozenInstanceError
|
| 556 |
+
|
| 557 |
+
|
| 558 |
+
def _frozen_delattrs(self, name):
|
| 559 |
+
"""
|
| 560 |
+
Attached to frozen classes as __delattr__.
|
| 561 |
+
"""
|
| 562 |
+
if isinstance(self, BaseException) and name in ("__notes__",):
|
| 563 |
+
BaseException.__delattr__(self, name)
|
| 564 |
+
return
|
| 565 |
+
|
| 566 |
+
raise FrozenInstanceError
|
| 567 |
+
|
| 568 |
+
|
| 569 |
+
def evolve(*args, **changes):
|
| 570 |
+
"""
|
| 571 |
+
Create a new instance, based on the first positional argument with
|
| 572 |
+
*changes* applied.
|
| 573 |
+
|
| 574 |
+
.. tip::
|
| 575 |
+
|
| 576 |
+
On Python 3.13 and later, you can also use `copy.replace` instead.
|
| 577 |
+
|
| 578 |
+
Args:
|
| 579 |
+
|
| 580 |
+
inst:
|
| 581 |
+
Instance of a class with *attrs* attributes. *inst* must be passed
|
| 582 |
+
as a positional argument.
|
| 583 |
+
|
| 584 |
+
changes:
|
| 585 |
+
Keyword changes in the new copy.
|
| 586 |
+
|
| 587 |
+
Returns:
|
| 588 |
+
A copy of inst with *changes* incorporated.
|
| 589 |
+
|
| 590 |
+
Raises:
|
| 591 |
+
TypeError:
|
| 592 |
+
If *attr_name* couldn't be found in the class ``__init__``.
|
| 593 |
+
|
| 594 |
+
attrs.exceptions.NotAnAttrsClassError:
|
| 595 |
+
If *cls* is not an *attrs* class.
|
| 596 |
+
|
| 597 |
+
.. versionadded:: 17.1.0
|
| 598 |
+
.. deprecated:: 23.1.0
|
| 599 |
+
It is now deprecated to pass the instance using the keyword argument
|
| 600 |
+
*inst*. It will raise a warning until at least April 2024, after which
|
| 601 |
+
it will become an error. Always pass the instance as a positional
|
| 602 |
+
argument.
|
| 603 |
+
.. versionchanged:: 24.1.0
|
| 604 |
+
*inst* can't be passed as a keyword argument anymore.
|
| 605 |
+
"""
|
| 606 |
+
try:
|
| 607 |
+
(inst,) = args
|
| 608 |
+
except ValueError:
|
| 609 |
+
msg = (
|
| 610 |
+
f"evolve() takes 1 positional argument, but {len(args)} were given"
|
| 611 |
+
)
|
| 612 |
+
raise TypeError(msg) from None
|
| 613 |
+
|
| 614 |
+
cls = inst.__class__
|
| 615 |
+
attrs = fields(cls)
|
| 616 |
+
for a in attrs:
|
| 617 |
+
if not a.init:
|
| 618 |
+
continue
|
| 619 |
+
attr_name = a.name # To deal with private attributes.
|
| 620 |
+
init_name = a.alias
|
| 621 |
+
if init_name not in changes:
|
| 622 |
+
changes[init_name] = getattr(inst, attr_name)
|
| 623 |
+
|
| 624 |
+
return cls(**changes)
|
| 625 |
+
|
| 626 |
+
|
| 627 |
+
class _ClassBuilder:
|
| 628 |
+
"""
|
| 629 |
+
Iteratively build *one* class.
|
| 630 |
+
"""
|
| 631 |
+
|
| 632 |
+
__slots__ = (
|
| 633 |
+
"_attr_names",
|
| 634 |
+
"_attrs",
|
| 635 |
+
"_base_attr_map",
|
| 636 |
+
"_base_names",
|
| 637 |
+
"_cache_hash",
|
| 638 |
+
"_cls",
|
| 639 |
+
"_cls_dict",
|
| 640 |
+
"_delete_attribs",
|
| 641 |
+
"_frozen",
|
| 642 |
+
"_has_custom_setattr",
|
| 643 |
+
"_has_post_init",
|
| 644 |
+
"_has_pre_init",
|
| 645 |
+
"_is_exc",
|
| 646 |
+
"_on_setattr",
|
| 647 |
+
"_pre_init_has_args",
|
| 648 |
+
"_slots",
|
| 649 |
+
"_weakref_slot",
|
| 650 |
+
"_wrote_own_setattr",
|
| 651 |
+
)
|
| 652 |
+
|
| 653 |
+
def __init__(
|
| 654 |
+
self,
|
| 655 |
+
cls,
|
| 656 |
+
these,
|
| 657 |
+
slots,
|
| 658 |
+
frozen,
|
| 659 |
+
weakref_slot,
|
| 660 |
+
getstate_setstate,
|
| 661 |
+
auto_attribs,
|
| 662 |
+
kw_only,
|
| 663 |
+
cache_hash,
|
| 664 |
+
is_exc,
|
| 665 |
+
collect_by_mro,
|
| 666 |
+
on_setattr,
|
| 667 |
+
has_custom_setattr,
|
| 668 |
+
field_transformer,
|
| 669 |
+
):
|
| 670 |
+
attrs, base_attrs, base_map = _transform_attrs(
|
| 671 |
+
cls,
|
| 672 |
+
these,
|
| 673 |
+
auto_attribs,
|
| 674 |
+
kw_only,
|
| 675 |
+
collect_by_mro,
|
| 676 |
+
field_transformer,
|
| 677 |
+
)
|
| 678 |
+
|
| 679 |
+
self._cls = cls
|
| 680 |
+
self._cls_dict = dict(cls.__dict__) if slots else {}
|
| 681 |
+
self._attrs = attrs
|
| 682 |
+
self._base_names = {a.name for a in base_attrs}
|
| 683 |
+
self._base_attr_map = base_map
|
| 684 |
+
self._attr_names = tuple(a.name for a in attrs)
|
| 685 |
+
self._slots = slots
|
| 686 |
+
self._frozen = frozen
|
| 687 |
+
self._weakref_slot = weakref_slot
|
| 688 |
+
self._cache_hash = cache_hash
|
| 689 |
+
self._has_pre_init = bool(getattr(cls, "__attrs_pre_init__", False))
|
| 690 |
+
self._pre_init_has_args = False
|
| 691 |
+
if self._has_pre_init:
|
| 692 |
+
# Check if the pre init method has more arguments than just `self`
|
| 693 |
+
# We want to pass arguments if pre init expects arguments
|
| 694 |
+
pre_init_func = cls.__attrs_pre_init__
|
| 695 |
+
pre_init_signature = inspect.signature(pre_init_func)
|
| 696 |
+
self._pre_init_has_args = len(pre_init_signature.parameters) > 1
|
| 697 |
+
self._has_post_init = bool(getattr(cls, "__attrs_post_init__", False))
|
| 698 |
+
self._delete_attribs = not bool(these)
|
| 699 |
+
self._is_exc = is_exc
|
| 700 |
+
self._on_setattr = on_setattr
|
| 701 |
+
|
| 702 |
+
self._has_custom_setattr = has_custom_setattr
|
| 703 |
+
self._wrote_own_setattr = False
|
| 704 |
+
|
| 705 |
+
self._cls_dict["__attrs_attrs__"] = self._attrs
|
| 706 |
+
|
| 707 |
+
if frozen:
|
| 708 |
+
self._cls_dict["__setattr__"] = _frozen_setattrs
|
| 709 |
+
self._cls_dict["__delattr__"] = _frozen_delattrs
|
| 710 |
+
|
| 711 |
+
self._wrote_own_setattr = True
|
| 712 |
+
elif on_setattr in (
|
| 713 |
+
_DEFAULT_ON_SETATTR,
|
| 714 |
+
setters.validate,
|
| 715 |
+
setters.convert,
|
| 716 |
+
):
|
| 717 |
+
has_validator = has_converter = False
|
| 718 |
+
for a in attrs:
|
| 719 |
+
if a.validator is not None:
|
| 720 |
+
has_validator = True
|
| 721 |
+
if a.converter is not None:
|
| 722 |
+
has_converter = True
|
| 723 |
+
|
| 724 |
+
if has_validator and has_converter:
|
| 725 |
+
break
|
| 726 |
+
if (
|
| 727 |
+
(
|
| 728 |
+
on_setattr == _DEFAULT_ON_SETATTR
|
| 729 |
+
and not (has_validator or has_converter)
|
| 730 |
+
)
|
| 731 |
+
or (on_setattr == setters.validate and not has_validator)
|
| 732 |
+
or (on_setattr == setters.convert and not has_converter)
|
| 733 |
+
):
|
| 734 |
+
# If class-level on_setattr is set to convert + validate, but
|
| 735 |
+
# there's no field to convert or validate, pretend like there's
|
| 736 |
+
# no on_setattr.
|
| 737 |
+
self._on_setattr = None
|
| 738 |
+
|
| 739 |
+
if getstate_setstate:
|
| 740 |
+
(
|
| 741 |
+
self._cls_dict["__getstate__"],
|
| 742 |
+
self._cls_dict["__setstate__"],
|
| 743 |
+
) = self._make_getstate_setstate()
|
| 744 |
+
|
| 745 |
+
def __repr__(self):
|
| 746 |
+
return f"<_ClassBuilder(cls={self._cls.__name__})>"
|
| 747 |
+
|
| 748 |
+
def build_class(self):
|
| 749 |
+
"""
|
| 750 |
+
Finalize class based on the accumulated configuration.
|
| 751 |
+
|
| 752 |
+
Builder cannot be used after calling this method.
|
| 753 |
+
"""
|
| 754 |
+
if self._slots is True:
|
| 755 |
+
cls = self._create_slots_class()
|
| 756 |
+
else:
|
| 757 |
+
cls = self._patch_original_class()
|
| 758 |
+
if PY_3_10_PLUS:
|
| 759 |
+
cls = abc.update_abstractmethods(cls)
|
| 760 |
+
|
| 761 |
+
# The method gets only called if it's not inherited from a base class.
|
| 762 |
+
# _has_own_attribute does NOT work properly for classmethods.
|
| 763 |
+
if (
|
| 764 |
+
getattr(cls, "__attrs_init_subclass__", None)
|
| 765 |
+
and "__attrs_init_subclass__" not in cls.__dict__
|
| 766 |
+
):
|
| 767 |
+
cls.__attrs_init_subclass__()
|
| 768 |
+
|
| 769 |
+
return cls
|
| 770 |
+
|
| 771 |
+
def _patch_original_class(self):
|
| 772 |
+
"""
|
| 773 |
+
Apply accumulated methods and return the class.
|
| 774 |
+
"""
|
| 775 |
+
cls = self._cls
|
| 776 |
+
base_names = self._base_names
|
| 777 |
+
|
| 778 |
+
# Clean class of attribute definitions (`attr.ib()`s).
|
| 779 |
+
if self._delete_attribs:
|
| 780 |
+
for name in self._attr_names:
|
| 781 |
+
if (
|
| 782 |
+
name not in base_names
|
| 783 |
+
and getattr(cls, name, _SENTINEL) is not _SENTINEL
|
| 784 |
+
):
|
| 785 |
+
# An AttributeError can happen if a base class defines a
|
| 786 |
+
# class variable and we want to set an attribute with the
|
| 787 |
+
# same name by using only a type annotation.
|
| 788 |
+
with contextlib.suppress(AttributeError):
|
| 789 |
+
delattr(cls, name)
|
| 790 |
+
|
| 791 |
+
# Attach our dunder methods.
|
| 792 |
+
for name, value in self._cls_dict.items():
|
| 793 |
+
setattr(cls, name, value)
|
| 794 |
+
|
| 795 |
+
# If we've inherited an attrs __setattr__ and don't write our own,
|
| 796 |
+
# reset it to object's.
|
| 797 |
+
if not self._wrote_own_setattr and getattr(
|
| 798 |
+
cls, "__attrs_own_setattr__", False
|
| 799 |
+
):
|
| 800 |
+
cls.__attrs_own_setattr__ = False
|
| 801 |
+
|
| 802 |
+
if not self._has_custom_setattr:
|
| 803 |
+
cls.__setattr__ = _OBJ_SETATTR
|
| 804 |
+
|
| 805 |
+
return cls
|
| 806 |
+
|
| 807 |
+
def _create_slots_class(self):
|
| 808 |
+
"""
|
| 809 |
+
Build and return a new class with a `__slots__` attribute.
|
| 810 |
+
"""
|
| 811 |
+
cd = {
|
| 812 |
+
k: v
|
| 813 |
+
for k, v in self._cls_dict.items()
|
| 814 |
+
if k not in (*tuple(self._attr_names), "__dict__", "__weakref__")
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
# If our class doesn't have its own implementation of __setattr__
|
| 818 |
+
# (either from the user or by us), check the bases, if one of them has
|
| 819 |
+
# an attrs-made __setattr__, that needs to be reset. We don't walk the
|
| 820 |
+
# MRO because we only care about our immediate base classes.
|
| 821 |
+
# XXX: This can be confused by subclassing a slotted attrs class with
|
| 822 |
+
# XXX: a non-attrs class and subclass the resulting class with an attrs
|
| 823 |
+
# XXX: class. See `test_slotted_confused` for details. For now that's
|
| 824 |
+
# XXX: OK with us.
|
| 825 |
+
if not self._wrote_own_setattr:
|
| 826 |
+
cd["__attrs_own_setattr__"] = False
|
| 827 |
+
|
| 828 |
+
if not self._has_custom_setattr:
|
| 829 |
+
for base_cls in self._cls.__bases__:
|
| 830 |
+
if base_cls.__dict__.get("__attrs_own_setattr__", False):
|
| 831 |
+
cd["__setattr__"] = _OBJ_SETATTR
|
| 832 |
+
break
|
| 833 |
+
|
| 834 |
+
# Traverse the MRO to collect existing slots
|
| 835 |
+
# and check for an existing __weakref__.
|
| 836 |
+
existing_slots = {}
|
| 837 |
+
weakref_inherited = False
|
| 838 |
+
for base_cls in self._cls.__mro__[1:-1]:
|
| 839 |
+
if base_cls.__dict__.get("__weakref__", None) is not None:
|
| 840 |
+
weakref_inherited = True
|
| 841 |
+
existing_slots.update(
|
| 842 |
+
{
|
| 843 |
+
name: getattr(base_cls, name)
|
| 844 |
+
for name in getattr(base_cls, "__slots__", [])
|
| 845 |
+
}
|
| 846 |
+
)
|
| 847 |
+
|
| 848 |
+
base_names = set(self._base_names)
|
| 849 |
+
|
| 850 |
+
names = self._attr_names
|
| 851 |
+
if (
|
| 852 |
+
self._weakref_slot
|
| 853 |
+
and "__weakref__" not in getattr(self._cls, "__slots__", ())
|
| 854 |
+
and "__weakref__" not in names
|
| 855 |
+
and not weakref_inherited
|
| 856 |
+
):
|
| 857 |
+
names += ("__weakref__",)
|
| 858 |
+
|
| 859 |
+
cached_properties = {
|
| 860 |
+
name: cached_property.func
|
| 861 |
+
for name, cached_property in cd.items()
|
| 862 |
+
if isinstance(cached_property, functools.cached_property)
|
| 863 |
+
}
|
| 864 |
+
|
| 865 |
+
# Collect methods with a `__class__` reference that are shadowed in the new class.
|
| 866 |
+
# To know to update them.
|
| 867 |
+
additional_closure_functions_to_update = []
|
| 868 |
+
if cached_properties:
|
| 869 |
+
class_annotations = _get_annotations(self._cls)
|
| 870 |
+
for name, func in cached_properties.items():
|
| 871 |
+
# Add cached properties to names for slotting.
|
| 872 |
+
names += (name,)
|
| 873 |
+
# Clear out function from class to avoid clashing.
|
| 874 |
+
del cd[name]
|
| 875 |
+
additional_closure_functions_to_update.append(func)
|
| 876 |
+
annotation = inspect.signature(func).return_annotation
|
| 877 |
+
if annotation is not inspect.Parameter.empty:
|
| 878 |
+
class_annotations[name] = annotation
|
| 879 |
+
|
| 880 |
+
original_getattr = cd.get("__getattr__")
|
| 881 |
+
if original_getattr is not None:
|
| 882 |
+
additional_closure_functions_to_update.append(original_getattr)
|
| 883 |
+
|
| 884 |
+
cd["__getattr__"] = _make_cached_property_getattr(
|
| 885 |
+
cached_properties, original_getattr, self._cls
|
| 886 |
+
)
|
| 887 |
+
|
| 888 |
+
# We only add the names of attributes that aren't inherited.
|
| 889 |
+
# Setting __slots__ to inherited attributes wastes memory.
|
| 890 |
+
slot_names = [name for name in names if name not in base_names]
|
| 891 |
+
|
| 892 |
+
# There are slots for attributes from current class
|
| 893 |
+
# that are defined in parent classes.
|
| 894 |
+
# As their descriptors may be overridden by a child class,
|
| 895 |
+
# we collect them here and update the class dict
|
| 896 |
+
reused_slots = {
|
| 897 |
+
slot: slot_descriptor
|
| 898 |
+
for slot, slot_descriptor in existing_slots.items()
|
| 899 |
+
if slot in slot_names
|
| 900 |
+
}
|
| 901 |
+
slot_names = [name for name in slot_names if name not in reused_slots]
|
| 902 |
+
cd.update(reused_slots)
|
| 903 |
+
if self._cache_hash:
|
| 904 |
+
slot_names.append(_HASH_CACHE_FIELD)
|
| 905 |
+
|
| 906 |
+
cd["__slots__"] = tuple(slot_names)
|
| 907 |
+
|
| 908 |
+
cd["__qualname__"] = self._cls.__qualname__
|
| 909 |
+
|
| 910 |
+
# Create new class based on old class and our methods.
|
| 911 |
+
cls = type(self._cls)(self._cls.__name__, self._cls.__bases__, cd)
|
| 912 |
+
|
| 913 |
+
# The following is a fix for
|
| 914 |
+
# <https://github.com/python-attrs/attrs/issues/102>.
|
| 915 |
+
# If a method mentions `__class__` or uses the no-arg super(), the
|
| 916 |
+
# compiler will bake a reference to the class in the method itself
|
| 917 |
+
# as `method.__closure__`. Since we replace the class with a
|
| 918 |
+
# clone, we rewrite these references so it keeps working.
|
| 919 |
+
for item in itertools.chain(
|
| 920 |
+
cls.__dict__.values(), additional_closure_functions_to_update
|
| 921 |
+
):
|
| 922 |
+
if isinstance(item, (classmethod, staticmethod)):
|
| 923 |
+
# Class- and staticmethods hide their functions inside.
|
| 924 |
+
# These might need to be rewritten as well.
|
| 925 |
+
closure_cells = getattr(item.__func__, "__closure__", None)
|
| 926 |
+
elif isinstance(item, property):
|
| 927 |
+
# Workaround for property `super()` shortcut (PY3-only).
|
| 928 |
+
# There is no universal way for other descriptors.
|
| 929 |
+
closure_cells = getattr(item.fget, "__closure__", None)
|
| 930 |
+
else:
|
| 931 |
+
closure_cells = getattr(item, "__closure__", None)
|
| 932 |
+
|
| 933 |
+
if not closure_cells: # Catch None or the empty list.
|
| 934 |
+
continue
|
| 935 |
+
for cell in closure_cells:
|
| 936 |
+
try:
|
| 937 |
+
match = cell.cell_contents is self._cls
|
| 938 |
+
except ValueError: # noqa: PERF203
|
| 939 |
+
# ValueError: Cell is empty
|
| 940 |
+
pass
|
| 941 |
+
else:
|
| 942 |
+
if match:
|
| 943 |
+
cell.cell_contents = cls
|
| 944 |
+
return cls
|
| 945 |
+
|
| 946 |
+
def add_repr(self, ns):
|
| 947 |
+
self._cls_dict["__repr__"] = self._add_method_dunders(
|
| 948 |
+
_make_repr(self._attrs, ns, self._cls)
|
| 949 |
+
)
|
| 950 |
+
return self
|
| 951 |
+
|
| 952 |
+
def add_str(self):
|
| 953 |
+
repr = self._cls_dict.get("__repr__")
|
| 954 |
+
if repr is None:
|
| 955 |
+
msg = "__str__ can only be generated if a __repr__ exists."
|
| 956 |
+
raise ValueError(msg)
|
| 957 |
+
|
| 958 |
+
def __str__(self):
|
| 959 |
+
return self.__repr__()
|
| 960 |
+
|
| 961 |
+
self._cls_dict["__str__"] = self._add_method_dunders(__str__)
|
| 962 |
+
return self
|
| 963 |
+
|
| 964 |
+
def _make_getstate_setstate(self):
|
| 965 |
+
"""
|
| 966 |
+
Create custom __setstate__ and __getstate__ methods.
|
| 967 |
+
"""
|
| 968 |
+
# __weakref__ is not writable.
|
| 969 |
+
state_attr_names = tuple(
|
| 970 |
+
an for an in self._attr_names if an != "__weakref__"
|
| 971 |
+
)
|
| 972 |
+
|
| 973 |
+
def slots_getstate(self):
|
| 974 |
+
"""
|
| 975 |
+
Automatically created by attrs.
|
| 976 |
+
"""
|
| 977 |
+
return {name: getattr(self, name) for name in state_attr_names}
|
| 978 |
+
|
| 979 |
+
hash_caching_enabled = self._cache_hash
|
| 980 |
+
|
| 981 |
+
def slots_setstate(self, state):
|
| 982 |
+
"""
|
| 983 |
+
Automatically created by attrs.
|
| 984 |
+
"""
|
| 985 |
+
__bound_setattr = _OBJ_SETATTR.__get__(self)
|
| 986 |
+
if isinstance(state, tuple):
|
| 987 |
+
# Backward compatibility with attrs instances pickled with
|
| 988 |
+
# attrs versions before v22.2.0 which stored tuples.
|
| 989 |
+
for name, value in zip(state_attr_names, state):
|
| 990 |
+
__bound_setattr(name, value)
|
| 991 |
+
else:
|
| 992 |
+
for name in state_attr_names:
|
| 993 |
+
if name in state:
|
| 994 |
+
__bound_setattr(name, state[name])
|
| 995 |
+
|
| 996 |
+
# The hash code cache is not included when the object is
|
| 997 |
+
# serialized, but it still needs to be initialized to None to
|
| 998 |
+
# indicate that the first call to __hash__ should be a cache
|
| 999 |
+
# miss.
|
| 1000 |
+
if hash_caching_enabled:
|
| 1001 |
+
__bound_setattr(_HASH_CACHE_FIELD, None)
|
| 1002 |
+
|
| 1003 |
+
return slots_getstate, slots_setstate
|
| 1004 |
+
|
| 1005 |
+
def make_unhashable(self):
|
| 1006 |
+
self._cls_dict["__hash__"] = None
|
| 1007 |
+
return self
|
| 1008 |
+
|
| 1009 |
+
def add_hash(self):
|
| 1010 |
+
self._cls_dict["__hash__"] = self._add_method_dunders(
|
| 1011 |
+
_make_hash(
|
| 1012 |
+
self._cls,
|
| 1013 |
+
self._attrs,
|
| 1014 |
+
frozen=self._frozen,
|
| 1015 |
+
cache_hash=self._cache_hash,
|
| 1016 |
+
)
|
| 1017 |
+
)
|
| 1018 |
+
|
| 1019 |
+
return self
|
| 1020 |
+
|
| 1021 |
+
def add_init(self):
|
| 1022 |
+
self._cls_dict["__init__"] = self._add_method_dunders(
|
| 1023 |
+
_make_init(
|
| 1024 |
+
self._cls,
|
| 1025 |
+
self._attrs,
|
| 1026 |
+
self._has_pre_init,
|
| 1027 |
+
self._pre_init_has_args,
|
| 1028 |
+
self._has_post_init,
|
| 1029 |
+
self._frozen,
|
| 1030 |
+
self._slots,
|
| 1031 |
+
self._cache_hash,
|
| 1032 |
+
self._base_attr_map,
|
| 1033 |
+
self._is_exc,
|
| 1034 |
+
self._on_setattr,
|
| 1035 |
+
attrs_init=False,
|
| 1036 |
+
)
|
| 1037 |
+
)
|
| 1038 |
+
|
| 1039 |
+
return self
|
| 1040 |
+
|
| 1041 |
+
def add_replace(self):
|
| 1042 |
+
self._cls_dict["__replace__"] = self._add_method_dunders(
|
| 1043 |
+
lambda self, **changes: evolve(self, **changes)
|
| 1044 |
+
)
|
| 1045 |
+
return self
|
| 1046 |
+
|
| 1047 |
+
def add_match_args(self):
|
| 1048 |
+
self._cls_dict["__match_args__"] = tuple(
|
| 1049 |
+
field.name
|
| 1050 |
+
for field in self._attrs
|
| 1051 |
+
if field.init and not field.kw_only
|
| 1052 |
+
)
|
| 1053 |
+
|
| 1054 |
+
def add_attrs_init(self):
|
| 1055 |
+
self._cls_dict["__attrs_init__"] = self._add_method_dunders(
|
| 1056 |
+
_make_init(
|
| 1057 |
+
self._cls,
|
| 1058 |
+
self._attrs,
|
| 1059 |
+
self._has_pre_init,
|
| 1060 |
+
self._pre_init_has_args,
|
| 1061 |
+
self._has_post_init,
|
| 1062 |
+
self._frozen,
|
| 1063 |
+
self._slots,
|
| 1064 |
+
self._cache_hash,
|
| 1065 |
+
self._base_attr_map,
|
| 1066 |
+
self._is_exc,
|
| 1067 |
+
self._on_setattr,
|
| 1068 |
+
attrs_init=True,
|
| 1069 |
+
)
|
| 1070 |
+
)
|
| 1071 |
+
|
| 1072 |
+
return self
|
| 1073 |
+
|
| 1074 |
+
def add_eq(self):
|
| 1075 |
+
cd = self._cls_dict
|
| 1076 |
+
|
| 1077 |
+
cd["__eq__"] = self._add_method_dunders(
|
| 1078 |
+
_make_eq(self._cls, self._attrs)
|
| 1079 |
+
)
|
| 1080 |
+
cd["__ne__"] = self._add_method_dunders(_make_ne())
|
| 1081 |
+
|
| 1082 |
+
return self
|
| 1083 |
+
|
| 1084 |
+
def add_order(self):
|
| 1085 |
+
cd = self._cls_dict
|
| 1086 |
+
|
| 1087 |
+
cd["__lt__"], cd["__le__"], cd["__gt__"], cd["__ge__"] = (
|
| 1088 |
+
self._add_method_dunders(meth)
|
| 1089 |
+
for meth in _make_order(self._cls, self._attrs)
|
| 1090 |
+
)
|
| 1091 |
+
|
| 1092 |
+
return self
|
| 1093 |
+
|
| 1094 |
+
def add_setattr(self):
|
| 1095 |
+
if self._frozen:
|
| 1096 |
+
return self
|
| 1097 |
+
|
| 1098 |
+
sa_attrs = {}
|
| 1099 |
+
for a in self._attrs:
|
| 1100 |
+
on_setattr = a.on_setattr or self._on_setattr
|
| 1101 |
+
if on_setattr and on_setattr is not setters.NO_OP:
|
| 1102 |
+
sa_attrs[a.name] = a, on_setattr
|
| 1103 |
+
|
| 1104 |
+
if not sa_attrs:
|
| 1105 |
+
return self
|
| 1106 |
+
|
| 1107 |
+
if self._has_custom_setattr:
|
| 1108 |
+
# We need to write a __setattr__ but there already is one!
|
| 1109 |
+
msg = "Can't combine custom __setattr__ with on_setattr hooks."
|
| 1110 |
+
raise ValueError(msg)
|
| 1111 |
+
|
| 1112 |
+
# docstring comes from _add_method_dunders
|
| 1113 |
+
def __setattr__(self, name, val):
|
| 1114 |
+
try:
|
| 1115 |
+
a, hook = sa_attrs[name]
|
| 1116 |
+
except KeyError:
|
| 1117 |
+
nval = val
|
| 1118 |
+
else:
|
| 1119 |
+
nval = hook(self, a, val)
|
| 1120 |
+
|
| 1121 |
+
_OBJ_SETATTR(self, name, nval)
|
| 1122 |
+
|
| 1123 |
+
self._cls_dict["__attrs_own_setattr__"] = True
|
| 1124 |
+
self._cls_dict["__setattr__"] = self._add_method_dunders(__setattr__)
|
| 1125 |
+
self._wrote_own_setattr = True
|
| 1126 |
+
|
| 1127 |
+
return self
|
| 1128 |
+
|
| 1129 |
+
def _add_method_dunders(self, method):
|
| 1130 |
+
"""
|
| 1131 |
+
Add __module__ and __qualname__ to a *method* if possible.
|
| 1132 |
+
"""
|
| 1133 |
+
with contextlib.suppress(AttributeError):
|
| 1134 |
+
method.__module__ = self._cls.__module__
|
| 1135 |
+
|
| 1136 |
+
with contextlib.suppress(AttributeError):
|
| 1137 |
+
method.__qualname__ = f"{self._cls.__qualname__}.{method.__name__}"
|
| 1138 |
+
|
| 1139 |
+
with contextlib.suppress(AttributeError):
|
| 1140 |
+
method.__doc__ = (
|
| 1141 |
+
"Method generated by attrs for class "
|
| 1142 |
+
f"{self._cls.__qualname__}."
|
| 1143 |
+
)
|
| 1144 |
+
|
| 1145 |
+
return method
|
| 1146 |
+
|
| 1147 |
+
|
| 1148 |
+
def _determine_attrs_eq_order(cmp, eq, order, default_eq):
|
| 1149 |
+
"""
|
| 1150 |
+
Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
|
| 1151 |
+
values of eq and order. If *eq* is None, set it to *default_eq*.
|
| 1152 |
+
"""
|
| 1153 |
+
if cmp is not None and any((eq is not None, order is not None)):
|
| 1154 |
+
msg = "Don't mix `cmp` with `eq' and `order`."
|
| 1155 |
+
raise ValueError(msg)
|
| 1156 |
+
|
| 1157 |
+
# cmp takes precedence due to bw-compatibility.
|
| 1158 |
+
if cmp is not None:
|
| 1159 |
+
return cmp, cmp
|
| 1160 |
+
|
| 1161 |
+
# If left None, equality is set to the specified default and ordering
|
| 1162 |
+
# mirrors equality.
|
| 1163 |
+
if eq is None:
|
| 1164 |
+
eq = default_eq
|
| 1165 |
+
|
| 1166 |
+
if order is None:
|
| 1167 |
+
order = eq
|
| 1168 |
+
|
| 1169 |
+
if eq is False and order is True:
|
| 1170 |
+
msg = "`order` can only be True if `eq` is True too."
|
| 1171 |
+
raise ValueError(msg)
|
| 1172 |
+
|
| 1173 |
+
return eq, order
|
| 1174 |
+
|
| 1175 |
+
|
| 1176 |
+
def _determine_attrib_eq_order(cmp, eq, order, default_eq):
|
| 1177 |
+
"""
|
| 1178 |
+
Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
|
| 1179 |
+
values of eq and order. If *eq* is None, set it to *default_eq*.
|
| 1180 |
+
"""
|
| 1181 |
+
if cmp is not None and any((eq is not None, order is not None)):
|
| 1182 |
+
msg = "Don't mix `cmp` with `eq' and `order`."
|
| 1183 |
+
raise ValueError(msg)
|
| 1184 |
+
|
| 1185 |
+
def decide_callable_or_boolean(value):
|
| 1186 |
+
"""
|
| 1187 |
+
Decide whether a key function is used.
|
| 1188 |
+
"""
|
| 1189 |
+
if callable(value):
|
| 1190 |
+
value, key = True, value
|
| 1191 |
+
else:
|
| 1192 |
+
key = None
|
| 1193 |
+
return value, key
|
| 1194 |
+
|
| 1195 |
+
# cmp takes precedence due to bw-compatibility.
|
| 1196 |
+
if cmp is not None:
|
| 1197 |
+
cmp, cmp_key = decide_callable_or_boolean(cmp)
|
| 1198 |
+
return cmp, cmp_key, cmp, cmp_key
|
| 1199 |
+
|
| 1200 |
+
# If left None, equality is set to the specified default and ordering
|
| 1201 |
+
# mirrors equality.
|
| 1202 |
+
if eq is None:
|
| 1203 |
+
eq, eq_key = default_eq, None
|
| 1204 |
+
else:
|
| 1205 |
+
eq, eq_key = decide_callable_or_boolean(eq)
|
| 1206 |
+
|
| 1207 |
+
if order is None:
|
| 1208 |
+
order, order_key = eq, eq_key
|
| 1209 |
+
else:
|
| 1210 |
+
order, order_key = decide_callable_or_boolean(order)
|
| 1211 |
+
|
| 1212 |
+
if eq is False and order is True:
|
| 1213 |
+
msg = "`order` can only be True if `eq` is True too."
|
| 1214 |
+
raise ValueError(msg)
|
| 1215 |
+
|
| 1216 |
+
return eq, eq_key, order, order_key
|
| 1217 |
+
|
| 1218 |
+
|
| 1219 |
+
def _determine_whether_to_implement(
|
| 1220 |
+
cls, flag, auto_detect, dunders, default=True
|
| 1221 |
+
):
|
| 1222 |
+
"""
|
| 1223 |
+
Check whether we should implement a set of methods for *cls*.
|
| 1224 |
+
|
| 1225 |
+
*flag* is the argument passed into @attr.s like 'init', *auto_detect* the
|
| 1226 |
+
same as passed into @attr.s and *dunders* is a tuple of attribute names
|
| 1227 |
+
whose presence signal that the user has implemented it themselves.
|
| 1228 |
+
|
| 1229 |
+
Return *default* if no reason for either for or against is found.
|
| 1230 |
+
"""
|
| 1231 |
+
if flag is True or flag is False:
|
| 1232 |
+
return flag
|
| 1233 |
+
|
| 1234 |
+
if flag is None and auto_detect is False:
|
| 1235 |
+
return default
|
| 1236 |
+
|
| 1237 |
+
# Logically, flag is None and auto_detect is True here.
|
| 1238 |
+
for dunder in dunders:
|
| 1239 |
+
if _has_own_attribute(cls, dunder):
|
| 1240 |
+
return False
|
| 1241 |
+
|
| 1242 |
+
return default
|
| 1243 |
+
|
| 1244 |
+
|
| 1245 |
+
def attrs(
|
| 1246 |
+
maybe_cls=None,
|
| 1247 |
+
these=None,
|
| 1248 |
+
repr_ns=None,
|
| 1249 |
+
repr=None,
|
| 1250 |
+
cmp=None,
|
| 1251 |
+
hash=None,
|
| 1252 |
+
init=None,
|
| 1253 |
+
slots=False,
|
| 1254 |
+
frozen=False,
|
| 1255 |
+
weakref_slot=True,
|
| 1256 |
+
str=False,
|
| 1257 |
+
auto_attribs=False,
|
| 1258 |
+
kw_only=False,
|
| 1259 |
+
cache_hash=False,
|
| 1260 |
+
auto_exc=False,
|
| 1261 |
+
eq=None,
|
| 1262 |
+
order=None,
|
| 1263 |
+
auto_detect=False,
|
| 1264 |
+
collect_by_mro=False,
|
| 1265 |
+
getstate_setstate=None,
|
| 1266 |
+
on_setattr=None,
|
| 1267 |
+
field_transformer=None,
|
| 1268 |
+
match_args=True,
|
| 1269 |
+
unsafe_hash=None,
|
| 1270 |
+
):
|
| 1271 |
+
r"""
|
| 1272 |
+
A class decorator that adds :term:`dunder methods` according to the
|
| 1273 |
+
specified attributes using `attr.ib` or the *these* argument.
|
| 1274 |
+
|
| 1275 |
+
Consider using `attrs.define` / `attrs.frozen` in new code (``attr.s`` will
|
| 1276 |
+
*never* go away, though).
|
| 1277 |
+
|
| 1278 |
+
Args:
|
| 1279 |
+
repr_ns (str):
|
| 1280 |
+
When using nested classes, there was no way in Python 2 to
|
| 1281 |
+
automatically detect that. This argument allows to set a custom
|
| 1282 |
+
name for a more meaningful ``repr`` output. This argument is
|
| 1283 |
+
pointless in Python 3 and is therefore deprecated.
|
| 1284 |
+
|
| 1285 |
+
.. caution::
|
| 1286 |
+
Refer to `attrs.define` for the rest of the parameters, but note that they
|
| 1287 |
+
can have different defaults.
|
| 1288 |
+
|
| 1289 |
+
Notably, leaving *on_setattr* as `None` will **not** add any hooks.
|
| 1290 |
+
|
| 1291 |
+
.. versionadded:: 16.0.0 *slots*
|
| 1292 |
+
.. versionadded:: 16.1.0 *frozen*
|
| 1293 |
+
.. versionadded:: 16.3.0 *str*
|
| 1294 |
+
.. versionadded:: 16.3.0 Support for ``__attrs_post_init__``.
|
| 1295 |
+
.. versionchanged:: 17.1.0
|
| 1296 |
+
*hash* supports `None` as value which is also the default now.
|
| 1297 |
+
.. versionadded:: 17.3.0 *auto_attribs*
|
| 1298 |
+
.. versionchanged:: 18.1.0
|
| 1299 |
+
If *these* is passed, no attributes are deleted from the class body.
|
| 1300 |
+
.. versionchanged:: 18.1.0 If *these* is ordered, the order is retained.
|
| 1301 |
+
.. versionadded:: 18.2.0 *weakref_slot*
|
| 1302 |
+
.. deprecated:: 18.2.0
|
| 1303 |
+
``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now raise a
|
| 1304 |
+
`DeprecationWarning` if the classes compared are subclasses of
|
| 1305 |
+
each other. ``__eq`` and ``__ne__`` never tried to compared subclasses
|
| 1306 |
+
to each other.
|
| 1307 |
+
.. versionchanged:: 19.2.0
|
| 1308 |
+
``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now do not consider
|
| 1309 |
+
subclasses comparable anymore.
|
| 1310 |
+
.. versionadded:: 18.2.0 *kw_only*
|
| 1311 |
+
.. versionadded:: 18.2.0 *cache_hash*
|
| 1312 |
+
.. versionadded:: 19.1.0 *auto_exc*
|
| 1313 |
+
.. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
|
| 1314 |
+
.. versionadded:: 19.2.0 *eq* and *order*
|
| 1315 |
+
.. versionadded:: 20.1.0 *auto_detect*
|
| 1316 |
+
.. versionadded:: 20.1.0 *collect_by_mro*
|
| 1317 |
+
.. versionadded:: 20.1.0 *getstate_setstate*
|
| 1318 |
+
.. versionadded:: 20.1.0 *on_setattr*
|
| 1319 |
+
.. versionadded:: 20.3.0 *field_transformer*
|
| 1320 |
+
.. versionchanged:: 21.1.0
|
| 1321 |
+
``init=False`` injects ``__attrs_init__``
|
| 1322 |
+
.. versionchanged:: 21.1.0 Support for ``__attrs_pre_init__``
|
| 1323 |
+
.. versionchanged:: 21.1.0 *cmp* undeprecated
|
| 1324 |
+
.. versionadded:: 21.3.0 *match_args*
|
| 1325 |
+
.. versionadded:: 22.2.0
|
| 1326 |
+
*unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
|
| 1327 |
+
.. deprecated:: 24.1.0 *repr_ns*
|
| 1328 |
+
.. versionchanged:: 24.1.0
|
| 1329 |
+
Instances are not compared as tuples of attributes anymore, but using a
|
| 1330 |
+
big ``and`` condition. This is faster and has more correct behavior for
|
| 1331 |
+
uncomparable values like `math.nan`.
|
| 1332 |
+
.. versionadded:: 24.1.0
|
| 1333 |
+
If a class has an *inherited* classmethod called
|
| 1334 |
+
``__attrs_init_subclass__``, it is executed after the class is created.
|
| 1335 |
+
.. deprecated:: 24.1.0 *hash* is deprecated in favor of *unsafe_hash*.
|
| 1336 |
+
"""
|
| 1337 |
+
if repr_ns is not None:
|
| 1338 |
+
import warnings
|
| 1339 |
+
|
| 1340 |
+
warnings.warn(
|
| 1341 |
+
DeprecationWarning(
|
| 1342 |
+
"The `repr_ns` argument is deprecated and will be removed in or after August 2025."
|
| 1343 |
+
),
|
| 1344 |
+
stacklevel=2,
|
| 1345 |
+
)
|
| 1346 |
+
|
| 1347 |
+
eq_, order_ = _determine_attrs_eq_order(cmp, eq, order, None)
|
| 1348 |
+
|
| 1349 |
+
# unsafe_hash takes precedence due to PEP 681.
|
| 1350 |
+
if unsafe_hash is not None:
|
| 1351 |
+
hash = unsafe_hash
|
| 1352 |
+
|
| 1353 |
+
if isinstance(on_setattr, (list, tuple)):
|
| 1354 |
+
on_setattr = setters.pipe(*on_setattr)
|
| 1355 |
+
|
| 1356 |
+
def wrap(cls):
|
| 1357 |
+
is_frozen = frozen or _has_frozen_base_class(cls)
|
| 1358 |
+
is_exc = auto_exc is True and issubclass(cls, BaseException)
|
| 1359 |
+
has_own_setattr = auto_detect and _has_own_attribute(
|
| 1360 |
+
cls, "__setattr__"
|
| 1361 |
+
)
|
| 1362 |
+
|
| 1363 |
+
if has_own_setattr and is_frozen:
|
| 1364 |
+
msg = "Can't freeze a class with a custom __setattr__."
|
| 1365 |
+
raise ValueError(msg)
|
| 1366 |
+
|
| 1367 |
+
builder = _ClassBuilder(
|
| 1368 |
+
cls,
|
| 1369 |
+
these,
|
| 1370 |
+
slots,
|
| 1371 |
+
is_frozen,
|
| 1372 |
+
weakref_slot,
|
| 1373 |
+
_determine_whether_to_implement(
|
| 1374 |
+
cls,
|
| 1375 |
+
getstate_setstate,
|
| 1376 |
+
auto_detect,
|
| 1377 |
+
("__getstate__", "__setstate__"),
|
| 1378 |
+
default=slots,
|
| 1379 |
+
),
|
| 1380 |
+
auto_attribs,
|
| 1381 |
+
kw_only,
|
| 1382 |
+
cache_hash,
|
| 1383 |
+
is_exc,
|
| 1384 |
+
collect_by_mro,
|
| 1385 |
+
on_setattr,
|
| 1386 |
+
has_own_setattr,
|
| 1387 |
+
field_transformer,
|
| 1388 |
+
)
|
| 1389 |
+
if _determine_whether_to_implement(
|
| 1390 |
+
cls, repr, auto_detect, ("__repr__",)
|
| 1391 |
+
):
|
| 1392 |
+
builder.add_repr(repr_ns)
|
| 1393 |
+
if str is True:
|
| 1394 |
+
builder.add_str()
|
| 1395 |
+
|
| 1396 |
+
eq = _determine_whether_to_implement(
|
| 1397 |
+
cls, eq_, auto_detect, ("__eq__", "__ne__")
|
| 1398 |
+
)
|
| 1399 |
+
if not is_exc and eq is True:
|
| 1400 |
+
builder.add_eq()
|
| 1401 |
+
if not is_exc and _determine_whether_to_implement(
|
| 1402 |
+
cls, order_, auto_detect, ("__lt__", "__le__", "__gt__", "__ge__")
|
| 1403 |
+
):
|
| 1404 |
+
builder.add_order()
|
| 1405 |
+
|
| 1406 |
+
builder.add_setattr()
|
| 1407 |
+
|
| 1408 |
+
nonlocal hash
|
| 1409 |
+
if (
|
| 1410 |
+
hash is None
|
| 1411 |
+
and auto_detect is True
|
| 1412 |
+
and _has_own_attribute(cls, "__hash__")
|
| 1413 |
+
):
|
| 1414 |
+
hash = False
|
| 1415 |
+
|
| 1416 |
+
if hash is not True and hash is not False and hash is not None:
|
| 1417 |
+
# Can't use `hash in` because 1 == True for example.
|
| 1418 |
+
msg = "Invalid value for hash. Must be True, False, or None."
|
| 1419 |
+
raise TypeError(msg)
|
| 1420 |
+
|
| 1421 |
+
if hash is False or (hash is None and eq is False) or is_exc:
|
| 1422 |
+
# Don't do anything. Should fall back to __object__'s __hash__
|
| 1423 |
+
# which is by id.
|
| 1424 |
+
if cache_hash:
|
| 1425 |
+
msg = "Invalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled."
|
| 1426 |
+
raise TypeError(msg)
|
| 1427 |
+
elif hash is True or (
|
| 1428 |
+
hash is None and eq is True and is_frozen is True
|
| 1429 |
+
):
|
| 1430 |
+
# Build a __hash__ if told so, or if it's safe.
|
| 1431 |
+
builder.add_hash()
|
| 1432 |
+
else:
|
| 1433 |
+
# Raise TypeError on attempts to hash.
|
| 1434 |
+
if cache_hash:
|
| 1435 |
+
msg = "Invalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled."
|
| 1436 |
+
raise TypeError(msg)
|
| 1437 |
+
builder.make_unhashable()
|
| 1438 |
+
|
| 1439 |
+
if _determine_whether_to_implement(
|
| 1440 |
+
cls, init, auto_detect, ("__init__",)
|
| 1441 |
+
):
|
| 1442 |
+
builder.add_init()
|
| 1443 |
+
else:
|
| 1444 |
+
builder.add_attrs_init()
|
| 1445 |
+
if cache_hash:
|
| 1446 |
+
msg = "Invalid value for cache_hash. To use hash caching, init must be True."
|
| 1447 |
+
raise TypeError(msg)
|
| 1448 |
+
|
| 1449 |
+
if PY_3_13_PLUS and not _has_own_attribute(cls, "__replace__"):
|
| 1450 |
+
builder.add_replace()
|
| 1451 |
+
|
| 1452 |
+
if (
|
| 1453 |
+
PY_3_10_PLUS
|
| 1454 |
+
and match_args
|
| 1455 |
+
and not _has_own_attribute(cls, "__match_args__")
|
| 1456 |
+
):
|
| 1457 |
+
builder.add_match_args()
|
| 1458 |
+
|
| 1459 |
+
return builder.build_class()
|
| 1460 |
+
|
| 1461 |
+
# maybe_cls's type depends on the usage of the decorator. It's a class
|
| 1462 |
+
# if it's used as `@attrs` but `None` if used as `@attrs()`.
|
| 1463 |
+
if maybe_cls is None:
|
| 1464 |
+
return wrap
|
| 1465 |
+
|
| 1466 |
+
return wrap(maybe_cls)
|
| 1467 |
+
|
| 1468 |
+
|
| 1469 |
+
_attrs = attrs
|
| 1470 |
+
"""
|
| 1471 |
+
Internal alias so we can use it in functions that take an argument called
|
| 1472 |
+
*attrs*.
|
| 1473 |
+
"""
|
| 1474 |
+
|
| 1475 |
+
|
| 1476 |
+
def _has_frozen_base_class(cls):
|
| 1477 |
+
"""
|
| 1478 |
+
Check whether *cls* has a frozen ancestor by looking at its
|
| 1479 |
+
__setattr__.
|
| 1480 |
+
"""
|
| 1481 |
+
return cls.__setattr__ is _frozen_setattrs
|
| 1482 |
+
|
| 1483 |
+
|
| 1484 |
+
def _generate_unique_filename(cls, func_name):
|
| 1485 |
+
"""
|
| 1486 |
+
Create a "filename" suitable for a function being generated.
|
| 1487 |
+
"""
|
| 1488 |
+
return (
|
| 1489 |
+
f"<attrs generated {func_name} {cls.__module__}."
|
| 1490 |
+
f"{getattr(cls, '__qualname__', cls.__name__)}>"
|
| 1491 |
+
)
|
| 1492 |
+
|
| 1493 |
+
|
| 1494 |
+
def _make_hash(cls, attrs, frozen, cache_hash):
|
| 1495 |
+
attrs = tuple(
|
| 1496 |
+
a for a in attrs if a.hash is True or (a.hash is None and a.eq is True)
|
| 1497 |
+
)
|
| 1498 |
+
|
| 1499 |
+
tab = " "
|
| 1500 |
+
|
| 1501 |
+
unique_filename = _generate_unique_filename(cls, "hash")
|
| 1502 |
+
type_hash = hash(unique_filename)
|
| 1503 |
+
# If eq is custom generated, we need to include the functions in globs
|
| 1504 |
+
globs = {}
|
| 1505 |
+
|
| 1506 |
+
hash_def = "def __hash__(self"
|
| 1507 |
+
hash_func = "hash(("
|
| 1508 |
+
closing_braces = "))"
|
| 1509 |
+
if not cache_hash:
|
| 1510 |
+
hash_def += "):"
|
| 1511 |
+
else:
|
| 1512 |
+
hash_def += ", *"
|
| 1513 |
+
|
| 1514 |
+
hash_def += ", _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):"
|
| 1515 |
+
hash_func = "_cache_wrapper(" + hash_func
|
| 1516 |
+
closing_braces += ")"
|
| 1517 |
+
|
| 1518 |
+
method_lines = [hash_def]
|
| 1519 |
+
|
| 1520 |
+
def append_hash_computation_lines(prefix, indent):
|
| 1521 |
+
"""
|
| 1522 |
+
Generate the code for actually computing the hash code.
|
| 1523 |
+
Below this will either be returned directly or used to compute
|
| 1524 |
+
a value which is then cached, depending on the value of cache_hash
|
| 1525 |
+
"""
|
| 1526 |
+
|
| 1527 |
+
method_lines.extend(
|
| 1528 |
+
[
|
| 1529 |
+
indent + prefix + hash_func,
|
| 1530 |
+
indent + f" {type_hash},",
|
| 1531 |
+
]
|
| 1532 |
+
)
|
| 1533 |
+
|
| 1534 |
+
for a in attrs:
|
| 1535 |
+
if a.eq_key:
|
| 1536 |
+
cmp_name = f"_{a.name}_key"
|
| 1537 |
+
globs[cmp_name] = a.eq_key
|
| 1538 |
+
method_lines.append(
|
| 1539 |
+
indent + f" {cmp_name}(self.{a.name}),"
|
| 1540 |
+
)
|
| 1541 |
+
else:
|
| 1542 |
+
method_lines.append(indent + f" self.{a.name},")
|
| 1543 |
+
|
| 1544 |
+
method_lines.append(indent + " " + closing_braces)
|
| 1545 |
+
|
| 1546 |
+
if cache_hash:
|
| 1547 |
+
method_lines.append(tab + f"if self.{_HASH_CACHE_FIELD} is None:")
|
| 1548 |
+
if frozen:
|
| 1549 |
+
append_hash_computation_lines(
|
| 1550 |
+
f"object.__setattr__(self, '{_HASH_CACHE_FIELD}', ", tab * 2
|
| 1551 |
+
)
|
| 1552 |
+
method_lines.append(tab * 2 + ")") # close __setattr__
|
| 1553 |
+
else:
|
| 1554 |
+
append_hash_computation_lines(
|
| 1555 |
+
f"self.{_HASH_CACHE_FIELD} = ", tab * 2
|
| 1556 |
+
)
|
| 1557 |
+
method_lines.append(tab + f"return self.{_HASH_CACHE_FIELD}")
|
| 1558 |
+
else:
|
| 1559 |
+
append_hash_computation_lines("return ", tab)
|
| 1560 |
+
|
| 1561 |
+
script = "\n".join(method_lines)
|
| 1562 |
+
return _make_method("__hash__", script, unique_filename, globs)
|
| 1563 |
+
|
| 1564 |
+
|
| 1565 |
+
def _add_hash(cls, attrs):
|
| 1566 |
+
"""
|
| 1567 |
+
Add a hash method to *cls*.
|
| 1568 |
+
"""
|
| 1569 |
+
cls.__hash__ = _make_hash(cls, attrs, frozen=False, cache_hash=False)
|
| 1570 |
+
return cls
|
| 1571 |
+
|
| 1572 |
+
|
| 1573 |
+
def _make_ne():
|
| 1574 |
+
"""
|
| 1575 |
+
Create __ne__ method.
|
| 1576 |
+
"""
|
| 1577 |
+
|
| 1578 |
+
def __ne__(self, other):
|
| 1579 |
+
"""
|
| 1580 |
+
Check equality and either forward a NotImplemented or
|
| 1581 |
+
return the result negated.
|
| 1582 |
+
"""
|
| 1583 |
+
result = self.__eq__(other)
|
| 1584 |
+
if result is NotImplemented:
|
| 1585 |
+
return NotImplemented
|
| 1586 |
+
|
| 1587 |
+
return not result
|
| 1588 |
+
|
| 1589 |
+
return __ne__
|
| 1590 |
+
|
| 1591 |
+
|
| 1592 |
+
def _make_eq(cls, attrs):
|
| 1593 |
+
"""
|
| 1594 |
+
Create __eq__ method for *cls* with *attrs*.
|
| 1595 |
+
"""
|
| 1596 |
+
attrs = [a for a in attrs if a.eq]
|
| 1597 |
+
|
| 1598 |
+
unique_filename = _generate_unique_filename(cls, "eq")
|
| 1599 |
+
lines = [
|
| 1600 |
+
"def __eq__(self, other):",
|
| 1601 |
+
" if other.__class__ is not self.__class__:",
|
| 1602 |
+
" return NotImplemented",
|
| 1603 |
+
]
|
| 1604 |
+
|
| 1605 |
+
globs = {}
|
| 1606 |
+
if attrs:
|
| 1607 |
+
lines.append(" return (")
|
| 1608 |
+
for a in attrs:
|
| 1609 |
+
if a.eq_key:
|
| 1610 |
+
cmp_name = f"_{a.name}_key"
|
| 1611 |
+
# Add the key function to the global namespace
|
| 1612 |
+
# of the evaluated function.
|
| 1613 |
+
globs[cmp_name] = a.eq_key
|
| 1614 |
+
lines.append(
|
| 1615 |
+
f" {cmp_name}(self.{a.name}) == {cmp_name}(other.{a.name})"
|
| 1616 |
+
)
|
| 1617 |
+
else:
|
| 1618 |
+
lines.append(f" self.{a.name} == other.{a.name}")
|
| 1619 |
+
if a is not attrs[-1]:
|
| 1620 |
+
lines[-1] = f"{lines[-1]} and"
|
| 1621 |
+
lines.append(" )")
|
| 1622 |
+
else:
|
| 1623 |
+
lines.append(" return True")
|
| 1624 |
+
|
| 1625 |
+
script = "\n".join(lines)
|
| 1626 |
+
|
| 1627 |
+
return _make_method("__eq__", script, unique_filename, globs)
|
| 1628 |
+
|
| 1629 |
+
|
| 1630 |
+
def _make_order(cls, attrs):
|
| 1631 |
+
"""
|
| 1632 |
+
Create ordering methods for *cls* with *attrs*.
|
| 1633 |
+
"""
|
| 1634 |
+
attrs = [a for a in attrs if a.order]
|
| 1635 |
+
|
| 1636 |
+
def attrs_to_tuple(obj):
|
| 1637 |
+
"""
|
| 1638 |
+
Save us some typing.
|
| 1639 |
+
"""
|
| 1640 |
+
return tuple(
|
| 1641 |
+
key(value) if key else value
|
| 1642 |
+
for value, key in (
|
| 1643 |
+
(getattr(obj, a.name), a.order_key) for a in attrs
|
| 1644 |
+
)
|
| 1645 |
+
)
|
| 1646 |
+
|
| 1647 |
+
def __lt__(self, other):
|
| 1648 |
+
"""
|
| 1649 |
+
Automatically created by attrs.
|
| 1650 |
+
"""
|
| 1651 |
+
if other.__class__ is self.__class__:
|
| 1652 |
+
return attrs_to_tuple(self) < attrs_to_tuple(other)
|
| 1653 |
+
|
| 1654 |
+
return NotImplemented
|
| 1655 |
+
|
| 1656 |
+
def __le__(self, other):
|
| 1657 |
+
"""
|
| 1658 |
+
Automatically created by attrs.
|
| 1659 |
+
"""
|
| 1660 |
+
if other.__class__ is self.__class__:
|
| 1661 |
+
return attrs_to_tuple(self) <= attrs_to_tuple(other)
|
| 1662 |
+
|
| 1663 |
+
return NotImplemented
|
| 1664 |
+
|
| 1665 |
+
def __gt__(self, other):
|
| 1666 |
+
"""
|
| 1667 |
+
Automatically created by attrs.
|
| 1668 |
+
"""
|
| 1669 |
+
if other.__class__ is self.__class__:
|
| 1670 |
+
return attrs_to_tuple(self) > attrs_to_tuple(other)
|
| 1671 |
+
|
| 1672 |
+
return NotImplemented
|
| 1673 |
+
|
| 1674 |
+
def __ge__(self, other):
|
| 1675 |
+
"""
|
| 1676 |
+
Automatically created by attrs.
|
| 1677 |
+
"""
|
| 1678 |
+
if other.__class__ is self.__class__:
|
| 1679 |
+
return attrs_to_tuple(self) >= attrs_to_tuple(other)
|
| 1680 |
+
|
| 1681 |
+
return NotImplemented
|
| 1682 |
+
|
| 1683 |
+
return __lt__, __le__, __gt__, __ge__
|
| 1684 |
+
|
| 1685 |
+
|
| 1686 |
+
def _add_eq(cls, attrs=None):
|
| 1687 |
+
"""
|
| 1688 |
+
Add equality methods to *cls* with *attrs*.
|
| 1689 |
+
"""
|
| 1690 |
+
if attrs is None:
|
| 1691 |
+
attrs = cls.__attrs_attrs__
|
| 1692 |
+
|
| 1693 |
+
cls.__eq__ = _make_eq(cls, attrs)
|
| 1694 |
+
cls.__ne__ = _make_ne()
|
| 1695 |
+
|
| 1696 |
+
return cls
|
| 1697 |
+
|
| 1698 |
+
|
| 1699 |
+
def _make_repr(attrs, ns, cls):
|
| 1700 |
+
unique_filename = _generate_unique_filename(cls, "repr")
|
| 1701 |
+
# Figure out which attributes to include, and which function to use to
|
| 1702 |
+
# format them. The a.repr value can be either bool or a custom
|
| 1703 |
+
# callable.
|
| 1704 |
+
attr_names_with_reprs = tuple(
|
| 1705 |
+
(a.name, (repr if a.repr is True else a.repr), a.init)
|
| 1706 |
+
for a in attrs
|
| 1707 |
+
if a.repr is not False
|
| 1708 |
+
)
|
| 1709 |
+
globs = {
|
| 1710 |
+
name + "_repr": r for name, r, _ in attr_names_with_reprs if r != repr
|
| 1711 |
+
}
|
| 1712 |
+
globs["_compat"] = _compat
|
| 1713 |
+
globs["AttributeError"] = AttributeError
|
| 1714 |
+
globs["NOTHING"] = NOTHING
|
| 1715 |
+
attribute_fragments = []
|
| 1716 |
+
for name, r, i in attr_names_with_reprs:
|
| 1717 |
+
accessor = (
|
| 1718 |
+
"self." + name if i else 'getattr(self, "' + name + '", NOTHING)'
|
| 1719 |
+
)
|
| 1720 |
+
fragment = (
|
| 1721 |
+
"%s={%s!r}" % (name, accessor)
|
| 1722 |
+
if r == repr
|
| 1723 |
+
else "%s={%s_repr(%s)}" % (name, name, accessor)
|
| 1724 |
+
)
|
| 1725 |
+
attribute_fragments.append(fragment)
|
| 1726 |
+
repr_fragment = ", ".join(attribute_fragments)
|
| 1727 |
+
|
| 1728 |
+
if ns is None:
|
| 1729 |
+
cls_name_fragment = '{self.__class__.__qualname__.rsplit(">.", 1)[-1]}'
|
| 1730 |
+
else:
|
| 1731 |
+
cls_name_fragment = ns + ".{self.__class__.__name__}"
|
| 1732 |
+
|
| 1733 |
+
lines = [
|
| 1734 |
+
"def __repr__(self):",
|
| 1735 |
+
" try:",
|
| 1736 |
+
" already_repring = _compat.repr_context.already_repring",
|
| 1737 |
+
" except AttributeError:",
|
| 1738 |
+
" already_repring = {id(self),}",
|
| 1739 |
+
" _compat.repr_context.already_repring = already_repring",
|
| 1740 |
+
" else:",
|
| 1741 |
+
" if id(self) in already_repring:",
|
| 1742 |
+
" return '...'",
|
| 1743 |
+
" else:",
|
| 1744 |
+
" already_repring.add(id(self))",
|
| 1745 |
+
" try:",
|
| 1746 |
+
f" return f'{cls_name_fragment}({repr_fragment})'",
|
| 1747 |
+
" finally:",
|
| 1748 |
+
" already_repring.remove(id(self))",
|
| 1749 |
+
]
|
| 1750 |
+
|
| 1751 |
+
return _make_method(
|
| 1752 |
+
"__repr__", "\n".join(lines), unique_filename, globs=globs
|
| 1753 |
+
)
|
| 1754 |
+
|
| 1755 |
+
|
| 1756 |
+
def _add_repr(cls, ns=None, attrs=None):
|
| 1757 |
+
"""
|
| 1758 |
+
Add a repr method to *cls*.
|
| 1759 |
+
"""
|
| 1760 |
+
if attrs is None:
|
| 1761 |
+
attrs = cls.__attrs_attrs__
|
| 1762 |
+
|
| 1763 |
+
cls.__repr__ = _make_repr(attrs, ns, cls)
|
| 1764 |
+
return cls
|
| 1765 |
+
|
| 1766 |
+
|
| 1767 |
+
def fields(cls):
|
| 1768 |
+
"""
|
| 1769 |
+
Return the tuple of *attrs* attributes for a class.
|
| 1770 |
+
|
| 1771 |
+
The tuple also allows accessing the fields by their names (see below for
|
| 1772 |
+
examples).
|
| 1773 |
+
|
| 1774 |
+
Args:
|
| 1775 |
+
cls (type): Class to introspect.
|
| 1776 |
+
|
| 1777 |
+
Raises:
|
| 1778 |
+
TypeError: If *cls* is not a class.
|
| 1779 |
+
|
| 1780 |
+
attrs.exceptions.NotAnAttrsClassError:
|
| 1781 |
+
If *cls* is not an *attrs* class.
|
| 1782 |
+
|
| 1783 |
+
Returns:
|
| 1784 |
+
tuple (with name accessors) of `attrs.Attribute`
|
| 1785 |
+
|
| 1786 |
+
.. versionchanged:: 16.2.0 Returned tuple allows accessing the fields
|
| 1787 |
+
by name.
|
| 1788 |
+
.. versionchanged:: 23.1.0 Add support for generic classes.
|
| 1789 |
+
"""
|
| 1790 |
+
generic_base = get_generic_base(cls)
|
| 1791 |
+
|
| 1792 |
+
if generic_base is None and not isinstance(cls, type):
|
| 1793 |
+
msg = "Passed object must be a class."
|
| 1794 |
+
raise TypeError(msg)
|
| 1795 |
+
|
| 1796 |
+
attrs = getattr(cls, "__attrs_attrs__", None)
|
| 1797 |
+
|
| 1798 |
+
if attrs is None:
|
| 1799 |
+
if generic_base is not None:
|
| 1800 |
+
attrs = getattr(generic_base, "__attrs_attrs__", None)
|
| 1801 |
+
if attrs is not None:
|
| 1802 |
+
# Even though this is global state, stick it on here to speed
|
| 1803 |
+
# it up. We rely on `cls` being cached for this to be
|
| 1804 |
+
# efficient.
|
| 1805 |
+
cls.__attrs_attrs__ = attrs
|
| 1806 |
+
return attrs
|
| 1807 |
+
msg = f"{cls!r} is not an attrs-decorated class."
|
| 1808 |
+
raise NotAnAttrsClassError(msg)
|
| 1809 |
+
|
| 1810 |
+
return attrs
|
| 1811 |
+
|
| 1812 |
+
|
| 1813 |
+
def fields_dict(cls):
|
| 1814 |
+
"""
|
| 1815 |
+
Return an ordered dictionary of *attrs* attributes for a class, whose keys
|
| 1816 |
+
are the attribute names.
|
| 1817 |
+
|
| 1818 |
+
Args:
|
| 1819 |
+
cls (type): Class to introspect.
|
| 1820 |
+
|
| 1821 |
+
Raises:
|
| 1822 |
+
TypeError: If *cls* is not a class.
|
| 1823 |
+
|
| 1824 |
+
attrs.exceptions.NotAnAttrsClassError:
|
| 1825 |
+
If *cls* is not an *attrs* class.
|
| 1826 |
+
|
| 1827 |
+
Returns:
|
| 1828 |
+
dict[str, attrs.Attribute]: Dict of attribute name to definition
|
| 1829 |
+
|
| 1830 |
+
.. versionadded:: 18.1.0
|
| 1831 |
+
"""
|
| 1832 |
+
if not isinstance(cls, type):
|
| 1833 |
+
msg = "Passed object must be a class."
|
| 1834 |
+
raise TypeError(msg)
|
| 1835 |
+
attrs = getattr(cls, "__attrs_attrs__", None)
|
| 1836 |
+
if attrs is None:
|
| 1837 |
+
msg = f"{cls!r} is not an attrs-decorated class."
|
| 1838 |
+
raise NotAnAttrsClassError(msg)
|
| 1839 |
+
return {a.name: a for a in attrs}
|
| 1840 |
+
|
| 1841 |
+
|
| 1842 |
+
def validate(inst):
|
| 1843 |
+
"""
|
| 1844 |
+
Validate all attributes on *inst* that have a validator.
|
| 1845 |
+
|
| 1846 |
+
Leaves all exceptions through.
|
| 1847 |
+
|
| 1848 |
+
Args:
|
| 1849 |
+
inst: Instance of a class with *attrs* attributes.
|
| 1850 |
+
"""
|
| 1851 |
+
if _config._run_validators is False:
|
| 1852 |
+
return
|
| 1853 |
+
|
| 1854 |
+
for a in fields(inst.__class__):
|
| 1855 |
+
v = a.validator
|
| 1856 |
+
if v is not None:
|
| 1857 |
+
v(inst, a, getattr(inst, a.name))
|
| 1858 |
+
|
| 1859 |
+
|
| 1860 |
+
def _is_slot_attr(a_name, base_attr_map):
|
| 1861 |
+
"""
|
| 1862 |
+
Check if the attribute name comes from a slot class.
|
| 1863 |
+
"""
|
| 1864 |
+
cls = base_attr_map.get(a_name)
|
| 1865 |
+
return cls and "__slots__" in cls.__dict__
|
| 1866 |
+
|
| 1867 |
+
|
| 1868 |
+
def _make_init(
|
| 1869 |
+
cls,
|
| 1870 |
+
attrs,
|
| 1871 |
+
pre_init,
|
| 1872 |
+
pre_init_has_args,
|
| 1873 |
+
post_init,
|
| 1874 |
+
frozen,
|
| 1875 |
+
slots,
|
| 1876 |
+
cache_hash,
|
| 1877 |
+
base_attr_map,
|
| 1878 |
+
is_exc,
|
| 1879 |
+
cls_on_setattr,
|
| 1880 |
+
attrs_init,
|
| 1881 |
+
):
|
| 1882 |
+
has_cls_on_setattr = (
|
| 1883 |
+
cls_on_setattr is not None and cls_on_setattr is not setters.NO_OP
|
| 1884 |
+
)
|
| 1885 |
+
|
| 1886 |
+
if frozen and has_cls_on_setattr:
|
| 1887 |
+
msg = "Frozen classes can't use on_setattr."
|
| 1888 |
+
raise ValueError(msg)
|
| 1889 |
+
|
| 1890 |
+
needs_cached_setattr = cache_hash or frozen
|
| 1891 |
+
filtered_attrs = []
|
| 1892 |
+
attr_dict = {}
|
| 1893 |
+
for a in attrs:
|
| 1894 |
+
if not a.init and a.default is NOTHING:
|
| 1895 |
+
continue
|
| 1896 |
+
|
| 1897 |
+
filtered_attrs.append(a)
|
| 1898 |
+
attr_dict[a.name] = a
|
| 1899 |
+
|
| 1900 |
+
if a.on_setattr is not None:
|
| 1901 |
+
if frozen is True:
|
| 1902 |
+
msg = "Frozen classes can't use on_setattr."
|
| 1903 |
+
raise ValueError(msg)
|
| 1904 |
+
|
| 1905 |
+
needs_cached_setattr = True
|
| 1906 |
+
elif has_cls_on_setattr and a.on_setattr is not setters.NO_OP:
|
| 1907 |
+
needs_cached_setattr = True
|
| 1908 |
+
|
| 1909 |
+
unique_filename = _generate_unique_filename(cls, "init")
|
| 1910 |
+
|
| 1911 |
+
script, globs, annotations = _attrs_to_init_script(
|
| 1912 |
+
filtered_attrs,
|
| 1913 |
+
frozen,
|
| 1914 |
+
slots,
|
| 1915 |
+
pre_init,
|
| 1916 |
+
pre_init_has_args,
|
| 1917 |
+
post_init,
|
| 1918 |
+
cache_hash,
|
| 1919 |
+
base_attr_map,
|
| 1920 |
+
is_exc,
|
| 1921 |
+
needs_cached_setattr,
|
| 1922 |
+
has_cls_on_setattr,
|
| 1923 |
+
"__attrs_init__" if attrs_init else "__init__",
|
| 1924 |
+
)
|
| 1925 |
+
if cls.__module__ in sys.modules:
|
| 1926 |
+
# This makes typing.get_type_hints(CLS.__init__) resolve string types.
|
| 1927 |
+
globs.update(sys.modules[cls.__module__].__dict__)
|
| 1928 |
+
|
| 1929 |
+
globs.update({"NOTHING": NOTHING, "attr_dict": attr_dict})
|
| 1930 |
+
|
| 1931 |
+
if needs_cached_setattr:
|
| 1932 |
+
# Save the lookup overhead in __init__ if we need to circumvent
|
| 1933 |
+
# setattr hooks.
|
| 1934 |
+
globs["_cached_setattr_get"] = _OBJ_SETATTR.__get__
|
| 1935 |
+
|
| 1936 |
+
init = _make_method(
|
| 1937 |
+
"__attrs_init__" if attrs_init else "__init__",
|
| 1938 |
+
script,
|
| 1939 |
+
unique_filename,
|
| 1940 |
+
globs,
|
| 1941 |
+
)
|
| 1942 |
+
init.__annotations__ = annotations
|
| 1943 |
+
|
| 1944 |
+
return init
|
| 1945 |
+
|
| 1946 |
+
|
| 1947 |
+
def _setattr(attr_name: str, value_var: str, has_on_setattr: bool) -> str:
|
| 1948 |
+
"""
|
| 1949 |
+
Use the cached object.setattr to set *attr_name* to *value_var*.
|
| 1950 |
+
"""
|
| 1951 |
+
return f"_setattr('{attr_name}', {value_var})"
|
| 1952 |
+
|
| 1953 |
+
|
| 1954 |
+
def _setattr_with_converter(
|
| 1955 |
+
attr_name: str, value_var: str, has_on_setattr: bool, converter: Converter
|
| 1956 |
+
) -> str:
|
| 1957 |
+
"""
|
| 1958 |
+
Use the cached object.setattr to set *attr_name* to *value_var*, but run
|
| 1959 |
+
its converter first.
|
| 1960 |
+
"""
|
| 1961 |
+
return f"_setattr('{attr_name}', {converter._fmt_converter_call(attr_name, value_var)})"
|
| 1962 |
+
|
| 1963 |
+
|
| 1964 |
+
def _assign(attr_name: str, value: str, has_on_setattr: bool) -> str:
|
| 1965 |
+
"""
|
| 1966 |
+
Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
|
| 1967 |
+
relegate to _setattr.
|
| 1968 |
+
"""
|
| 1969 |
+
if has_on_setattr:
|
| 1970 |
+
return _setattr(attr_name, value, True)
|
| 1971 |
+
|
| 1972 |
+
return f"self.{attr_name} = {value}"
|
| 1973 |
+
|
| 1974 |
+
|
| 1975 |
+
def _assign_with_converter(
|
| 1976 |
+
attr_name: str, value_var: str, has_on_setattr: bool, converter: Converter
|
| 1977 |
+
) -> str:
|
| 1978 |
+
"""
|
| 1979 |
+
Unless *attr_name* has an on_setattr hook, use normal assignment after
|
| 1980 |
+
conversion. Otherwise relegate to _setattr_with_converter.
|
| 1981 |
+
"""
|
| 1982 |
+
if has_on_setattr:
|
| 1983 |
+
return _setattr_with_converter(attr_name, value_var, True, converter)
|
| 1984 |
+
|
| 1985 |
+
return f"self.{attr_name} = {converter._fmt_converter_call(attr_name, value_var)}"
|
| 1986 |
+
|
| 1987 |
+
|
| 1988 |
+
def _determine_setters(
|
| 1989 |
+
frozen: bool, slots: bool, base_attr_map: dict[str, type]
|
| 1990 |
+
):
|
| 1991 |
+
"""
|
| 1992 |
+
Determine the correct setter functions based on whether a class is frozen
|
| 1993 |
+
and/or slotted.
|
| 1994 |
+
"""
|
| 1995 |
+
if frozen is True:
|
| 1996 |
+
if slots is True:
|
| 1997 |
+
return (), _setattr, _setattr_with_converter
|
| 1998 |
+
|
| 1999 |
+
# Dict frozen classes assign directly to __dict__.
|
| 2000 |
+
# But only if the attribute doesn't come from an ancestor slot
|
| 2001 |
+
# class.
|
| 2002 |
+
# Note _inst_dict will be used again below if cache_hash is True
|
| 2003 |
+
|
| 2004 |
+
def fmt_setter(
|
| 2005 |
+
attr_name: str, value_var: str, has_on_setattr: bool
|
| 2006 |
+
) -> str:
|
| 2007 |
+
if _is_slot_attr(attr_name, base_attr_map):
|
| 2008 |
+
return _setattr(attr_name, value_var, has_on_setattr)
|
| 2009 |
+
|
| 2010 |
+
return f"_inst_dict['{attr_name}'] = {value_var}"
|
| 2011 |
+
|
| 2012 |
+
def fmt_setter_with_converter(
|
| 2013 |
+
attr_name: str,
|
| 2014 |
+
value_var: str,
|
| 2015 |
+
has_on_setattr: bool,
|
| 2016 |
+
converter: Converter,
|
| 2017 |
+
) -> str:
|
| 2018 |
+
if has_on_setattr or _is_slot_attr(attr_name, base_attr_map):
|
| 2019 |
+
return _setattr_with_converter(
|
| 2020 |
+
attr_name, value_var, has_on_setattr, converter
|
| 2021 |
+
)
|
| 2022 |
+
|
| 2023 |
+
return f"_inst_dict['{attr_name}'] = {converter._fmt_converter_call(attr_name, value_var)}"
|
| 2024 |
+
|
| 2025 |
+
return (
|
| 2026 |
+
("_inst_dict = self.__dict__",),
|
| 2027 |
+
fmt_setter,
|
| 2028 |
+
fmt_setter_with_converter,
|
| 2029 |
+
)
|
| 2030 |
+
|
| 2031 |
+
# Not frozen -- we can just assign directly.
|
| 2032 |
+
return (), _assign, _assign_with_converter
|
| 2033 |
+
|
| 2034 |
+
|
| 2035 |
+
def _attrs_to_init_script(
|
| 2036 |
+
attrs: list[Attribute],
|
| 2037 |
+
is_frozen: bool,
|
| 2038 |
+
is_slotted: bool,
|
| 2039 |
+
call_pre_init: bool,
|
| 2040 |
+
pre_init_has_args: bool,
|
| 2041 |
+
call_post_init: bool,
|
| 2042 |
+
does_cache_hash: bool,
|
| 2043 |
+
base_attr_map: dict[str, type],
|
| 2044 |
+
is_exc: bool,
|
| 2045 |
+
needs_cached_setattr: bool,
|
| 2046 |
+
has_cls_on_setattr: bool,
|
| 2047 |
+
method_name: str,
|
| 2048 |
+
) -> tuple[str, dict, dict]:
|
| 2049 |
+
"""
|
| 2050 |
+
Return a script of an initializer for *attrs*, a dict of globals, and
|
| 2051 |
+
annotations for the initializer.
|
| 2052 |
+
|
| 2053 |
+
The globals are required by the generated script.
|
| 2054 |
+
"""
|
| 2055 |
+
lines = ["self.__attrs_pre_init__()"] if call_pre_init else []
|
| 2056 |
+
|
| 2057 |
+
if needs_cached_setattr:
|
| 2058 |
+
lines.append(
|
| 2059 |
+
# Circumvent the __setattr__ descriptor to save one lookup per
|
| 2060 |
+
# assignment. Note _setattr will be used again below if
|
| 2061 |
+
# does_cache_hash is True.
|
| 2062 |
+
"_setattr = _cached_setattr_get(self)"
|
| 2063 |
+
)
|
| 2064 |
+
|
| 2065 |
+
extra_lines, fmt_setter, fmt_setter_with_converter = _determine_setters(
|
| 2066 |
+
is_frozen, is_slotted, base_attr_map
|
| 2067 |
+
)
|
| 2068 |
+
lines.extend(extra_lines)
|
| 2069 |
+
|
| 2070 |
+
args = []
|
| 2071 |
+
kw_only_args = []
|
| 2072 |
+
attrs_to_validate = []
|
| 2073 |
+
|
| 2074 |
+
# This is a dictionary of names to validator and converter callables.
|
| 2075 |
+
# Injecting this into __init__ globals lets us avoid lookups.
|
| 2076 |
+
names_for_globals = {}
|
| 2077 |
+
annotations = {"return": None}
|
| 2078 |
+
|
| 2079 |
+
for a in attrs:
|
| 2080 |
+
if a.validator:
|
| 2081 |
+
attrs_to_validate.append(a)
|
| 2082 |
+
|
| 2083 |
+
attr_name = a.name
|
| 2084 |
+
has_on_setattr = a.on_setattr is not None or (
|
| 2085 |
+
a.on_setattr is not setters.NO_OP and has_cls_on_setattr
|
| 2086 |
+
)
|
| 2087 |
+
# a.alias is set to maybe-mangled attr_name in _ClassBuilder if not
|
| 2088 |
+
# explicitly provided
|
| 2089 |
+
arg_name = a.alias
|
| 2090 |
+
|
| 2091 |
+
has_factory = isinstance(a.default, Factory)
|
| 2092 |
+
maybe_self = "self" if has_factory and a.default.takes_self else ""
|
| 2093 |
+
|
| 2094 |
+
if a.converter is not None and not isinstance(a.converter, Converter):
|
| 2095 |
+
converter = Converter(a.converter)
|
| 2096 |
+
else:
|
| 2097 |
+
converter = a.converter
|
| 2098 |
+
|
| 2099 |
+
if a.init is False:
|
| 2100 |
+
if has_factory:
|
| 2101 |
+
init_factory_name = _INIT_FACTORY_PAT % (a.name,)
|
| 2102 |
+
if converter is not None:
|
| 2103 |
+
lines.append(
|
| 2104 |
+
fmt_setter_with_converter(
|
| 2105 |
+
attr_name,
|
| 2106 |
+
init_factory_name + f"({maybe_self})",
|
| 2107 |
+
has_on_setattr,
|
| 2108 |
+
converter,
|
| 2109 |
+
)
|
| 2110 |
+
)
|
| 2111 |
+
names_for_globals[converter._get_global_name(a.name)] = (
|
| 2112 |
+
converter.converter
|
| 2113 |
+
)
|
| 2114 |
+
else:
|
| 2115 |
+
lines.append(
|
| 2116 |
+
fmt_setter(
|
| 2117 |
+
attr_name,
|
| 2118 |
+
init_factory_name + f"({maybe_self})",
|
| 2119 |
+
has_on_setattr,
|
| 2120 |
+
)
|
| 2121 |
+
)
|
| 2122 |
+
names_for_globals[init_factory_name] = a.default.factory
|
| 2123 |
+
elif converter is not None:
|
| 2124 |
+
lines.append(
|
| 2125 |
+
fmt_setter_with_converter(
|
| 2126 |
+
attr_name,
|
| 2127 |
+
f"attr_dict['{attr_name}'].default",
|
| 2128 |
+
has_on_setattr,
|
| 2129 |
+
converter,
|
| 2130 |
+
)
|
| 2131 |
+
)
|
| 2132 |
+
names_for_globals[converter._get_global_name(a.name)] = (
|
| 2133 |
+
converter.converter
|
| 2134 |
+
)
|
| 2135 |
+
else:
|
| 2136 |
+
lines.append(
|
| 2137 |
+
fmt_setter(
|
| 2138 |
+
attr_name,
|
| 2139 |
+
f"attr_dict['{attr_name}'].default",
|
| 2140 |
+
has_on_setattr,
|
| 2141 |
+
)
|
| 2142 |
+
)
|
| 2143 |
+
elif a.default is not NOTHING and not has_factory:
|
| 2144 |
+
arg = f"{arg_name}=attr_dict['{attr_name}'].default"
|
| 2145 |
+
if a.kw_only:
|
| 2146 |
+
kw_only_args.append(arg)
|
| 2147 |
+
else:
|
| 2148 |
+
args.append(arg)
|
| 2149 |
+
|
| 2150 |
+
if converter is not None:
|
| 2151 |
+
lines.append(
|
| 2152 |
+
fmt_setter_with_converter(
|
| 2153 |
+
attr_name, arg_name, has_on_setattr, converter
|
| 2154 |
+
)
|
| 2155 |
+
)
|
| 2156 |
+
names_for_globals[converter._get_global_name(a.name)] = (
|
| 2157 |
+
converter.converter
|
| 2158 |
+
)
|
| 2159 |
+
else:
|
| 2160 |
+
lines.append(fmt_setter(attr_name, arg_name, has_on_setattr))
|
| 2161 |
+
|
| 2162 |
+
elif has_factory:
|
| 2163 |
+
arg = f"{arg_name}=NOTHING"
|
| 2164 |
+
if a.kw_only:
|
| 2165 |
+
kw_only_args.append(arg)
|
| 2166 |
+
else:
|
| 2167 |
+
args.append(arg)
|
| 2168 |
+
lines.append(f"if {arg_name} is not NOTHING:")
|
| 2169 |
+
|
| 2170 |
+
init_factory_name = _INIT_FACTORY_PAT % (a.name,)
|
| 2171 |
+
if converter is not None:
|
| 2172 |
+
lines.append(
|
| 2173 |
+
" "
|
| 2174 |
+
+ fmt_setter_with_converter(
|
| 2175 |
+
attr_name, arg_name, has_on_setattr, converter
|
| 2176 |
+
)
|
| 2177 |
+
)
|
| 2178 |
+
lines.append("else:")
|
| 2179 |
+
lines.append(
|
| 2180 |
+
" "
|
| 2181 |
+
+ fmt_setter_with_converter(
|
| 2182 |
+
attr_name,
|
| 2183 |
+
init_factory_name + "(" + maybe_self + ")",
|
| 2184 |
+
has_on_setattr,
|
| 2185 |
+
converter,
|
| 2186 |
+
)
|
| 2187 |
+
)
|
| 2188 |
+
names_for_globals[converter._get_global_name(a.name)] = (
|
| 2189 |
+
converter.converter
|
| 2190 |
+
)
|
| 2191 |
+
else:
|
| 2192 |
+
lines.append(
|
| 2193 |
+
" " + fmt_setter(attr_name, arg_name, has_on_setattr)
|
| 2194 |
+
)
|
| 2195 |
+
lines.append("else:")
|
| 2196 |
+
lines.append(
|
| 2197 |
+
" "
|
| 2198 |
+
+ fmt_setter(
|
| 2199 |
+
attr_name,
|
| 2200 |
+
init_factory_name + "(" + maybe_self + ")",
|
| 2201 |
+
has_on_setattr,
|
| 2202 |
+
)
|
| 2203 |
+
)
|
| 2204 |
+
names_for_globals[init_factory_name] = a.default.factory
|
| 2205 |
+
else:
|
| 2206 |
+
if a.kw_only:
|
| 2207 |
+
kw_only_args.append(arg_name)
|
| 2208 |
+
else:
|
| 2209 |
+
args.append(arg_name)
|
| 2210 |
+
|
| 2211 |
+
if converter is not None:
|
| 2212 |
+
lines.append(
|
| 2213 |
+
fmt_setter_with_converter(
|
| 2214 |
+
attr_name, arg_name, has_on_setattr, converter
|
| 2215 |
+
)
|
| 2216 |
+
)
|
| 2217 |
+
names_for_globals[converter._get_global_name(a.name)] = (
|
| 2218 |
+
converter.converter
|
| 2219 |
+
)
|
| 2220 |
+
else:
|
| 2221 |
+
lines.append(fmt_setter(attr_name, arg_name, has_on_setattr))
|
| 2222 |
+
|
| 2223 |
+
if a.init is True:
|
| 2224 |
+
if a.type is not None and converter is None:
|
| 2225 |
+
annotations[arg_name] = a.type
|
| 2226 |
+
elif converter is not None and converter._first_param_type:
|
| 2227 |
+
# Use the type from the converter if present.
|
| 2228 |
+
annotations[arg_name] = converter._first_param_type
|
| 2229 |
+
|
| 2230 |
+
if attrs_to_validate: # we can skip this if there are no validators.
|
| 2231 |
+
names_for_globals["_config"] = _config
|
| 2232 |
+
lines.append("if _config._run_validators is True:")
|
| 2233 |
+
for a in attrs_to_validate:
|
| 2234 |
+
val_name = "__attr_validator_" + a.name
|
| 2235 |
+
attr_name = "__attr_" + a.name
|
| 2236 |
+
lines.append(f" {val_name}(self, {attr_name}, self.{a.name})")
|
| 2237 |
+
names_for_globals[val_name] = a.validator
|
| 2238 |
+
names_for_globals[attr_name] = a
|
| 2239 |
+
|
| 2240 |
+
if call_post_init:
|
| 2241 |
+
lines.append("self.__attrs_post_init__()")
|
| 2242 |
+
|
| 2243 |
+
# Because this is set only after __attrs_post_init__ is called, a crash
|
| 2244 |
+
# will result if post-init tries to access the hash code. This seemed
|
| 2245 |
+
# preferable to setting this beforehand, in which case alteration to field
|
| 2246 |
+
# values during post-init combined with post-init accessing the hash code
|
| 2247 |
+
# would result in silent bugs.
|
| 2248 |
+
if does_cache_hash:
|
| 2249 |
+
if is_frozen:
|
| 2250 |
+
if is_slotted:
|
| 2251 |
+
init_hash_cache = f"_setattr('{_HASH_CACHE_FIELD}', None)"
|
| 2252 |
+
else:
|
| 2253 |
+
init_hash_cache = f"_inst_dict['{_HASH_CACHE_FIELD}'] = None"
|
| 2254 |
+
else:
|
| 2255 |
+
init_hash_cache = f"self.{_HASH_CACHE_FIELD} = None"
|
| 2256 |
+
lines.append(init_hash_cache)
|
| 2257 |
+
|
| 2258 |
+
# For exceptions we rely on BaseException.__init__ for proper
|
| 2259 |
+
# initialization.
|
| 2260 |
+
if is_exc:
|
| 2261 |
+
vals = ",".join(f"self.{a.name}" for a in attrs if a.init)
|
| 2262 |
+
|
| 2263 |
+
lines.append(f"BaseException.__init__(self, {vals})")
|
| 2264 |
+
|
| 2265 |
+
args = ", ".join(args)
|
| 2266 |
+
pre_init_args = args
|
| 2267 |
+
if kw_only_args:
|
| 2268 |
+
# leading comma & kw_only args
|
| 2269 |
+
args += f"{', ' if args else ''}*, {', '.join(kw_only_args)}"
|
| 2270 |
+
pre_init_kw_only_args = ", ".join(
|
| 2271 |
+
[
|
| 2272 |
+
f"{kw_arg_name}={kw_arg_name}"
|
| 2273 |
+
# We need to remove the defaults from the kw_only_args.
|
| 2274 |
+
for kw_arg_name in (kwa.split("=")[0] for kwa in kw_only_args)
|
| 2275 |
+
]
|
| 2276 |
+
)
|
| 2277 |
+
pre_init_args += ", " if pre_init_args else ""
|
| 2278 |
+
pre_init_args += pre_init_kw_only_args
|
| 2279 |
+
|
| 2280 |
+
if call_pre_init and pre_init_has_args:
|
| 2281 |
+
# If pre init method has arguments, pass same arguments as `__init__`.
|
| 2282 |
+
lines[0] = f"self.__attrs_pre_init__({pre_init_args})"
|
| 2283 |
+
|
| 2284 |
+
# Python <3.12 doesn't allow backslashes in f-strings.
|
| 2285 |
+
NL = "\n "
|
| 2286 |
+
return (
|
| 2287 |
+
f"""def {method_name}(self, {args}):
|
| 2288 |
+
{NL.join(lines) if lines else "pass"}
|
| 2289 |
+
""",
|
| 2290 |
+
names_for_globals,
|
| 2291 |
+
annotations,
|
| 2292 |
+
)
|
| 2293 |
+
|
| 2294 |
+
|
| 2295 |
+
def _default_init_alias_for(name: str) -> str:
|
| 2296 |
+
"""
|
| 2297 |
+
The default __init__ parameter name for a field.
|
| 2298 |
+
|
| 2299 |
+
This performs private-name adjustment via leading-unscore stripping,
|
| 2300 |
+
and is the default value of Attribute.alias if not provided.
|
| 2301 |
+
"""
|
| 2302 |
+
|
| 2303 |
+
return name.lstrip("_")
|
| 2304 |
+
|
| 2305 |
+
|
| 2306 |
+
class Attribute:
|
| 2307 |
+
"""
|
| 2308 |
+
*Read-only* representation of an attribute.
|
| 2309 |
+
|
| 2310 |
+
.. warning::
|
| 2311 |
+
|
| 2312 |
+
You should never instantiate this class yourself.
|
| 2313 |
+
|
| 2314 |
+
The class has *all* arguments of `attr.ib` (except for ``factory`` which is
|
| 2315 |
+
only syntactic sugar for ``default=Factory(...)`` plus the following:
|
| 2316 |
+
|
| 2317 |
+
- ``name`` (`str`): The name of the attribute.
|
| 2318 |
+
- ``alias`` (`str`): The __init__ parameter name of the attribute, after
|
| 2319 |
+
any explicit overrides and default private-attribute-name handling.
|
| 2320 |
+
- ``inherited`` (`bool`): Whether or not that attribute has been inherited
|
| 2321 |
+
from a base class.
|
| 2322 |
+
- ``eq_key`` and ``order_key`` (`typing.Callable` or `None`): The
|
| 2323 |
+
callables that are used for comparing and ordering objects by this
|
| 2324 |
+
attribute, respectively. These are set by passing a callable to
|
| 2325 |
+
`attr.ib`'s ``eq``, ``order``, or ``cmp`` arguments. See also
|
| 2326 |
+
:ref:`comparison customization <custom-comparison>`.
|
| 2327 |
+
|
| 2328 |
+
Instances of this class are frequently used for introspection purposes
|
| 2329 |
+
like:
|
| 2330 |
+
|
| 2331 |
+
- `fields` returns a tuple of them.
|
| 2332 |
+
- Validators get them passed as the first argument.
|
| 2333 |
+
- The :ref:`field transformer <transform-fields>` hook receives a list of
|
| 2334 |
+
them.
|
| 2335 |
+
- The ``alias`` property exposes the __init__ parameter name of the field,
|
| 2336 |
+
with any overrides and default private-attribute handling applied.
|
| 2337 |
+
|
| 2338 |
+
|
| 2339 |
+
.. versionadded:: 20.1.0 *inherited*
|
| 2340 |
+
.. versionadded:: 20.1.0 *on_setattr*
|
| 2341 |
+
.. versionchanged:: 20.2.0 *inherited* is not taken into account for
|
| 2342 |
+
equality checks and hashing anymore.
|
| 2343 |
+
.. versionadded:: 21.1.0 *eq_key* and *order_key*
|
| 2344 |
+
.. versionadded:: 22.2.0 *alias*
|
| 2345 |
+
|
| 2346 |
+
For the full version history of the fields, see `attr.ib`.
|
| 2347 |
+
"""
|
| 2348 |
+
|
| 2349 |
+
# These slots must NOT be reordered because we use them later for
|
| 2350 |
+
# instantiation.
|
| 2351 |
+
__slots__ = ( # noqa: RUF023
|
| 2352 |
+
"name",
|
| 2353 |
+
"default",
|
| 2354 |
+
"validator",
|
| 2355 |
+
"repr",
|
| 2356 |
+
"eq",
|
| 2357 |
+
"eq_key",
|
| 2358 |
+
"order",
|
| 2359 |
+
"order_key",
|
| 2360 |
+
"hash",
|
| 2361 |
+
"init",
|
| 2362 |
+
"metadata",
|
| 2363 |
+
"type",
|
| 2364 |
+
"converter",
|
| 2365 |
+
"kw_only",
|
| 2366 |
+
"inherited",
|
| 2367 |
+
"on_setattr",
|
| 2368 |
+
"alias",
|
| 2369 |
+
)
|
| 2370 |
+
|
| 2371 |
+
def __init__(
|
| 2372 |
+
self,
|
| 2373 |
+
name,
|
| 2374 |
+
default,
|
| 2375 |
+
validator,
|
| 2376 |
+
repr,
|
| 2377 |
+
cmp, # XXX: unused, remove along with other cmp code.
|
| 2378 |
+
hash,
|
| 2379 |
+
init,
|
| 2380 |
+
inherited,
|
| 2381 |
+
metadata=None,
|
| 2382 |
+
type=None,
|
| 2383 |
+
converter=None,
|
| 2384 |
+
kw_only=False,
|
| 2385 |
+
eq=None,
|
| 2386 |
+
eq_key=None,
|
| 2387 |
+
order=None,
|
| 2388 |
+
order_key=None,
|
| 2389 |
+
on_setattr=None,
|
| 2390 |
+
alias=None,
|
| 2391 |
+
):
|
| 2392 |
+
eq, eq_key, order, order_key = _determine_attrib_eq_order(
|
| 2393 |
+
cmp, eq_key or eq, order_key or order, True
|
| 2394 |
+
)
|
| 2395 |
+
|
| 2396 |
+
# Cache this descriptor here to speed things up later.
|
| 2397 |
+
bound_setattr = _OBJ_SETATTR.__get__(self)
|
| 2398 |
+
|
| 2399 |
+
# Despite the big red warning, people *do* instantiate `Attribute`
|
| 2400 |
+
# themselves.
|
| 2401 |
+
bound_setattr("name", name)
|
| 2402 |
+
bound_setattr("default", default)
|
| 2403 |
+
bound_setattr("validator", validator)
|
| 2404 |
+
bound_setattr("repr", repr)
|
| 2405 |
+
bound_setattr("eq", eq)
|
| 2406 |
+
bound_setattr("eq_key", eq_key)
|
| 2407 |
+
bound_setattr("order", order)
|
| 2408 |
+
bound_setattr("order_key", order_key)
|
| 2409 |
+
bound_setattr("hash", hash)
|
| 2410 |
+
bound_setattr("init", init)
|
| 2411 |
+
bound_setattr("converter", converter)
|
| 2412 |
+
bound_setattr(
|
| 2413 |
+
"metadata",
|
| 2414 |
+
(
|
| 2415 |
+
types.MappingProxyType(dict(metadata)) # Shallow copy
|
| 2416 |
+
if metadata
|
| 2417 |
+
else _EMPTY_METADATA_SINGLETON
|
| 2418 |
+
),
|
| 2419 |
+
)
|
| 2420 |
+
bound_setattr("type", type)
|
| 2421 |
+
bound_setattr("kw_only", kw_only)
|
| 2422 |
+
bound_setattr("inherited", inherited)
|
| 2423 |
+
bound_setattr("on_setattr", on_setattr)
|
| 2424 |
+
bound_setattr("alias", alias)
|
| 2425 |
+
|
| 2426 |
+
def __setattr__(self, name, value):
|
| 2427 |
+
raise FrozenInstanceError
|
| 2428 |
+
|
| 2429 |
+
@classmethod
|
| 2430 |
+
def from_counting_attr(cls, name, ca, type=None):
|
| 2431 |
+
# type holds the annotated value. deal with conflicts:
|
| 2432 |
+
if type is None:
|
| 2433 |
+
type = ca.type
|
| 2434 |
+
elif ca.type is not None:
|
| 2435 |
+
msg = "Type annotation and type argument cannot both be present"
|
| 2436 |
+
raise ValueError(msg)
|
| 2437 |
+
inst_dict = {
|
| 2438 |
+
k: getattr(ca, k)
|
| 2439 |
+
for k in Attribute.__slots__
|
| 2440 |
+
if k
|
| 2441 |
+
not in (
|
| 2442 |
+
"name",
|
| 2443 |
+
"validator",
|
| 2444 |
+
"default",
|
| 2445 |
+
"type",
|
| 2446 |
+
"inherited",
|
| 2447 |
+
) # exclude methods and deprecated alias
|
| 2448 |
+
}
|
| 2449 |
+
return cls(
|
| 2450 |
+
name=name,
|
| 2451 |
+
validator=ca._validator,
|
| 2452 |
+
default=ca._default,
|
| 2453 |
+
type=type,
|
| 2454 |
+
cmp=None,
|
| 2455 |
+
inherited=False,
|
| 2456 |
+
**inst_dict,
|
| 2457 |
+
)
|
| 2458 |
+
|
| 2459 |
+
# Don't use attrs.evolve since fields(Attribute) doesn't work
|
| 2460 |
+
def evolve(self, **changes):
|
| 2461 |
+
"""
|
| 2462 |
+
Copy *self* and apply *changes*.
|
| 2463 |
+
|
| 2464 |
+
This works similarly to `attrs.evolve` but that function does not work
|
| 2465 |
+
with :class:`attrs.Attribute`.
|
| 2466 |
+
|
| 2467 |
+
It is mainly meant to be used for `transform-fields`.
|
| 2468 |
+
|
| 2469 |
+
.. versionadded:: 20.3.0
|
| 2470 |
+
"""
|
| 2471 |
+
new = copy.copy(self)
|
| 2472 |
+
|
| 2473 |
+
new._setattrs(changes.items())
|
| 2474 |
+
|
| 2475 |
+
return new
|
| 2476 |
+
|
| 2477 |
+
# Don't use _add_pickle since fields(Attribute) doesn't work
|
| 2478 |
+
def __getstate__(self):
|
| 2479 |
+
"""
|
| 2480 |
+
Play nice with pickle.
|
| 2481 |
+
"""
|
| 2482 |
+
return tuple(
|
| 2483 |
+
getattr(self, name) if name != "metadata" else dict(self.metadata)
|
| 2484 |
+
for name in self.__slots__
|
| 2485 |
+
)
|
| 2486 |
+
|
| 2487 |
+
def __setstate__(self, state):
|
| 2488 |
+
"""
|
| 2489 |
+
Play nice with pickle.
|
| 2490 |
+
"""
|
| 2491 |
+
self._setattrs(zip(self.__slots__, state))
|
| 2492 |
+
|
| 2493 |
+
def _setattrs(self, name_values_pairs):
|
| 2494 |
+
bound_setattr = _OBJ_SETATTR.__get__(self)
|
| 2495 |
+
for name, value in name_values_pairs:
|
| 2496 |
+
if name != "metadata":
|
| 2497 |
+
bound_setattr(name, value)
|
| 2498 |
+
else:
|
| 2499 |
+
bound_setattr(
|
| 2500 |
+
name,
|
| 2501 |
+
(
|
| 2502 |
+
types.MappingProxyType(dict(value))
|
| 2503 |
+
if value
|
| 2504 |
+
else _EMPTY_METADATA_SINGLETON
|
| 2505 |
+
),
|
| 2506 |
+
)
|
| 2507 |
+
|
| 2508 |
+
|
| 2509 |
+
_a = [
|
| 2510 |
+
Attribute(
|
| 2511 |
+
name=name,
|
| 2512 |
+
default=NOTHING,
|
| 2513 |
+
validator=None,
|
| 2514 |
+
repr=True,
|
| 2515 |
+
cmp=None,
|
| 2516 |
+
eq=True,
|
| 2517 |
+
order=False,
|
| 2518 |
+
hash=(name != "metadata"),
|
| 2519 |
+
init=True,
|
| 2520 |
+
inherited=False,
|
| 2521 |
+
alias=_default_init_alias_for(name),
|
| 2522 |
+
)
|
| 2523 |
+
for name in Attribute.__slots__
|
| 2524 |
+
]
|
| 2525 |
+
|
| 2526 |
+
Attribute = _add_hash(
|
| 2527 |
+
_add_eq(
|
| 2528 |
+
_add_repr(Attribute, attrs=_a),
|
| 2529 |
+
attrs=[a for a in _a if a.name != "inherited"],
|
| 2530 |
+
),
|
| 2531 |
+
attrs=[a for a in _a if a.hash and a.name != "inherited"],
|
| 2532 |
+
)
|
| 2533 |
+
|
| 2534 |
+
|
| 2535 |
+
class _CountingAttr:
|
| 2536 |
+
"""
|
| 2537 |
+
Intermediate representation of attributes that uses a counter to preserve
|
| 2538 |
+
the order in which the attributes have been defined.
|
| 2539 |
+
|
| 2540 |
+
*Internal* data structure of the attrs library. Running into is most
|
| 2541 |
+
likely the result of a bug like a forgotten `@attr.s` decorator.
|
| 2542 |
+
"""
|
| 2543 |
+
|
| 2544 |
+
__slots__ = (
|
| 2545 |
+
"_default",
|
| 2546 |
+
"_validator",
|
| 2547 |
+
"alias",
|
| 2548 |
+
"converter",
|
| 2549 |
+
"counter",
|
| 2550 |
+
"eq",
|
| 2551 |
+
"eq_key",
|
| 2552 |
+
"hash",
|
| 2553 |
+
"init",
|
| 2554 |
+
"kw_only",
|
| 2555 |
+
"metadata",
|
| 2556 |
+
"on_setattr",
|
| 2557 |
+
"order",
|
| 2558 |
+
"order_key",
|
| 2559 |
+
"repr",
|
| 2560 |
+
"type",
|
| 2561 |
+
)
|
| 2562 |
+
__attrs_attrs__ = (
|
| 2563 |
+
*tuple(
|
| 2564 |
+
Attribute(
|
| 2565 |
+
name=name,
|
| 2566 |
+
alias=_default_init_alias_for(name),
|
| 2567 |
+
default=NOTHING,
|
| 2568 |
+
validator=None,
|
| 2569 |
+
repr=True,
|
| 2570 |
+
cmp=None,
|
| 2571 |
+
hash=True,
|
| 2572 |
+
init=True,
|
| 2573 |
+
kw_only=False,
|
| 2574 |
+
eq=True,
|
| 2575 |
+
eq_key=None,
|
| 2576 |
+
order=False,
|
| 2577 |
+
order_key=None,
|
| 2578 |
+
inherited=False,
|
| 2579 |
+
on_setattr=None,
|
| 2580 |
+
)
|
| 2581 |
+
for name in (
|
| 2582 |
+
"counter",
|
| 2583 |
+
"_default",
|
| 2584 |
+
"repr",
|
| 2585 |
+
"eq",
|
| 2586 |
+
"order",
|
| 2587 |
+
"hash",
|
| 2588 |
+
"init",
|
| 2589 |
+
"on_setattr",
|
| 2590 |
+
"alias",
|
| 2591 |
+
)
|
| 2592 |
+
),
|
| 2593 |
+
Attribute(
|
| 2594 |
+
name="metadata",
|
| 2595 |
+
alias="metadata",
|
| 2596 |
+
default=None,
|
| 2597 |
+
validator=None,
|
| 2598 |
+
repr=True,
|
| 2599 |
+
cmp=None,
|
| 2600 |
+
hash=False,
|
| 2601 |
+
init=True,
|
| 2602 |
+
kw_only=False,
|
| 2603 |
+
eq=True,
|
| 2604 |
+
eq_key=None,
|
| 2605 |
+
order=False,
|
| 2606 |
+
order_key=None,
|
| 2607 |
+
inherited=False,
|
| 2608 |
+
on_setattr=None,
|
| 2609 |
+
),
|
| 2610 |
+
)
|
| 2611 |
+
cls_counter = 0
|
| 2612 |
+
|
| 2613 |
+
def __init__(
|
| 2614 |
+
self,
|
| 2615 |
+
default,
|
| 2616 |
+
validator,
|
| 2617 |
+
repr,
|
| 2618 |
+
cmp,
|
| 2619 |
+
hash,
|
| 2620 |
+
init,
|
| 2621 |
+
converter,
|
| 2622 |
+
metadata,
|
| 2623 |
+
type,
|
| 2624 |
+
kw_only,
|
| 2625 |
+
eq,
|
| 2626 |
+
eq_key,
|
| 2627 |
+
order,
|
| 2628 |
+
order_key,
|
| 2629 |
+
on_setattr,
|
| 2630 |
+
alias,
|
| 2631 |
+
):
|
| 2632 |
+
_CountingAttr.cls_counter += 1
|
| 2633 |
+
self.counter = _CountingAttr.cls_counter
|
| 2634 |
+
self._default = default
|
| 2635 |
+
self._validator = validator
|
| 2636 |
+
self.converter = converter
|
| 2637 |
+
self.repr = repr
|
| 2638 |
+
self.eq = eq
|
| 2639 |
+
self.eq_key = eq_key
|
| 2640 |
+
self.order = order
|
| 2641 |
+
self.order_key = order_key
|
| 2642 |
+
self.hash = hash
|
| 2643 |
+
self.init = init
|
| 2644 |
+
self.metadata = metadata
|
| 2645 |
+
self.type = type
|
| 2646 |
+
self.kw_only = kw_only
|
| 2647 |
+
self.on_setattr = on_setattr
|
| 2648 |
+
self.alias = alias
|
| 2649 |
+
|
| 2650 |
+
def validator(self, meth):
|
| 2651 |
+
"""
|
| 2652 |
+
Decorator that adds *meth* to the list of validators.
|
| 2653 |
+
|
| 2654 |
+
Returns *meth* unchanged.
|
| 2655 |
+
|
| 2656 |
+
.. versionadded:: 17.1.0
|
| 2657 |
+
"""
|
| 2658 |
+
if self._validator is None:
|
| 2659 |
+
self._validator = meth
|
| 2660 |
+
else:
|
| 2661 |
+
self._validator = and_(self._validator, meth)
|
| 2662 |
+
return meth
|
| 2663 |
+
|
| 2664 |
+
def default(self, meth):
|
| 2665 |
+
"""
|
| 2666 |
+
Decorator that allows to set the default for an attribute.
|
| 2667 |
+
|
| 2668 |
+
Returns *meth* unchanged.
|
| 2669 |
+
|
| 2670 |
+
Raises:
|
| 2671 |
+
DefaultAlreadySetError: If default has been set before.
|
| 2672 |
+
|
| 2673 |
+
.. versionadded:: 17.1.0
|
| 2674 |
+
"""
|
| 2675 |
+
if self._default is not NOTHING:
|
| 2676 |
+
raise DefaultAlreadySetError
|
| 2677 |
+
|
| 2678 |
+
self._default = Factory(meth, takes_self=True)
|
| 2679 |
+
|
| 2680 |
+
return meth
|
| 2681 |
+
|
| 2682 |
+
|
| 2683 |
+
_CountingAttr = _add_eq(_add_repr(_CountingAttr))
|
| 2684 |
+
|
| 2685 |
+
|
| 2686 |
+
class Factory:
|
| 2687 |
+
"""
|
| 2688 |
+
Stores a factory callable.
|
| 2689 |
+
|
| 2690 |
+
If passed as the default value to `attrs.field`, the factory is used to
|
| 2691 |
+
generate a new value.
|
| 2692 |
+
|
| 2693 |
+
Args:
|
| 2694 |
+
factory (typing.Callable):
|
| 2695 |
+
A callable that takes either none or exactly one mandatory
|
| 2696 |
+
positional argument depending on *takes_self*.
|
| 2697 |
+
|
| 2698 |
+
takes_self (bool):
|
| 2699 |
+
Pass the partially initialized instance that is being initialized
|
| 2700 |
+
as a positional argument.
|
| 2701 |
+
|
| 2702 |
+
.. versionadded:: 17.1.0 *takes_self*
|
| 2703 |
+
"""
|
| 2704 |
+
|
| 2705 |
+
__slots__ = ("factory", "takes_self")
|
| 2706 |
+
|
| 2707 |
+
def __init__(self, factory, takes_self=False):
|
| 2708 |
+
self.factory = factory
|
| 2709 |
+
self.takes_self = takes_self
|
| 2710 |
+
|
| 2711 |
+
def __getstate__(self):
|
| 2712 |
+
"""
|
| 2713 |
+
Play nice with pickle.
|
| 2714 |
+
"""
|
| 2715 |
+
return tuple(getattr(self, name) for name in self.__slots__)
|
| 2716 |
+
|
| 2717 |
+
def __setstate__(self, state):
|
| 2718 |
+
"""
|
| 2719 |
+
Play nice with pickle.
|
| 2720 |
+
"""
|
| 2721 |
+
for name, value in zip(self.__slots__, state):
|
| 2722 |
+
setattr(self, name, value)
|
| 2723 |
+
|
| 2724 |
+
|
| 2725 |
+
_f = [
|
| 2726 |
+
Attribute(
|
| 2727 |
+
name=name,
|
| 2728 |
+
default=NOTHING,
|
| 2729 |
+
validator=None,
|
| 2730 |
+
repr=True,
|
| 2731 |
+
cmp=None,
|
| 2732 |
+
eq=True,
|
| 2733 |
+
order=False,
|
| 2734 |
+
hash=True,
|
| 2735 |
+
init=True,
|
| 2736 |
+
inherited=False,
|
| 2737 |
+
)
|
| 2738 |
+
for name in Factory.__slots__
|
| 2739 |
+
]
|
| 2740 |
+
|
| 2741 |
+
Factory = _add_hash(_add_eq(_add_repr(Factory, attrs=_f), attrs=_f), attrs=_f)
|
| 2742 |
+
|
| 2743 |
+
|
| 2744 |
+
class Converter:
|
| 2745 |
+
"""
|
| 2746 |
+
Stores a converter callable.
|
| 2747 |
+
|
| 2748 |
+
Allows for the wrapped converter to take additional arguments. The
|
| 2749 |
+
arguments are passed in the order they are documented.
|
| 2750 |
+
|
| 2751 |
+
Args:
|
| 2752 |
+
converter (Callable): A callable that converts the passed value.
|
| 2753 |
+
|
| 2754 |
+
takes_self (bool):
|
| 2755 |
+
Pass the partially initialized instance that is being initialized
|
| 2756 |
+
as a positional argument. (default: `False`)
|
| 2757 |
+
|
| 2758 |
+
takes_field (bool):
|
| 2759 |
+
Pass the field definition (an :class:`Attribute`) into the
|
| 2760 |
+
converter as a positional argument. (default: `False`)
|
| 2761 |
+
|
| 2762 |
+
.. versionadded:: 24.1.0
|
| 2763 |
+
"""
|
| 2764 |
+
|
| 2765 |
+
__slots__ = (
|
| 2766 |
+
"__call__",
|
| 2767 |
+
"_first_param_type",
|
| 2768 |
+
"_global_name",
|
| 2769 |
+
"converter",
|
| 2770 |
+
"takes_field",
|
| 2771 |
+
"takes_self",
|
| 2772 |
+
)
|
| 2773 |
+
|
| 2774 |
+
def __init__(self, converter, *, takes_self=False, takes_field=False):
|
| 2775 |
+
self.converter = converter
|
| 2776 |
+
self.takes_self = takes_self
|
| 2777 |
+
self.takes_field = takes_field
|
| 2778 |
+
|
| 2779 |
+
ex = _AnnotationExtractor(converter)
|
| 2780 |
+
self._first_param_type = ex.get_first_param_type()
|
| 2781 |
+
|
| 2782 |
+
if not (self.takes_self or self.takes_field):
|
| 2783 |
+
self.__call__ = lambda value, _, __: self.converter(value)
|
| 2784 |
+
elif self.takes_self and not self.takes_field:
|
| 2785 |
+
self.__call__ = lambda value, instance, __: self.converter(
|
| 2786 |
+
value, instance
|
| 2787 |
+
)
|
| 2788 |
+
elif not self.takes_self and self.takes_field:
|
| 2789 |
+
self.__call__ = lambda value, __, field: self.converter(
|
| 2790 |
+
value, field
|
| 2791 |
+
)
|
| 2792 |
+
else:
|
| 2793 |
+
self.__call__ = lambda value, instance, field: self.converter(
|
| 2794 |
+
value, instance, field
|
| 2795 |
+
)
|
| 2796 |
+
|
| 2797 |
+
rt = ex.get_return_type()
|
| 2798 |
+
if rt is not None:
|
| 2799 |
+
self.__call__.__annotations__["return"] = rt
|
| 2800 |
+
|
| 2801 |
+
@staticmethod
|
| 2802 |
+
def _get_global_name(attr_name: str) -> str:
|
| 2803 |
+
"""
|
| 2804 |
+
Return the name that a converter for an attribute name *attr_name*
|
| 2805 |
+
would have.
|
| 2806 |
+
"""
|
| 2807 |
+
return f"__attr_converter_{attr_name}"
|
| 2808 |
+
|
| 2809 |
+
def _fmt_converter_call(self, attr_name: str, value_var: str) -> str:
|
| 2810 |
+
"""
|
| 2811 |
+
Return a string that calls the converter for an attribute name
|
| 2812 |
+
*attr_name* and the value in variable named *value_var* according to
|
| 2813 |
+
`self.takes_self` and `self.takes_field`.
|
| 2814 |
+
"""
|
| 2815 |
+
if not (self.takes_self or self.takes_field):
|
| 2816 |
+
return f"{self._get_global_name(attr_name)}({value_var})"
|
| 2817 |
+
|
| 2818 |
+
if self.takes_self and self.takes_field:
|
| 2819 |
+
return f"{self._get_global_name(attr_name)}({value_var}, self, attr_dict['{attr_name}'])"
|
| 2820 |
+
|
| 2821 |
+
if self.takes_self:
|
| 2822 |
+
return f"{self._get_global_name(attr_name)}({value_var}, self)"
|
| 2823 |
+
|
| 2824 |
+
return f"{self._get_global_name(attr_name)}({value_var}, attr_dict['{attr_name}'])"
|
| 2825 |
+
|
| 2826 |
+
def __getstate__(self):
|
| 2827 |
+
"""
|
| 2828 |
+
Return a dict containing only converter and takes_self -- the rest gets
|
| 2829 |
+
computed when loading.
|
| 2830 |
+
"""
|
| 2831 |
+
return {
|
| 2832 |
+
"converter": self.converter,
|
| 2833 |
+
"takes_self": self.takes_self,
|
| 2834 |
+
"takes_field": self.takes_field,
|
| 2835 |
+
}
|
| 2836 |
+
|
| 2837 |
+
def __setstate__(self, state):
|
| 2838 |
+
"""
|
| 2839 |
+
Load instance from state.
|
| 2840 |
+
"""
|
| 2841 |
+
self.__init__(**state)
|
| 2842 |
+
|
| 2843 |
+
|
| 2844 |
+
_f = [
|
| 2845 |
+
Attribute(
|
| 2846 |
+
name=name,
|
| 2847 |
+
default=NOTHING,
|
| 2848 |
+
validator=None,
|
| 2849 |
+
repr=True,
|
| 2850 |
+
cmp=None,
|
| 2851 |
+
eq=True,
|
| 2852 |
+
order=False,
|
| 2853 |
+
hash=True,
|
| 2854 |
+
init=True,
|
| 2855 |
+
inherited=False,
|
| 2856 |
+
)
|
| 2857 |
+
for name in ("converter", "takes_self", "takes_field")
|
| 2858 |
+
]
|
| 2859 |
+
|
| 2860 |
+
Converter = _add_hash(
|
| 2861 |
+
_add_eq(_add_repr(Converter, attrs=_f), attrs=_f), attrs=_f
|
| 2862 |
+
)
|
| 2863 |
+
|
| 2864 |
+
|
| 2865 |
+
def make_class(
|
| 2866 |
+
name, attrs, bases=(object,), class_body=None, **attributes_arguments
|
| 2867 |
+
):
|
| 2868 |
+
r"""
|
| 2869 |
+
A quick way to create a new class called *name* with *attrs*.
|
| 2870 |
+
|
| 2871 |
+
.. note::
|
| 2872 |
+
|
| 2873 |
+
``make_class()`` is a thin wrapper around `attr.s`, not `attrs.define`
|
| 2874 |
+
which means that it doesn't come with some of the improved defaults.
|
| 2875 |
+
|
| 2876 |
+
For example, if you want the same ``on_setattr`` behavior as in
|
| 2877 |
+
`attrs.define`, you have to pass the hooks yourself: ``make_class(...,
|
| 2878 |
+
on_setattr=setters.pipe(setters.convert, setters.validate)``
|
| 2879 |
+
|
| 2880 |
+
Args:
|
| 2881 |
+
name (str): The name for the new class.
|
| 2882 |
+
|
| 2883 |
+
attrs (list | dict):
|
| 2884 |
+
A list of names or a dictionary of mappings of names to `attr.ib`\
|
| 2885 |
+
s / `attrs.field`\ s.
|
| 2886 |
+
|
| 2887 |
+
The order is deduced from the order of the names or attributes
|
| 2888 |
+
inside *attrs*. Otherwise the order of the definition of the
|
| 2889 |
+
attributes is used.
|
| 2890 |
+
|
| 2891 |
+
bases (tuple[type, ...]): Classes that the new class will subclass.
|
| 2892 |
+
|
| 2893 |
+
class_body (dict):
|
| 2894 |
+
An optional dictionary of class attributes for the new class.
|
| 2895 |
+
|
| 2896 |
+
attributes_arguments: Passed unmodified to `attr.s`.
|
| 2897 |
+
|
| 2898 |
+
Returns:
|
| 2899 |
+
type: A new class with *attrs*.
|
| 2900 |
+
|
| 2901 |
+
.. versionadded:: 17.1.0 *bases*
|
| 2902 |
+
.. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained.
|
| 2903 |
+
.. versionchanged:: 23.2.0 *class_body*
|
| 2904 |
+
"""
|
| 2905 |
+
if isinstance(attrs, dict):
|
| 2906 |
+
cls_dict = attrs
|
| 2907 |
+
elif isinstance(attrs, (list, tuple)):
|
| 2908 |
+
cls_dict = {a: attrib() for a in attrs}
|
| 2909 |
+
else:
|
| 2910 |
+
msg = "attrs argument must be a dict or a list."
|
| 2911 |
+
raise TypeError(msg)
|
| 2912 |
+
|
| 2913 |
+
pre_init = cls_dict.pop("__attrs_pre_init__", None)
|
| 2914 |
+
post_init = cls_dict.pop("__attrs_post_init__", None)
|
| 2915 |
+
user_init = cls_dict.pop("__init__", None)
|
| 2916 |
+
|
| 2917 |
+
body = {}
|
| 2918 |
+
if class_body is not None:
|
| 2919 |
+
body.update(class_body)
|
| 2920 |
+
if pre_init is not None:
|
| 2921 |
+
body["__attrs_pre_init__"] = pre_init
|
| 2922 |
+
if post_init is not None:
|
| 2923 |
+
body["__attrs_post_init__"] = post_init
|
| 2924 |
+
if user_init is not None:
|
| 2925 |
+
body["__init__"] = user_init
|
| 2926 |
+
|
| 2927 |
+
type_ = types.new_class(name, bases, {}, lambda ns: ns.update(body))
|
| 2928 |
+
|
| 2929 |
+
# For pickling to work, the __module__ variable needs to be set to the
|
| 2930 |
+
# frame where the class is created. Bypass this step in environments where
|
| 2931 |
+
# sys._getframe is not defined (Jython for example) or sys._getframe is not
|
| 2932 |
+
# defined for arguments greater than 0 (IronPython).
|
| 2933 |
+
with contextlib.suppress(AttributeError, ValueError):
|
| 2934 |
+
type_.__module__ = sys._getframe(1).f_globals.get(
|
| 2935 |
+
"__name__", "__main__"
|
| 2936 |
+
)
|
| 2937 |
+
|
| 2938 |
+
# We do it here for proper warnings with meaningful stacklevel.
|
| 2939 |
+
cmp = attributes_arguments.pop("cmp", None)
|
| 2940 |
+
(
|
| 2941 |
+
attributes_arguments["eq"],
|
| 2942 |
+
attributes_arguments["order"],
|
| 2943 |
+
) = _determine_attrs_eq_order(
|
| 2944 |
+
cmp,
|
| 2945 |
+
attributes_arguments.get("eq"),
|
| 2946 |
+
attributes_arguments.get("order"),
|
| 2947 |
+
True,
|
| 2948 |
+
)
|
| 2949 |
+
|
| 2950 |
+
cls = _attrs(these=cls_dict, **attributes_arguments)(type_)
|
| 2951 |
+
# Only add type annotations now or "_attrs()" will complain:
|
| 2952 |
+
cls.__annotations__ = {
|
| 2953 |
+
k: v.type for k, v in cls_dict.items() if v.type is not None
|
| 2954 |
+
}
|
| 2955 |
+
return cls
|
| 2956 |
+
|
| 2957 |
+
|
| 2958 |
+
# These are required by within this module so we define them here and merely
|
| 2959 |
+
# import into .validators / .converters.
|
| 2960 |
+
|
| 2961 |
+
|
| 2962 |
+
@attrs(slots=True, unsafe_hash=True)
|
| 2963 |
+
class _AndValidator:
|
| 2964 |
+
"""
|
| 2965 |
+
Compose many validators to a single one.
|
| 2966 |
+
"""
|
| 2967 |
+
|
| 2968 |
+
_validators = attrib()
|
| 2969 |
+
|
| 2970 |
+
def __call__(self, inst, attr, value):
|
| 2971 |
+
for v in self._validators:
|
| 2972 |
+
v(inst, attr, value)
|
| 2973 |
+
|
| 2974 |
+
|
| 2975 |
+
def and_(*validators):
|
| 2976 |
+
"""
|
| 2977 |
+
A validator that composes multiple validators into one.
|
| 2978 |
+
|
| 2979 |
+
When called on a value, it runs all wrapped validators.
|
| 2980 |
+
|
| 2981 |
+
Args:
|
| 2982 |
+
validators (~collections.abc.Iterable[typing.Callable]):
|
| 2983 |
+
Arbitrary number of validators.
|
| 2984 |
+
|
| 2985 |
+
.. versionadded:: 17.1.0
|
| 2986 |
+
"""
|
| 2987 |
+
vals = []
|
| 2988 |
+
for validator in validators:
|
| 2989 |
+
vals.extend(
|
| 2990 |
+
validator._validators
|
| 2991 |
+
if isinstance(validator, _AndValidator)
|
| 2992 |
+
else [validator]
|
| 2993 |
+
)
|
| 2994 |
+
|
| 2995 |
+
return _AndValidator(tuple(vals))
|
| 2996 |
+
|
| 2997 |
+
|
| 2998 |
+
def pipe(*converters):
|
| 2999 |
+
"""
|
| 3000 |
+
A converter that composes multiple converters into one.
|
| 3001 |
+
|
| 3002 |
+
When called on a value, it runs all wrapped converters, returning the
|
| 3003 |
+
*last* value.
|
| 3004 |
+
|
| 3005 |
+
Type annotations will be inferred from the wrapped converters', if they
|
| 3006 |
+
have any.
|
| 3007 |
+
|
| 3008 |
+
converters (~collections.abc.Iterable[typing.Callable]):
|
| 3009 |
+
Arbitrary number of converters.
|
| 3010 |
+
|
| 3011 |
+
.. versionadded:: 20.1.0
|
| 3012 |
+
"""
|
| 3013 |
+
|
| 3014 |
+
return_instance = any(isinstance(c, Converter) for c in converters)
|
| 3015 |
+
|
| 3016 |
+
if return_instance:
|
| 3017 |
+
|
| 3018 |
+
def pipe_converter(val, inst, field):
|
| 3019 |
+
for c in converters:
|
| 3020 |
+
val = (
|
| 3021 |
+
c(val, inst, field) if isinstance(c, Converter) else c(val)
|
| 3022 |
+
)
|
| 3023 |
+
|
| 3024 |
+
return val
|
| 3025 |
+
|
| 3026 |
+
else:
|
| 3027 |
+
|
| 3028 |
+
def pipe_converter(val):
|
| 3029 |
+
for c in converters:
|
| 3030 |
+
val = c(val)
|
| 3031 |
+
|
| 3032 |
+
return val
|
| 3033 |
+
|
| 3034 |
+
if not converters:
|
| 3035 |
+
# If the converter list is empty, pipe_converter is the identity.
|
| 3036 |
+
A = typing.TypeVar("A")
|
| 3037 |
+
pipe_converter.__annotations__.update({"val": A, "return": A})
|
| 3038 |
+
else:
|
| 3039 |
+
# Get parameter type from first converter.
|
| 3040 |
+
t = _AnnotationExtractor(converters[0]).get_first_param_type()
|
| 3041 |
+
if t:
|
| 3042 |
+
pipe_converter.__annotations__["val"] = t
|
| 3043 |
+
|
| 3044 |
+
last = converters[-1]
|
| 3045 |
+
if not PY_3_11_PLUS and isinstance(last, Converter):
|
| 3046 |
+
last = last.__call__
|
| 3047 |
+
|
| 3048 |
+
# Get return type from last converter.
|
| 3049 |
+
rt = _AnnotationExtractor(last).get_return_type()
|
| 3050 |
+
if rt:
|
| 3051 |
+
pipe_converter.__annotations__["return"] = rt
|
| 3052 |
+
|
| 3053 |
+
if return_instance:
|
| 3054 |
+
return Converter(pipe_converter, takes_self=True, takes_field=True)
|
| 3055 |
+
return pipe_converter
|
.venv/lib/python3.11/site-packages/attr/_next_gen.py
ADDED
|
@@ -0,0 +1,623 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
from functools import partial
|
| 9 |
+
|
| 10 |
+
from . import setters
|
| 11 |
+
from ._funcs import asdict as _asdict
|
| 12 |
+
from ._funcs import astuple as _astuple
|
| 13 |
+
from ._make import (
|
| 14 |
+
_DEFAULT_ON_SETATTR,
|
| 15 |
+
NOTHING,
|
| 16 |
+
_frozen_setattrs,
|
| 17 |
+
attrib,
|
| 18 |
+
attrs,
|
| 19 |
+
)
|
| 20 |
+
from .exceptions import UnannotatedAttributeError
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def define(
|
| 24 |
+
maybe_cls=None,
|
| 25 |
+
*,
|
| 26 |
+
these=None,
|
| 27 |
+
repr=None,
|
| 28 |
+
unsafe_hash=None,
|
| 29 |
+
hash=None,
|
| 30 |
+
init=None,
|
| 31 |
+
slots=True,
|
| 32 |
+
frozen=False,
|
| 33 |
+
weakref_slot=True,
|
| 34 |
+
str=False,
|
| 35 |
+
auto_attribs=None,
|
| 36 |
+
kw_only=False,
|
| 37 |
+
cache_hash=False,
|
| 38 |
+
auto_exc=True,
|
| 39 |
+
eq=None,
|
| 40 |
+
order=False,
|
| 41 |
+
auto_detect=True,
|
| 42 |
+
getstate_setstate=None,
|
| 43 |
+
on_setattr=None,
|
| 44 |
+
field_transformer=None,
|
| 45 |
+
match_args=True,
|
| 46 |
+
):
|
| 47 |
+
r"""
|
| 48 |
+
A class decorator that adds :term:`dunder methods` according to
|
| 49 |
+
:term:`fields <field>` specified using :doc:`type annotations <types>`,
|
| 50 |
+
`field()` calls, or the *these* argument.
|
| 51 |
+
|
| 52 |
+
Since *attrs* patches or replaces an existing class, you cannot use
|
| 53 |
+
`object.__init_subclass__` with *attrs* classes, because it runs too early.
|
| 54 |
+
As a replacement, you can define ``__attrs_init_subclass__`` on your class.
|
| 55 |
+
It will be called by *attrs* classes that subclass it after they're
|
| 56 |
+
created. See also :ref:`init-subclass`.
|
| 57 |
+
|
| 58 |
+
Args:
|
| 59 |
+
slots (bool):
|
| 60 |
+
Create a :term:`slotted class <slotted classes>` that's more
|
| 61 |
+
memory-efficient. Slotted classes are generally superior to the
|
| 62 |
+
default dict classes, but have some gotchas you should know about,
|
| 63 |
+
so we encourage you to read the :term:`glossary entry <slotted
|
| 64 |
+
classes>`.
|
| 65 |
+
|
| 66 |
+
auto_detect (bool):
|
| 67 |
+
Instead of setting the *init*, *repr*, *eq*, and *hash* arguments
|
| 68 |
+
explicitly, assume they are set to True **unless any** of the
|
| 69 |
+
involved methods for one of the arguments is implemented in the
|
| 70 |
+
*current* class (meaning, it is *not* inherited from some base
|
| 71 |
+
class).
|
| 72 |
+
|
| 73 |
+
So, for example by implementing ``__eq__`` on a class yourself,
|
| 74 |
+
*attrs* will deduce ``eq=False`` and will create *neither*
|
| 75 |
+
``__eq__`` *nor* ``__ne__`` (but Python classes come with a
|
| 76 |
+
sensible ``__ne__`` by default, so it *should* be enough to only
|
| 77 |
+
implement ``__eq__`` in most cases).
|
| 78 |
+
|
| 79 |
+
Passing True or False` to *init*, *repr*, *eq*, or *hash*
|
| 80 |
+
overrides whatever *auto_detect* would determine.
|
| 81 |
+
|
| 82 |
+
auto_exc (bool):
|
| 83 |
+
If the class subclasses `BaseException` (which implicitly includes
|
| 84 |
+
any subclass of any exception), the following happens to behave
|
| 85 |
+
like a well-behaved Python exception class:
|
| 86 |
+
|
| 87 |
+
- the values for *eq*, *order*, and *hash* are ignored and the
|
| 88 |
+
instances compare and hash by the instance's ids [#]_ ,
|
| 89 |
+
- all attributes that are either passed into ``__init__`` or have a
|
| 90 |
+
default value are additionally available as a tuple in the
|
| 91 |
+
``args`` attribute,
|
| 92 |
+
- the value of *str* is ignored leaving ``__str__`` to base
|
| 93 |
+
classes.
|
| 94 |
+
|
| 95 |
+
.. [#]
|
| 96 |
+
Note that *attrs* will *not* remove existing implementations of
|
| 97 |
+
``__hash__`` or the equality methods. It just won't add own
|
| 98 |
+
ones.
|
| 99 |
+
|
| 100 |
+
on_setattr (~typing.Callable | list[~typing.Callable] | None | ~typing.Literal[attrs.setters.NO_OP]):
|
| 101 |
+
A callable that is run whenever the user attempts to set an
|
| 102 |
+
attribute (either by assignment like ``i.x = 42`` or by using
|
| 103 |
+
`setattr` like ``setattr(i, "x", 42)``). It receives the same
|
| 104 |
+
arguments as validators: the instance, the attribute that is being
|
| 105 |
+
modified, and the new value.
|
| 106 |
+
|
| 107 |
+
If no exception is raised, the attribute is set to the return value
|
| 108 |
+
of the callable.
|
| 109 |
+
|
| 110 |
+
If a list of callables is passed, they're automatically wrapped in
|
| 111 |
+
an `attrs.setters.pipe`.
|
| 112 |
+
|
| 113 |
+
If left None, the default behavior is to run converters and
|
| 114 |
+
validators whenever an attribute is set.
|
| 115 |
+
|
| 116 |
+
init (bool):
|
| 117 |
+
Create a ``__init__`` method that initializes the *attrs*
|
| 118 |
+
attributes. Leading underscores are stripped for the argument name,
|
| 119 |
+
unless an alias is set on the attribute.
|
| 120 |
+
|
| 121 |
+
.. seealso::
|
| 122 |
+
`init` shows advanced ways to customize the generated
|
| 123 |
+
``__init__`` method, including executing code before and after.
|
| 124 |
+
|
| 125 |
+
repr(bool):
|
| 126 |
+
Create a ``__repr__`` method with a human readable representation
|
| 127 |
+
of *attrs* attributes.
|
| 128 |
+
|
| 129 |
+
str (bool):
|
| 130 |
+
Create a ``__str__`` method that is identical to ``__repr__``. This
|
| 131 |
+
is usually not necessary except for `Exception`\ s.
|
| 132 |
+
|
| 133 |
+
eq (bool | None):
|
| 134 |
+
If True or None (default), add ``__eq__`` and ``__ne__`` methods
|
| 135 |
+
that check two instances for equality.
|
| 136 |
+
|
| 137 |
+
.. seealso::
|
| 138 |
+
`comparison` describes how to customize the comparison behavior
|
| 139 |
+
going as far comparing NumPy arrays.
|
| 140 |
+
|
| 141 |
+
order (bool | None):
|
| 142 |
+
If True, add ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__``
|
| 143 |
+
methods that behave like *eq* above and allow instances to be
|
| 144 |
+
ordered.
|
| 145 |
+
|
| 146 |
+
They compare the instances as if they were tuples of their *attrs*
|
| 147 |
+
attributes if and only if the types of both classes are
|
| 148 |
+
*identical*.
|
| 149 |
+
|
| 150 |
+
If `None` mirror value of *eq*.
|
| 151 |
+
|
| 152 |
+
.. seealso:: `comparison`
|
| 153 |
+
|
| 154 |
+
unsafe_hash (bool | None):
|
| 155 |
+
If None (default), the ``__hash__`` method is generated according
|
| 156 |
+
how *eq* and *frozen* are set.
|
| 157 |
+
|
| 158 |
+
1. If *both* are True, *attrs* will generate a ``__hash__`` for
|
| 159 |
+
you.
|
| 160 |
+
2. If *eq* is True and *frozen* is False, ``__hash__`` will be set
|
| 161 |
+
to None, marking it unhashable (which it is).
|
| 162 |
+
3. If *eq* is False, ``__hash__`` will be left untouched meaning
|
| 163 |
+
the ``__hash__`` method of the base class will be used. If the
|
| 164 |
+
base class is `object`, this means it will fall back to id-based
|
| 165 |
+
hashing.
|
| 166 |
+
|
| 167 |
+
Although not recommended, you can decide for yourself and force
|
| 168 |
+
*attrs* to create one (for example, if the class is immutable even
|
| 169 |
+
though you didn't freeze it programmatically) by passing True or
|
| 170 |
+
not. Both of these cases are rather special and should be used
|
| 171 |
+
carefully.
|
| 172 |
+
|
| 173 |
+
.. seealso::
|
| 174 |
+
|
| 175 |
+
- Our documentation on `hashing`,
|
| 176 |
+
- Python's documentation on `object.__hash__`,
|
| 177 |
+
- and the `GitHub issue that led to the default \ behavior
|
| 178 |
+
<https://github.com/python-attrs/attrs/issues/136>`_ for more
|
| 179 |
+
details.
|
| 180 |
+
|
| 181 |
+
hash (bool | None):
|
| 182 |
+
Deprecated alias for *unsafe_hash*. *unsafe_hash* takes precedence.
|
| 183 |
+
|
| 184 |
+
cache_hash (bool):
|
| 185 |
+
Ensure that the object's hash code is computed only once and stored
|
| 186 |
+
on the object. If this is set to True, hashing must be either
|
| 187 |
+
explicitly or implicitly enabled for this class. If the hash code
|
| 188 |
+
is cached, avoid any reassignments of fields involved in hash code
|
| 189 |
+
computation or mutations of the objects those fields point to after
|
| 190 |
+
object creation. If such changes occur, the behavior of the
|
| 191 |
+
object's hash code is undefined.
|
| 192 |
+
|
| 193 |
+
frozen (bool):
|
| 194 |
+
Make instances immutable after initialization. If someone attempts
|
| 195 |
+
to modify a frozen instance, `attrs.exceptions.FrozenInstanceError`
|
| 196 |
+
is raised.
|
| 197 |
+
|
| 198 |
+
.. note::
|
| 199 |
+
|
| 200 |
+
1. This is achieved by installing a custom ``__setattr__``
|
| 201 |
+
method on your class, so you can't implement your own.
|
| 202 |
+
|
| 203 |
+
2. True immutability is impossible in Python.
|
| 204 |
+
|
| 205 |
+
3. This *does* have a minor a runtime performance `impact
|
| 206 |
+
<how-frozen>` when initializing new instances. In other
|
| 207 |
+
words: ``__init__`` is slightly slower with ``frozen=True``.
|
| 208 |
+
|
| 209 |
+
4. If a class is frozen, you cannot modify ``self`` in
|
| 210 |
+
``__attrs_post_init__`` or a self-written ``__init__``. You
|
| 211 |
+
can circumvent that limitation by using
|
| 212 |
+
``object.__setattr__(self, "attribute_name", value)``.
|
| 213 |
+
|
| 214 |
+
5. Subclasses of a frozen class are frozen too.
|
| 215 |
+
|
| 216 |
+
kw_only (bool):
|
| 217 |
+
Make all attributes keyword-only in the generated ``__init__`` (if
|
| 218 |
+
*init* is False, this parameter is ignored).
|
| 219 |
+
|
| 220 |
+
weakref_slot (bool):
|
| 221 |
+
Make instances weak-referenceable. This has no effect unless
|
| 222 |
+
*slots* is True.
|
| 223 |
+
|
| 224 |
+
field_transformer (~typing.Callable | None):
|
| 225 |
+
A function that is called with the original class object and all
|
| 226 |
+
fields right before *attrs* finalizes the class. You can use this,
|
| 227 |
+
for example, to automatically add converters or validators to
|
| 228 |
+
fields based on their types.
|
| 229 |
+
|
| 230 |
+
.. seealso:: `transform-fields`
|
| 231 |
+
|
| 232 |
+
match_args (bool):
|
| 233 |
+
If True (default), set ``__match_args__`` on the class to support
|
| 234 |
+
:pep:`634` (*Structural Pattern Matching*). It is a tuple of all
|
| 235 |
+
non-keyword-only ``__init__`` parameter names on Python 3.10 and
|
| 236 |
+
later. Ignored on older Python versions.
|
| 237 |
+
|
| 238 |
+
collect_by_mro (bool):
|
| 239 |
+
If True, *attrs* collects attributes from base classes correctly
|
| 240 |
+
according to the `method resolution order
|
| 241 |
+
<https://docs.python.org/3/howto/mro.html>`_. If False, *attrs*
|
| 242 |
+
will mimic the (wrong) behavior of `dataclasses` and :pep:`681`.
|
| 243 |
+
|
| 244 |
+
See also `issue #428
|
| 245 |
+
<https://github.com/python-attrs/attrs/issues/428>`_.
|
| 246 |
+
|
| 247 |
+
getstate_setstate (bool | None):
|
| 248 |
+
.. note::
|
| 249 |
+
|
| 250 |
+
This is usually only interesting for slotted classes and you
|
| 251 |
+
should probably just set *auto_detect* to True.
|
| 252 |
+
|
| 253 |
+
If True, ``__getstate__`` and ``__setstate__`` are generated and
|
| 254 |
+
attached to the class. This is necessary for slotted classes to be
|
| 255 |
+
pickleable. If left None, it's True by default for slotted classes
|
| 256 |
+
and False for dict classes.
|
| 257 |
+
|
| 258 |
+
If *auto_detect* is True, and *getstate_setstate* is left None, and
|
| 259 |
+
**either** ``__getstate__`` or ``__setstate__`` is detected
|
| 260 |
+
directly on the class (meaning: not inherited), it is set to False
|
| 261 |
+
(this is usually what you want).
|
| 262 |
+
|
| 263 |
+
auto_attribs (bool | None):
|
| 264 |
+
If True, look at type annotations to determine which attributes to
|
| 265 |
+
use, like `dataclasses`. If False, it will only look for explicit
|
| 266 |
+
:func:`field` class attributes, like classic *attrs*.
|
| 267 |
+
|
| 268 |
+
If left None, it will guess:
|
| 269 |
+
|
| 270 |
+
1. If any attributes are annotated and no unannotated
|
| 271 |
+
`attrs.field`\ s are found, it assumes *auto_attribs=True*.
|
| 272 |
+
2. Otherwise it assumes *auto_attribs=False* and tries to collect
|
| 273 |
+
`attrs.field`\ s.
|
| 274 |
+
|
| 275 |
+
If *attrs* decides to look at type annotations, **all** fields
|
| 276 |
+
**must** be annotated. If *attrs* encounters a field that is set to
|
| 277 |
+
a :func:`field` / `attr.ib` but lacks a type annotation, an
|
| 278 |
+
`attrs.exceptions.UnannotatedAttributeError` is raised. Use
|
| 279 |
+
``field_name: typing.Any = field(...)`` if you don't want to set a
|
| 280 |
+
type.
|
| 281 |
+
|
| 282 |
+
.. warning::
|
| 283 |
+
|
| 284 |
+
For features that use the attribute name to create decorators
|
| 285 |
+
(for example, :ref:`validators <validators>`), you still *must*
|
| 286 |
+
assign :func:`field` / `attr.ib` to them. Otherwise Python will
|
| 287 |
+
either not find the name or try to use the default value to
|
| 288 |
+
call, for example, ``validator`` on it.
|
| 289 |
+
|
| 290 |
+
Attributes annotated as `typing.ClassVar`, and attributes that are
|
| 291 |
+
neither annotated nor set to an `field()` are **ignored**.
|
| 292 |
+
|
| 293 |
+
these (dict[str, object]):
|
| 294 |
+
A dictionary of name to the (private) return value of `field()`
|
| 295 |
+
mappings. This is useful to avoid the definition of your attributes
|
| 296 |
+
within the class body because you can't (for example, if you want
|
| 297 |
+
to add ``__repr__`` methods to Django models) or don't want to.
|
| 298 |
+
|
| 299 |
+
If *these* is not `None`, *attrs* will *not* search the class body
|
| 300 |
+
for attributes and will *not* remove any attributes from it.
|
| 301 |
+
|
| 302 |
+
The order is deduced from the order of the attributes inside
|
| 303 |
+
*these*.
|
| 304 |
+
|
| 305 |
+
Arguably, this is a rather obscure feature.
|
| 306 |
+
|
| 307 |
+
.. versionadded:: 20.1.0
|
| 308 |
+
.. versionchanged:: 21.3.0 Converters are also run ``on_setattr``.
|
| 309 |
+
.. versionadded:: 22.2.0
|
| 310 |
+
*unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
|
| 311 |
+
.. versionchanged:: 24.1.0
|
| 312 |
+
Instances are not compared as tuples of attributes anymore, but using a
|
| 313 |
+
big ``and`` condition. This is faster and has more correct behavior for
|
| 314 |
+
uncomparable values like `math.nan`.
|
| 315 |
+
.. versionadded:: 24.1.0
|
| 316 |
+
If a class has an *inherited* classmethod called
|
| 317 |
+
``__attrs_init_subclass__``, it is executed after the class is created.
|
| 318 |
+
.. deprecated:: 24.1.0 *hash* is deprecated in favor of *unsafe_hash*.
|
| 319 |
+
.. versionadded:: 24.3.0
|
| 320 |
+
Unless already present, a ``__replace__`` method is automatically
|
| 321 |
+
created for `copy.replace` (Python 3.13+ only).
|
| 322 |
+
|
| 323 |
+
.. note::
|
| 324 |
+
|
| 325 |
+
The main differences to the classic `attr.s` are:
|
| 326 |
+
|
| 327 |
+
- Automatically detect whether or not *auto_attribs* should be `True`
|
| 328 |
+
(c.f. *auto_attribs* parameter).
|
| 329 |
+
- Converters and validators run when attributes are set by default --
|
| 330 |
+
if *frozen* is `False`.
|
| 331 |
+
- *slots=True*
|
| 332 |
+
|
| 333 |
+
Usually, this has only upsides and few visible effects in everyday
|
| 334 |
+
programming. But it *can* lead to some surprising behaviors, so
|
| 335 |
+
please make sure to read :term:`slotted classes`.
|
| 336 |
+
|
| 337 |
+
- *auto_exc=True*
|
| 338 |
+
- *auto_detect=True*
|
| 339 |
+
- *order=False*
|
| 340 |
+
- Some options that were only relevant on Python 2 or were kept around
|
| 341 |
+
for backwards-compatibility have been removed.
|
| 342 |
+
|
| 343 |
+
"""
|
| 344 |
+
|
| 345 |
+
def do_it(cls, auto_attribs):
|
| 346 |
+
return attrs(
|
| 347 |
+
maybe_cls=cls,
|
| 348 |
+
these=these,
|
| 349 |
+
repr=repr,
|
| 350 |
+
hash=hash,
|
| 351 |
+
unsafe_hash=unsafe_hash,
|
| 352 |
+
init=init,
|
| 353 |
+
slots=slots,
|
| 354 |
+
frozen=frozen,
|
| 355 |
+
weakref_slot=weakref_slot,
|
| 356 |
+
str=str,
|
| 357 |
+
auto_attribs=auto_attribs,
|
| 358 |
+
kw_only=kw_only,
|
| 359 |
+
cache_hash=cache_hash,
|
| 360 |
+
auto_exc=auto_exc,
|
| 361 |
+
eq=eq,
|
| 362 |
+
order=order,
|
| 363 |
+
auto_detect=auto_detect,
|
| 364 |
+
collect_by_mro=True,
|
| 365 |
+
getstate_setstate=getstate_setstate,
|
| 366 |
+
on_setattr=on_setattr,
|
| 367 |
+
field_transformer=field_transformer,
|
| 368 |
+
match_args=match_args,
|
| 369 |
+
)
|
| 370 |
+
|
| 371 |
+
def wrap(cls):
|
| 372 |
+
"""
|
| 373 |
+
Making this a wrapper ensures this code runs during class creation.
|
| 374 |
+
|
| 375 |
+
We also ensure that frozen-ness of classes is inherited.
|
| 376 |
+
"""
|
| 377 |
+
nonlocal frozen, on_setattr
|
| 378 |
+
|
| 379 |
+
had_on_setattr = on_setattr not in (None, setters.NO_OP)
|
| 380 |
+
|
| 381 |
+
# By default, mutable classes convert & validate on setattr.
|
| 382 |
+
if frozen is False and on_setattr is None:
|
| 383 |
+
on_setattr = _DEFAULT_ON_SETATTR
|
| 384 |
+
|
| 385 |
+
# However, if we subclass a frozen class, we inherit the immutability
|
| 386 |
+
# and disable on_setattr.
|
| 387 |
+
for base_cls in cls.__bases__:
|
| 388 |
+
if base_cls.__setattr__ is _frozen_setattrs:
|
| 389 |
+
if had_on_setattr:
|
| 390 |
+
msg = "Frozen classes can't use on_setattr (frozen-ness was inherited)."
|
| 391 |
+
raise ValueError(msg)
|
| 392 |
+
|
| 393 |
+
on_setattr = setters.NO_OP
|
| 394 |
+
break
|
| 395 |
+
|
| 396 |
+
if auto_attribs is not None:
|
| 397 |
+
return do_it(cls, auto_attribs)
|
| 398 |
+
|
| 399 |
+
try:
|
| 400 |
+
return do_it(cls, True)
|
| 401 |
+
except UnannotatedAttributeError:
|
| 402 |
+
return do_it(cls, False)
|
| 403 |
+
|
| 404 |
+
# maybe_cls's type depends on the usage of the decorator. It's a class
|
| 405 |
+
# if it's used as `@attrs` but `None` if used as `@attrs()`.
|
| 406 |
+
if maybe_cls is None:
|
| 407 |
+
return wrap
|
| 408 |
+
|
| 409 |
+
return wrap(maybe_cls)
|
| 410 |
+
|
| 411 |
+
|
| 412 |
+
mutable = define
|
| 413 |
+
frozen = partial(define, frozen=True, on_setattr=None)
|
| 414 |
+
|
| 415 |
+
|
| 416 |
+
def field(
|
| 417 |
+
*,
|
| 418 |
+
default=NOTHING,
|
| 419 |
+
validator=None,
|
| 420 |
+
repr=True,
|
| 421 |
+
hash=None,
|
| 422 |
+
init=True,
|
| 423 |
+
metadata=None,
|
| 424 |
+
type=None,
|
| 425 |
+
converter=None,
|
| 426 |
+
factory=None,
|
| 427 |
+
kw_only=False,
|
| 428 |
+
eq=None,
|
| 429 |
+
order=None,
|
| 430 |
+
on_setattr=None,
|
| 431 |
+
alias=None,
|
| 432 |
+
):
|
| 433 |
+
"""
|
| 434 |
+
Create a new :term:`field` / :term:`attribute` on a class.
|
| 435 |
+
|
| 436 |
+
.. warning::
|
| 437 |
+
|
| 438 |
+
Does **nothing** unless the class is also decorated with
|
| 439 |
+
`attrs.define` (or similar)!
|
| 440 |
+
|
| 441 |
+
Args:
|
| 442 |
+
default:
|
| 443 |
+
A value that is used if an *attrs*-generated ``__init__`` is used
|
| 444 |
+
and no value is passed while instantiating or the attribute is
|
| 445 |
+
excluded using ``init=False``.
|
| 446 |
+
|
| 447 |
+
If the value is an instance of `attrs.Factory`, its callable will
|
| 448 |
+
be used to construct a new value (useful for mutable data types
|
| 449 |
+
like lists or dicts).
|
| 450 |
+
|
| 451 |
+
If a default is not set (or set manually to `attrs.NOTHING`), a
|
| 452 |
+
value *must* be supplied when instantiating; otherwise a
|
| 453 |
+
`TypeError` will be raised.
|
| 454 |
+
|
| 455 |
+
.. seealso:: `defaults`
|
| 456 |
+
|
| 457 |
+
factory (~typing.Callable):
|
| 458 |
+
Syntactic sugar for ``default=attr.Factory(factory)``.
|
| 459 |
+
|
| 460 |
+
validator (~typing.Callable | list[~typing.Callable]):
|
| 461 |
+
Callable that is called by *attrs*-generated ``__init__`` methods
|
| 462 |
+
after the instance has been initialized. They receive the
|
| 463 |
+
initialized instance, the :func:`~attrs.Attribute`, and the passed
|
| 464 |
+
value.
|
| 465 |
+
|
| 466 |
+
The return value is *not* inspected so the validator has to throw
|
| 467 |
+
an exception itself.
|
| 468 |
+
|
| 469 |
+
If a `list` is passed, its items are treated as validators and must
|
| 470 |
+
all pass.
|
| 471 |
+
|
| 472 |
+
Validators can be globally disabled and re-enabled using
|
| 473 |
+
`attrs.validators.get_disabled` / `attrs.validators.set_disabled`.
|
| 474 |
+
|
| 475 |
+
The validator can also be set using decorator notation as shown
|
| 476 |
+
below.
|
| 477 |
+
|
| 478 |
+
.. seealso:: :ref:`validators`
|
| 479 |
+
|
| 480 |
+
repr (bool | ~typing.Callable):
|
| 481 |
+
Include this attribute in the generated ``__repr__`` method. If
|
| 482 |
+
True, include the attribute; if False, omit it. By default, the
|
| 483 |
+
built-in ``repr()`` function is used. To override how the attribute
|
| 484 |
+
value is formatted, pass a ``callable`` that takes a single value
|
| 485 |
+
and returns a string. Note that the resulting string is used as-is,
|
| 486 |
+
which means it will be used directly *instead* of calling
|
| 487 |
+
``repr()`` (the default).
|
| 488 |
+
|
| 489 |
+
eq (bool | ~typing.Callable):
|
| 490 |
+
If True (default), include this attribute in the generated
|
| 491 |
+
``__eq__`` and ``__ne__`` methods that check two instances for
|
| 492 |
+
equality. To override how the attribute value is compared, pass a
|
| 493 |
+
callable that takes a single value and returns the value to be
|
| 494 |
+
compared.
|
| 495 |
+
|
| 496 |
+
.. seealso:: `comparison`
|
| 497 |
+
|
| 498 |
+
order (bool | ~typing.Callable):
|
| 499 |
+
If True (default), include this attributes in the generated
|
| 500 |
+
``__lt__``, ``__le__``, ``__gt__`` and ``__ge__`` methods. To
|
| 501 |
+
override how the attribute value is ordered, pass a callable that
|
| 502 |
+
takes a single value and returns the value to be ordered.
|
| 503 |
+
|
| 504 |
+
.. seealso:: `comparison`
|
| 505 |
+
|
| 506 |
+
hash (bool | None):
|
| 507 |
+
Include this attribute in the generated ``__hash__`` method. If
|
| 508 |
+
None (default), mirror *eq*'s value. This is the correct behavior
|
| 509 |
+
according the Python spec. Setting this value to anything else
|
| 510 |
+
than None is *discouraged*.
|
| 511 |
+
|
| 512 |
+
.. seealso:: `hashing`
|
| 513 |
+
|
| 514 |
+
init (bool):
|
| 515 |
+
Include this attribute in the generated ``__init__`` method.
|
| 516 |
+
|
| 517 |
+
It is possible to set this to False and set a default value. In
|
| 518 |
+
that case this attributed is unconditionally initialized with the
|
| 519 |
+
specified default value or factory.
|
| 520 |
+
|
| 521 |
+
.. seealso:: `init`
|
| 522 |
+
|
| 523 |
+
converter (typing.Callable | Converter):
|
| 524 |
+
A callable that is called by *attrs*-generated ``__init__`` methods
|
| 525 |
+
to convert attribute's value to the desired format.
|
| 526 |
+
|
| 527 |
+
If a vanilla callable is passed, it is given the passed-in value as
|
| 528 |
+
the only positional argument. It is possible to receive additional
|
| 529 |
+
arguments by wrapping the callable in a `Converter`.
|
| 530 |
+
|
| 531 |
+
Either way, the returned value will be used as the new value of the
|
| 532 |
+
attribute. The value is converted before being passed to the
|
| 533 |
+
validator, if any.
|
| 534 |
+
|
| 535 |
+
.. seealso:: :ref:`converters`
|
| 536 |
+
|
| 537 |
+
metadata (dict | None):
|
| 538 |
+
An arbitrary mapping, to be used by third-party code.
|
| 539 |
+
|
| 540 |
+
.. seealso:: `extending-metadata`.
|
| 541 |
+
|
| 542 |
+
type (type):
|
| 543 |
+
The type of the attribute. Nowadays, the preferred method to
|
| 544 |
+
specify the type is using a variable annotation (see :pep:`526`).
|
| 545 |
+
This argument is provided for backwards-compatibility and for usage
|
| 546 |
+
with `make_class`. Regardless of the approach used, the type will
|
| 547 |
+
be stored on ``Attribute.type``.
|
| 548 |
+
|
| 549 |
+
Please note that *attrs* doesn't do anything with this metadata by
|
| 550 |
+
itself. You can use it as part of your own code or for `static type
|
| 551 |
+
checking <types>`.
|
| 552 |
+
|
| 553 |
+
kw_only (bool):
|
| 554 |
+
Make this attribute keyword-only in the generated ``__init__`` (if
|
| 555 |
+
``init`` is False, this parameter is ignored).
|
| 556 |
+
|
| 557 |
+
on_setattr (~typing.Callable | list[~typing.Callable] | None | ~typing.Literal[attrs.setters.NO_OP]):
|
| 558 |
+
Allows to overwrite the *on_setattr* setting from `attr.s`. If left
|
| 559 |
+
None, the *on_setattr* value from `attr.s` is used. Set to
|
| 560 |
+
`attrs.setters.NO_OP` to run **no** `setattr` hooks for this
|
| 561 |
+
attribute -- regardless of the setting in `define()`.
|
| 562 |
+
|
| 563 |
+
alias (str | None):
|
| 564 |
+
Override this attribute's parameter name in the generated
|
| 565 |
+
``__init__`` method. If left None, default to ``name`` stripped
|
| 566 |
+
of leading underscores. See `private-attributes`.
|
| 567 |
+
|
| 568 |
+
.. versionadded:: 20.1.0
|
| 569 |
+
.. versionchanged:: 21.1.0
|
| 570 |
+
*eq*, *order*, and *cmp* also accept a custom callable
|
| 571 |
+
.. versionadded:: 22.2.0 *alias*
|
| 572 |
+
.. versionadded:: 23.1.0
|
| 573 |
+
The *type* parameter has been re-added; mostly for `attrs.make_class`.
|
| 574 |
+
Please note that type checkers ignore this metadata.
|
| 575 |
+
|
| 576 |
+
.. seealso::
|
| 577 |
+
|
| 578 |
+
`attr.ib`
|
| 579 |
+
"""
|
| 580 |
+
return attrib(
|
| 581 |
+
default=default,
|
| 582 |
+
validator=validator,
|
| 583 |
+
repr=repr,
|
| 584 |
+
hash=hash,
|
| 585 |
+
init=init,
|
| 586 |
+
metadata=metadata,
|
| 587 |
+
type=type,
|
| 588 |
+
converter=converter,
|
| 589 |
+
factory=factory,
|
| 590 |
+
kw_only=kw_only,
|
| 591 |
+
eq=eq,
|
| 592 |
+
order=order,
|
| 593 |
+
on_setattr=on_setattr,
|
| 594 |
+
alias=alias,
|
| 595 |
+
)
|
| 596 |
+
|
| 597 |
+
|
| 598 |
+
def asdict(inst, *, recurse=True, filter=None, value_serializer=None):
|
| 599 |
+
"""
|
| 600 |
+
Same as `attr.asdict`, except that collections types are always retained
|
| 601 |
+
and dict is always used as *dict_factory*.
|
| 602 |
+
|
| 603 |
+
.. versionadded:: 21.3.0
|
| 604 |
+
"""
|
| 605 |
+
return _asdict(
|
| 606 |
+
inst=inst,
|
| 607 |
+
recurse=recurse,
|
| 608 |
+
filter=filter,
|
| 609 |
+
value_serializer=value_serializer,
|
| 610 |
+
retain_collection_types=True,
|
| 611 |
+
)
|
| 612 |
+
|
| 613 |
+
|
| 614 |
+
def astuple(inst, *, recurse=True, filter=None):
|
| 615 |
+
"""
|
| 616 |
+
Same as `attr.astuple`, except that collections types are always retained
|
| 617 |
+
and `tuple` is always used as the *tuple_factory*.
|
| 618 |
+
|
| 619 |
+
.. versionadded:: 21.3.0
|
| 620 |
+
"""
|
| 621 |
+
return _astuple(
|
| 622 |
+
inst=inst, recurse=recurse, filter=filter, retain_collection_types=True
|
| 623 |
+
)
|
.venv/lib/python3.11/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.11/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.11/site-packages/attr/converters.py
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: MIT
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
Commonly useful converters.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import typing
|
| 8 |
+
|
| 9 |
+
from ._compat import _AnnotationExtractor
|
| 10 |
+
from ._make import NOTHING, Converter, Factory, pipe
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
__all__ = [
|
| 14 |
+
"default_if_none",
|
| 15 |
+
"optional",
|
| 16 |
+
"pipe",
|
| 17 |
+
"to_bool",
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def optional(converter):
|
| 22 |
+
"""
|
| 23 |
+
A converter that allows an attribute to be optional. An optional attribute
|
| 24 |
+
is one which can be set to `None`.
|
| 25 |
+
|
| 26 |
+
Type annotations will be inferred from the wrapped converter's, if it has
|
| 27 |
+
any.
|
| 28 |
+
|
| 29 |
+
Args:
|
| 30 |
+
converter (typing.Callable):
|
| 31 |
+
the converter that is used for non-`None` values.
|
| 32 |
+
|
| 33 |
+
.. versionadded:: 17.1.0
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
if isinstance(converter, Converter):
|
| 37 |
+
|
| 38 |
+
def optional_converter(val, inst, field):
|
| 39 |
+
if val is None:
|
| 40 |
+
return None
|
| 41 |
+
return converter(val, inst, field)
|
| 42 |
+
|
| 43 |
+
else:
|
| 44 |
+
|
| 45 |
+
def optional_converter(val):
|
| 46 |
+
if val is None:
|
| 47 |
+
return None
|
| 48 |
+
return converter(val)
|
| 49 |
+
|
| 50 |
+
xtr = _AnnotationExtractor(converter)
|
| 51 |
+
|
| 52 |
+
t = xtr.get_first_param_type()
|
| 53 |
+
if t:
|
| 54 |
+
optional_converter.__annotations__["val"] = typing.Optional[t]
|
| 55 |
+
|
| 56 |
+
rt = xtr.get_return_type()
|
| 57 |
+
if rt:
|
| 58 |
+
optional_converter.__annotations__["return"] = typing.Optional[rt]
|
| 59 |
+
|
| 60 |
+
if isinstance(converter, Converter):
|
| 61 |
+
return Converter(optional_converter, takes_self=True, takes_field=True)
|
| 62 |
+
|
| 63 |
+
return optional_converter
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def default_if_none(default=NOTHING, factory=None):
|
| 67 |
+
"""
|
| 68 |
+
A converter that allows to replace `None` values by *default* or the result
|
| 69 |
+
of *factory*.
|
| 70 |
+
|
| 71 |
+
Args:
|
| 72 |
+
default:
|
| 73 |
+
Value to be used if `None` is passed. Passing an instance of
|
| 74 |
+
`attrs.Factory` is supported, however the ``takes_self`` option is
|
| 75 |
+
*not*.
|
| 76 |
+
|
| 77 |
+
factory (typing.Callable):
|
| 78 |
+
A callable that takes no parameters whose result is used if `None`
|
| 79 |
+
is passed.
|
| 80 |
+
|
| 81 |
+
Raises:
|
| 82 |
+
TypeError: If **neither** *default* or *factory* is passed.
|
| 83 |
+
|
| 84 |
+
TypeError: If **both** *default* and *factory* are passed.
|
| 85 |
+
|
| 86 |
+
ValueError:
|
| 87 |
+
If an instance of `attrs.Factory` is passed with
|
| 88 |
+
``takes_self=True``.
|
| 89 |
+
|
| 90 |
+
.. versionadded:: 18.2.0
|
| 91 |
+
"""
|
| 92 |
+
if default is NOTHING and factory is None:
|
| 93 |
+
msg = "Must pass either `default` or `factory`."
|
| 94 |
+
raise TypeError(msg)
|
| 95 |
+
|
| 96 |
+
if default is not NOTHING and factory is not None:
|
| 97 |
+
msg = "Must pass either `default` or `factory` but not both."
|
| 98 |
+
raise TypeError(msg)
|
| 99 |
+
|
| 100 |
+
if factory is not None:
|
| 101 |
+
default = Factory(factory)
|
| 102 |
+
|
| 103 |
+
if isinstance(default, Factory):
|
| 104 |
+
if default.takes_self:
|
| 105 |
+
msg = "`takes_self` is not supported by default_if_none."
|
| 106 |
+
raise ValueError(msg)
|
| 107 |
+
|
| 108 |
+
def default_if_none_converter(val):
|
| 109 |
+
if val is not None:
|
| 110 |
+
return val
|
| 111 |
+
|
| 112 |
+
return default.factory()
|
| 113 |
+
|
| 114 |
+
else:
|
| 115 |
+
|
| 116 |
+
def default_if_none_converter(val):
|
| 117 |
+
if val is not None:
|
| 118 |
+
return val
|
| 119 |
+
|
| 120 |
+
return default
|
| 121 |
+
|
| 122 |
+
return default_if_none_converter
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def to_bool(val):
|
| 126 |
+
"""
|
| 127 |
+
Convert "boolean" strings (for example, from environment variables) to real
|
| 128 |
+
booleans.
|
| 129 |
+
|
| 130 |
+
Values mapping to `True`:
|
| 131 |
+
|
| 132 |
+
- ``True``
|
| 133 |
+
- ``"true"`` / ``"t"``
|
| 134 |
+
- ``"yes"`` / ``"y"``
|
| 135 |
+
- ``"on"``
|
| 136 |
+
- ``"1"``
|
| 137 |
+
- ``1``
|
| 138 |
+
|
| 139 |
+
Values mapping to `False`:
|
| 140 |
+
|
| 141 |
+
- ``False``
|
| 142 |
+
- ``"false"`` / ``"f"``
|
| 143 |
+
- ``"no"`` / ``"n"``
|
| 144 |
+
- ``"off"``
|
| 145 |
+
- ``"0"``
|
| 146 |
+
- ``0``
|
| 147 |
+
|
| 148 |
+
Raises:
|
| 149 |
+
ValueError: For any other value.
|
| 150 |
+
|
| 151 |
+
.. versionadded:: 21.3.0
|
| 152 |
+
"""
|
| 153 |
+
if isinstance(val, str):
|
| 154 |
+
val = val.lower()
|
| 155 |
+
|
| 156 |
+
if val in (True, "true", "t", "yes", "y", "on", "1", 1):
|
| 157 |
+
return True
|
| 158 |
+
if val in (False, "false", "f", "no", "n", "off", "0", 0):
|
| 159 |
+
return False
|
| 160 |
+
|
| 161 |
+
msg = f"Cannot convert value to bool: {val!r}"
|
| 162 |
+
raise ValueError(msg)
|
.venv/lib/python3.11/site-packages/attr/converters.pyi
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Callable, Any, overload
|
| 2 |
+
|
| 3 |
+
from attrs import _ConverterType, _CallableConverterType
|
| 4 |
+
|
| 5 |
+
@overload
|
| 6 |
+
def pipe(*validators: _CallableConverterType) -> _CallableConverterType: ...
|
| 7 |
+
@overload
|
| 8 |
+
def pipe(*validators: _ConverterType) -> _ConverterType: ...
|
| 9 |
+
@overload
|
| 10 |
+
def optional(converter: _CallableConverterType) -> _CallableConverterType: ...
|
| 11 |
+
@overload
|
| 12 |
+
def optional(converter: _ConverterType) -> _ConverterType: ...
|
| 13 |
+
@overload
|
| 14 |
+
def default_if_none(default: Any) -> _CallableConverterType: ...
|
| 15 |
+
@overload
|
| 16 |
+
def default_if_none(
|
| 17 |
+
*, factory: Callable[[], Any]
|
| 18 |
+
) -> _CallableConverterType: ...
|
| 19 |
+
def to_bool(val: str | int | bool) -> bool: ...
|
.venv/lib/python3.11/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.11/site-packages/attr/filters.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: MIT
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
Commonly useful filters for `attrs.asdict` and `attrs.astuple`.
|
| 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 |
+
Create a filter that only allows *what*.
|
| 24 |
+
|
| 25 |
+
Args:
|
| 26 |
+
what (list[type, str, attrs.Attribute]):
|
| 27 |
+
What to include. Can be a type, a name, or an attribute.
|
| 28 |
+
|
| 29 |
+
Returns:
|
| 30 |
+
Callable:
|
| 31 |
+
A callable that can be passed to `attrs.asdict`'s and
|
| 32 |
+
`attrs.astuple`'s *filter* argument.
|
| 33 |
+
|
| 34 |
+
.. versionchanged:: 23.1.0 Accept strings with field names.
|
| 35 |
+
"""
|
| 36 |
+
cls, names, attrs = _split_what(what)
|
| 37 |
+
|
| 38 |
+
def include_(attribute, value):
|
| 39 |
+
return (
|
| 40 |
+
value.__class__ in cls
|
| 41 |
+
or attribute.name in names
|
| 42 |
+
or attribute in attrs
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
return include_
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def exclude(*what):
|
| 49 |
+
"""
|
| 50 |
+
Create a filter that does **not** allow *what*.
|
| 51 |
+
|
| 52 |
+
Args:
|
| 53 |
+
what (list[type, str, attrs.Attribute]):
|
| 54 |
+
What to exclude. Can be a type, a name, or an attribute.
|
| 55 |
+
|
| 56 |
+
Returns:
|
| 57 |
+
Callable:
|
| 58 |
+
A callable that can be passed to `attrs.asdict`'s and
|
| 59 |
+
`attrs.astuple`'s *filter* argument.
|
| 60 |
+
|
| 61 |
+
.. versionchanged:: 23.3.0 Accept field name string as input argument
|
| 62 |
+
"""
|
| 63 |
+
cls, names, attrs = _split_what(what)
|
| 64 |
+
|
| 65 |
+
def exclude_(attribute, value):
|
| 66 |
+
return not (
|
| 67 |
+
value.__class__ in cls
|
| 68 |
+
or attribute.name in names
|
| 69 |
+
or attribute in attrs
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
return exclude_
|
.venv/lib/python3.11/site-packages/attr/filters.pyi
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
|
| 3 |
+
from . import Attribute, _FilterType
|
| 4 |
+
|
| 5 |
+
def include(*what: type | str | Attribute[Any]) -> _FilterType[Any]: ...
|
| 6 |
+
def exclude(*what: type | str | Attribute[Any]) -> _FilterType[Any]: ...
|
.venv/lib/python3.11/site-packages/attr/py.typed
ADDED
|
File without changes
|
.venv/lib/python3.11/site-packages/attr/setters.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: MIT
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
Commonly used hooks for on_setattr.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from . import _config
|
| 8 |
+
from .exceptions import FrozenAttributeError
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def pipe(*setters):
|
| 12 |
+
"""
|
| 13 |
+
Run all *setters* and return the return value of the last one.
|
| 14 |
+
|
| 15 |
+
.. versionadded:: 20.1.0
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
def wrapped_pipe(instance, attrib, new_value):
|
| 19 |
+
rv = new_value
|
| 20 |
+
|
| 21 |
+
for setter in setters:
|
| 22 |
+
rv = setter(instance, attrib, rv)
|
| 23 |
+
|
| 24 |
+
return rv
|
| 25 |
+
|
| 26 |
+
return wrapped_pipe
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def frozen(_, __, ___):
|
| 30 |
+
"""
|
| 31 |
+
Prevent an attribute to be modified.
|
| 32 |
+
|
| 33 |
+
.. versionadded:: 20.1.0
|
| 34 |
+
"""
|
| 35 |
+
raise FrozenAttributeError
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def validate(instance, attrib, new_value):
|
| 39 |
+
"""
|
| 40 |
+
Run *attrib*'s validator on *new_value* if it has one.
|
| 41 |
+
|
| 42 |
+
.. versionadded:: 20.1.0
|
| 43 |
+
"""
|
| 44 |
+
if _config._run_validators is False:
|
| 45 |
+
return new_value
|
| 46 |
+
|
| 47 |
+
v = attrib.validator
|
| 48 |
+
if not v:
|
| 49 |
+
return new_value
|
| 50 |
+
|
| 51 |
+
v(instance, attrib, new_value)
|
| 52 |
+
|
| 53 |
+
return new_value
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def convert(instance, attrib, new_value):
|
| 57 |
+
"""
|
| 58 |
+
Run *attrib*'s converter -- if it has one -- on *new_value* and return the
|
| 59 |
+
result.
|
| 60 |
+
|
| 61 |
+
.. versionadded:: 20.1.0
|
| 62 |
+
"""
|
| 63 |
+
c = attrib.converter
|
| 64 |
+
if c:
|
| 65 |
+
# This can be removed once we drop 3.8 and use attrs.Converter instead.
|
| 66 |
+
from ._make import Converter
|
| 67 |
+
|
| 68 |
+
if not isinstance(c, Converter):
|
| 69 |
+
return c(new_value)
|
| 70 |
+
|
| 71 |
+
return c(new_value, instance, attrib)
|
| 72 |
+
|
| 73 |
+
return new_value
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
# Sentinel for disabling class-wide *on_setattr* hooks for certain attributes.
|
| 77 |
+
# Sphinx's autodata stopped working, so the docstring is inlined in the API
|
| 78 |
+
# docs.
|
| 79 |
+
NO_OP = object()
|
.venv/lib/python3.11/site-packages/attr/setters.pyi
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, NewType, NoReturn, TypeVar
|
| 2 |
+
|
| 3 |
+
from . import Attribute
|
| 4 |
+
from attrs import _OnSetAttrType
|
| 5 |
+
|
| 6 |
+
_T = TypeVar("_T")
|
| 7 |
+
|
| 8 |
+
def frozen(
|
| 9 |
+
instance: Any, attribute: Attribute[Any], new_value: Any
|
| 10 |
+
) -> NoReturn: ...
|
| 11 |
+
def pipe(*setters: _OnSetAttrType) -> _OnSetAttrType: ...
|
| 12 |
+
def validate(instance: Any, attribute: Attribute[_T], new_value: _T) -> _T: ...
|
| 13 |
+
|
| 14 |
+
# convert is allowed to return Any, because they can be chained using pipe.
|
| 15 |
+
def convert(
|
| 16 |
+
instance: Any, attribute: Attribute[Any], new_value: Any
|
| 17 |
+
) -> Any: ...
|
| 18 |
+
|
| 19 |
+
_NoOpType = NewType("_NoOpType", object)
|
| 20 |
+
NO_OP: _NoOpType
|
.venv/lib/python3.11/site-packages/attr/validators.py
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: MIT
|
| 2 |
+
|
| 3 |
+
"""
|
| 4 |
+
Commonly useful validators.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import operator
|
| 8 |
+
import re
|
| 9 |
+
|
| 10 |
+
from contextlib import contextmanager
|
| 11 |
+
from re import Pattern
|
| 12 |
+
|
| 13 |
+
from ._config import get_run_validators, set_run_validators
|
| 14 |
+
from ._make import _AndValidator, and_, attrib, attrs
|
| 15 |
+
from .converters import default_if_none
|
| 16 |
+
from .exceptions import NotCallableError
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
__all__ = [
|
| 20 |
+
"and_",
|
| 21 |
+
"deep_iterable",
|
| 22 |
+
"deep_mapping",
|
| 23 |
+
"disabled",
|
| 24 |
+
"ge",
|
| 25 |
+
"get_disabled",
|
| 26 |
+
"gt",
|
| 27 |
+
"in_",
|
| 28 |
+
"instance_of",
|
| 29 |
+
"is_callable",
|
| 30 |
+
"le",
|
| 31 |
+
"lt",
|
| 32 |
+
"matches_re",
|
| 33 |
+
"max_len",
|
| 34 |
+
"min_len",
|
| 35 |
+
"not_",
|
| 36 |
+
"optional",
|
| 37 |
+
"or_",
|
| 38 |
+
"set_disabled",
|
| 39 |
+
]
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def set_disabled(disabled):
|
| 43 |
+
"""
|
| 44 |
+
Globally disable or enable running validators.
|
| 45 |
+
|
| 46 |
+
By default, they are run.
|
| 47 |
+
|
| 48 |
+
Args:
|
| 49 |
+
disabled (bool): If `True`, disable running all validators.
|
| 50 |
+
|
| 51 |
+
.. warning::
|
| 52 |
+
|
| 53 |
+
This function is not thread-safe!
|
| 54 |
+
|
| 55 |
+
.. versionadded:: 21.3.0
|
| 56 |
+
"""
|
| 57 |
+
set_run_validators(not disabled)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def get_disabled():
|
| 61 |
+
"""
|
| 62 |
+
Return a bool indicating whether validators are currently disabled or not.
|
| 63 |
+
|
| 64 |
+
Returns:
|
| 65 |
+
bool:`True` if validators are currently disabled.
|
| 66 |
+
|
| 67 |
+
.. versionadded:: 21.3.0
|
| 68 |
+
"""
|
| 69 |
+
return not get_run_validators()
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
@contextmanager
|
| 73 |
+
def disabled():
|
| 74 |
+
"""
|
| 75 |
+
Context manager that disables running validators within its context.
|
| 76 |
+
|
| 77 |
+
.. warning::
|
| 78 |
+
|
| 79 |
+
This context manager is not thread-safe!
|
| 80 |
+
|
| 81 |
+
.. versionadded:: 21.3.0
|
| 82 |
+
"""
|
| 83 |
+
set_run_validators(False)
|
| 84 |
+
try:
|
| 85 |
+
yield
|
| 86 |
+
finally:
|
| 87 |
+
set_run_validators(True)
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 91 |
+
class _InstanceOfValidator:
|
| 92 |
+
type = attrib()
|
| 93 |
+
|
| 94 |
+
def __call__(self, inst, attr, value):
|
| 95 |
+
"""
|
| 96 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 97 |
+
"""
|
| 98 |
+
if not isinstance(value, self.type):
|
| 99 |
+
msg = f"'{attr.name}' must be {self.type!r} (got {value!r} that is a {value.__class__!r})."
|
| 100 |
+
raise TypeError(
|
| 101 |
+
msg,
|
| 102 |
+
attr,
|
| 103 |
+
self.type,
|
| 104 |
+
value,
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
def __repr__(self):
|
| 108 |
+
return f"<instance_of validator for type {self.type!r}>"
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def instance_of(type):
|
| 112 |
+
"""
|
| 113 |
+
A validator that raises a `TypeError` if the initializer is called with a
|
| 114 |
+
wrong type for this particular attribute (checks are performed using
|
| 115 |
+
`isinstance` therefore it's also valid to pass a tuple of types).
|
| 116 |
+
|
| 117 |
+
Args:
|
| 118 |
+
type (type | tuple[type]): The type to check for.
|
| 119 |
+
|
| 120 |
+
Raises:
|
| 121 |
+
TypeError:
|
| 122 |
+
With a human readable error message, the attribute (of type
|
| 123 |
+
`attrs.Attribute`), the expected type, and the value it got.
|
| 124 |
+
"""
|
| 125 |
+
return _InstanceOfValidator(type)
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
@attrs(repr=False, frozen=True, slots=True)
|
| 129 |
+
class _MatchesReValidator:
|
| 130 |
+
pattern = attrib()
|
| 131 |
+
match_func = attrib()
|
| 132 |
+
|
| 133 |
+
def __call__(self, inst, attr, value):
|
| 134 |
+
"""
|
| 135 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 136 |
+
"""
|
| 137 |
+
if not self.match_func(value):
|
| 138 |
+
msg = f"'{attr.name}' must match regex {self.pattern.pattern!r} ({value!r} doesn't)"
|
| 139 |
+
raise ValueError(
|
| 140 |
+
msg,
|
| 141 |
+
attr,
|
| 142 |
+
self.pattern,
|
| 143 |
+
value,
|
| 144 |
+
)
|
| 145 |
+
|
| 146 |
+
def __repr__(self):
|
| 147 |
+
return f"<matches_re validator for pattern {self.pattern!r}>"
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def matches_re(regex, flags=0, func=None):
|
| 151 |
+
r"""
|
| 152 |
+
A validator that raises `ValueError` if the initializer is called with a
|
| 153 |
+
string that doesn't match *regex*.
|
| 154 |
+
|
| 155 |
+
Args:
|
| 156 |
+
regex (str, re.Pattern):
|
| 157 |
+
A regex string or precompiled pattern to match against
|
| 158 |
+
|
| 159 |
+
flags (int):
|
| 160 |
+
Flags that will be passed to the underlying re function (default 0)
|
| 161 |
+
|
| 162 |
+
func (typing.Callable):
|
| 163 |
+
Which underlying `re` function to call. Valid options are
|
| 164 |
+
`re.fullmatch`, `re.search`, and `re.match`; the default `None`
|
| 165 |
+
means `re.fullmatch`. For performance reasons, the pattern is
|
| 166 |
+
always precompiled using `re.compile`.
|
| 167 |
+
|
| 168 |
+
.. versionadded:: 19.2.0
|
| 169 |
+
.. versionchanged:: 21.3.0 *regex* can be a pre-compiled pattern.
|
| 170 |
+
"""
|
| 171 |
+
valid_funcs = (re.fullmatch, None, re.search, re.match)
|
| 172 |
+
if func not in valid_funcs:
|
| 173 |
+
msg = "'func' must be one of {}.".format(
|
| 174 |
+
", ".join(
|
| 175 |
+
sorted((e and e.__name__) or "None" for e in set(valid_funcs))
|
| 176 |
+
)
|
| 177 |
+
)
|
| 178 |
+
raise ValueError(msg)
|
| 179 |
+
|
| 180 |
+
if isinstance(regex, Pattern):
|
| 181 |
+
if flags:
|
| 182 |
+
msg = "'flags' can only be used with a string pattern; pass flags to re.compile() instead"
|
| 183 |
+
raise TypeError(msg)
|
| 184 |
+
pattern = regex
|
| 185 |
+
else:
|
| 186 |
+
pattern = re.compile(regex, flags)
|
| 187 |
+
|
| 188 |
+
if func is re.match:
|
| 189 |
+
match_func = pattern.match
|
| 190 |
+
elif func is re.search:
|
| 191 |
+
match_func = pattern.search
|
| 192 |
+
else:
|
| 193 |
+
match_func = pattern.fullmatch
|
| 194 |
+
|
| 195 |
+
return _MatchesReValidator(pattern, match_func)
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 199 |
+
class _OptionalValidator:
|
| 200 |
+
validator = attrib()
|
| 201 |
+
|
| 202 |
+
def __call__(self, inst, attr, value):
|
| 203 |
+
if value is None:
|
| 204 |
+
return
|
| 205 |
+
|
| 206 |
+
self.validator(inst, attr, value)
|
| 207 |
+
|
| 208 |
+
def __repr__(self):
|
| 209 |
+
return f"<optional validator for {self.validator!r} or None>"
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
def optional(validator):
|
| 213 |
+
"""
|
| 214 |
+
A validator that makes an attribute optional. An optional attribute is one
|
| 215 |
+
which can be set to `None` in addition to satisfying the requirements of
|
| 216 |
+
the sub-validator.
|
| 217 |
+
|
| 218 |
+
Args:
|
| 219 |
+
validator
|
| 220 |
+
(typing.Callable | tuple[typing.Callable] | list[typing.Callable]):
|
| 221 |
+
A validator (or validators) that is used for non-`None` values.
|
| 222 |
+
|
| 223 |
+
.. versionadded:: 15.1.0
|
| 224 |
+
.. versionchanged:: 17.1.0 *validator* can be a list of validators.
|
| 225 |
+
.. versionchanged:: 23.1.0 *validator* can also be a tuple of validators.
|
| 226 |
+
"""
|
| 227 |
+
if isinstance(validator, (list, tuple)):
|
| 228 |
+
return _OptionalValidator(_AndValidator(validator))
|
| 229 |
+
|
| 230 |
+
return _OptionalValidator(validator)
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 234 |
+
class _InValidator:
|
| 235 |
+
options = attrib()
|
| 236 |
+
_original_options = attrib(hash=False)
|
| 237 |
+
|
| 238 |
+
def __call__(self, inst, attr, value):
|
| 239 |
+
try:
|
| 240 |
+
in_options = value in self.options
|
| 241 |
+
except TypeError: # e.g. `1 in "abc"`
|
| 242 |
+
in_options = False
|
| 243 |
+
|
| 244 |
+
if not in_options:
|
| 245 |
+
msg = f"'{attr.name}' must be in {self._original_options!r} (got {value!r})"
|
| 246 |
+
raise ValueError(
|
| 247 |
+
msg,
|
| 248 |
+
attr,
|
| 249 |
+
self._original_options,
|
| 250 |
+
value,
|
| 251 |
+
)
|
| 252 |
+
|
| 253 |
+
def __repr__(self):
|
| 254 |
+
return f"<in_ validator with options {self._original_options!r}>"
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
def in_(options):
|
| 258 |
+
"""
|
| 259 |
+
A validator that raises a `ValueError` if the initializer is called with a
|
| 260 |
+
value that does not belong in the *options* provided.
|
| 261 |
+
|
| 262 |
+
The check is performed using ``value in options``, so *options* has to
|
| 263 |
+
support that operation.
|
| 264 |
+
|
| 265 |
+
To keep the validator hashable, dicts, lists, and sets are transparently
|
| 266 |
+
transformed into a `tuple`.
|
| 267 |
+
|
| 268 |
+
Args:
|
| 269 |
+
options: Allowed options.
|
| 270 |
+
|
| 271 |
+
Raises:
|
| 272 |
+
ValueError:
|
| 273 |
+
With a human readable error message, the attribute (of type
|
| 274 |
+
`attrs.Attribute`), the expected options, and the value it got.
|
| 275 |
+
|
| 276 |
+
.. versionadded:: 17.1.0
|
| 277 |
+
.. versionchanged:: 22.1.0
|
| 278 |
+
The ValueError was incomplete until now and only contained the human
|
| 279 |
+
readable error message. Now it contains all the information that has
|
| 280 |
+
been promised since 17.1.0.
|
| 281 |
+
.. versionchanged:: 24.1.0
|
| 282 |
+
*options* that are a list, dict, or a set are now transformed into a
|
| 283 |
+
tuple to keep the validator hashable.
|
| 284 |
+
"""
|
| 285 |
+
repr_options = options
|
| 286 |
+
if isinstance(options, (list, dict, set)):
|
| 287 |
+
options = tuple(options)
|
| 288 |
+
|
| 289 |
+
return _InValidator(options, repr_options)
|
| 290 |
+
|
| 291 |
+
|
| 292 |
+
@attrs(repr=False, slots=False, unsafe_hash=True)
|
| 293 |
+
class _IsCallableValidator:
|
| 294 |
+
def __call__(self, inst, attr, value):
|
| 295 |
+
"""
|
| 296 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 297 |
+
"""
|
| 298 |
+
if not callable(value):
|
| 299 |
+
message = (
|
| 300 |
+
"'{name}' must be callable "
|
| 301 |
+
"(got {value!r} that is a {actual!r})."
|
| 302 |
+
)
|
| 303 |
+
raise NotCallableError(
|
| 304 |
+
msg=message.format(
|
| 305 |
+
name=attr.name, value=value, actual=value.__class__
|
| 306 |
+
),
|
| 307 |
+
value=value,
|
| 308 |
+
)
|
| 309 |
+
|
| 310 |
+
def __repr__(self):
|
| 311 |
+
return "<is_callable validator>"
|
| 312 |
+
|
| 313 |
+
|
| 314 |
+
def is_callable():
|
| 315 |
+
"""
|
| 316 |
+
A validator that raises a `attrs.exceptions.NotCallableError` if the
|
| 317 |
+
initializer is called with a value for this particular attribute that is
|
| 318 |
+
not callable.
|
| 319 |
+
|
| 320 |
+
.. versionadded:: 19.1.0
|
| 321 |
+
|
| 322 |
+
Raises:
|
| 323 |
+
attrs.exceptions.NotCallableError:
|
| 324 |
+
With a human readable error message containing the attribute
|
| 325 |
+
(`attrs.Attribute`) name, and the value it got.
|
| 326 |
+
"""
|
| 327 |
+
return _IsCallableValidator()
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 331 |
+
class _DeepIterable:
|
| 332 |
+
member_validator = attrib(validator=is_callable())
|
| 333 |
+
iterable_validator = attrib(
|
| 334 |
+
default=None, validator=optional(is_callable())
|
| 335 |
+
)
|
| 336 |
+
|
| 337 |
+
def __call__(self, inst, attr, value):
|
| 338 |
+
"""
|
| 339 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 340 |
+
"""
|
| 341 |
+
if self.iterable_validator is not None:
|
| 342 |
+
self.iterable_validator(inst, attr, value)
|
| 343 |
+
|
| 344 |
+
for member in value:
|
| 345 |
+
self.member_validator(inst, attr, member)
|
| 346 |
+
|
| 347 |
+
def __repr__(self):
|
| 348 |
+
iterable_identifier = (
|
| 349 |
+
""
|
| 350 |
+
if self.iterable_validator is None
|
| 351 |
+
else f" {self.iterable_validator!r}"
|
| 352 |
+
)
|
| 353 |
+
return (
|
| 354 |
+
f"<deep_iterable validator for{iterable_identifier}"
|
| 355 |
+
f" iterables of {self.member_validator!r}>"
|
| 356 |
+
)
|
| 357 |
+
|
| 358 |
+
|
| 359 |
+
def deep_iterable(member_validator, iterable_validator=None):
|
| 360 |
+
"""
|
| 361 |
+
A validator that performs deep validation of an iterable.
|
| 362 |
+
|
| 363 |
+
Args:
|
| 364 |
+
member_validator: Validator to apply to iterable members.
|
| 365 |
+
|
| 366 |
+
iterable_validator:
|
| 367 |
+
Validator to apply to iterable itself (optional).
|
| 368 |
+
|
| 369 |
+
Raises
|
| 370 |
+
TypeError: if any sub-validators fail
|
| 371 |
+
|
| 372 |
+
.. versionadded:: 19.1.0
|
| 373 |
+
"""
|
| 374 |
+
if isinstance(member_validator, (list, tuple)):
|
| 375 |
+
member_validator = and_(*member_validator)
|
| 376 |
+
return _DeepIterable(member_validator, iterable_validator)
|
| 377 |
+
|
| 378 |
+
|
| 379 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 380 |
+
class _DeepMapping:
|
| 381 |
+
key_validator = attrib(validator=is_callable())
|
| 382 |
+
value_validator = attrib(validator=is_callable())
|
| 383 |
+
mapping_validator = attrib(default=None, validator=optional(is_callable()))
|
| 384 |
+
|
| 385 |
+
def __call__(self, inst, attr, value):
|
| 386 |
+
"""
|
| 387 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 388 |
+
"""
|
| 389 |
+
if self.mapping_validator is not None:
|
| 390 |
+
self.mapping_validator(inst, attr, value)
|
| 391 |
+
|
| 392 |
+
for key in value:
|
| 393 |
+
self.key_validator(inst, attr, key)
|
| 394 |
+
self.value_validator(inst, attr, value[key])
|
| 395 |
+
|
| 396 |
+
def __repr__(self):
|
| 397 |
+
return f"<deep_mapping validator for objects mapping {self.key_validator!r} to {self.value_validator!r}>"
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
def deep_mapping(key_validator, value_validator, mapping_validator=None):
|
| 401 |
+
"""
|
| 402 |
+
A validator that performs deep validation of a dictionary.
|
| 403 |
+
|
| 404 |
+
Args:
|
| 405 |
+
key_validator: Validator to apply to dictionary keys.
|
| 406 |
+
|
| 407 |
+
value_validator: Validator to apply to dictionary values.
|
| 408 |
+
|
| 409 |
+
mapping_validator:
|
| 410 |
+
Validator to apply to top-level mapping attribute (optional).
|
| 411 |
+
|
| 412 |
+
.. versionadded:: 19.1.0
|
| 413 |
+
|
| 414 |
+
Raises:
|
| 415 |
+
TypeError: if any sub-validators fail
|
| 416 |
+
"""
|
| 417 |
+
return _DeepMapping(key_validator, value_validator, mapping_validator)
|
| 418 |
+
|
| 419 |
+
|
| 420 |
+
@attrs(repr=False, frozen=True, slots=True)
|
| 421 |
+
class _NumberValidator:
|
| 422 |
+
bound = attrib()
|
| 423 |
+
compare_op = attrib()
|
| 424 |
+
compare_func = attrib()
|
| 425 |
+
|
| 426 |
+
def __call__(self, inst, attr, value):
|
| 427 |
+
"""
|
| 428 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 429 |
+
"""
|
| 430 |
+
if not self.compare_func(value, self.bound):
|
| 431 |
+
msg = f"'{attr.name}' must be {self.compare_op} {self.bound}: {value}"
|
| 432 |
+
raise ValueError(msg)
|
| 433 |
+
|
| 434 |
+
def __repr__(self):
|
| 435 |
+
return f"<Validator for x {self.compare_op} {self.bound}>"
|
| 436 |
+
|
| 437 |
+
|
| 438 |
+
def lt(val):
|
| 439 |
+
"""
|
| 440 |
+
A validator that raises `ValueError` if the initializer is called with a
|
| 441 |
+
number larger or equal to *val*.
|
| 442 |
+
|
| 443 |
+
The validator uses `operator.lt` to compare the values.
|
| 444 |
+
|
| 445 |
+
Args:
|
| 446 |
+
val: Exclusive upper bound for values.
|
| 447 |
+
|
| 448 |
+
.. versionadded:: 21.3.0
|
| 449 |
+
"""
|
| 450 |
+
return _NumberValidator(val, "<", operator.lt)
|
| 451 |
+
|
| 452 |
+
|
| 453 |
+
def le(val):
|
| 454 |
+
"""
|
| 455 |
+
A validator that raises `ValueError` if the initializer is called with a
|
| 456 |
+
number greater than *val*.
|
| 457 |
+
|
| 458 |
+
The validator uses `operator.le` to compare the values.
|
| 459 |
+
|
| 460 |
+
Args:
|
| 461 |
+
val: Inclusive upper bound for values.
|
| 462 |
+
|
| 463 |
+
.. versionadded:: 21.3.0
|
| 464 |
+
"""
|
| 465 |
+
return _NumberValidator(val, "<=", operator.le)
|
| 466 |
+
|
| 467 |
+
|
| 468 |
+
def ge(val):
|
| 469 |
+
"""
|
| 470 |
+
A validator that raises `ValueError` if the initializer is called with a
|
| 471 |
+
number smaller than *val*.
|
| 472 |
+
|
| 473 |
+
The validator uses `operator.ge` to compare the values.
|
| 474 |
+
|
| 475 |
+
Args:
|
| 476 |
+
val: Inclusive lower bound for values
|
| 477 |
+
|
| 478 |
+
.. versionadded:: 21.3.0
|
| 479 |
+
"""
|
| 480 |
+
return _NumberValidator(val, ">=", operator.ge)
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
def gt(val):
|
| 484 |
+
"""
|
| 485 |
+
A validator that raises `ValueError` if the initializer is called with a
|
| 486 |
+
number smaller or equal to *val*.
|
| 487 |
+
|
| 488 |
+
The validator uses `operator.ge` to compare the values.
|
| 489 |
+
|
| 490 |
+
Args:
|
| 491 |
+
val: Exclusive lower bound for values
|
| 492 |
+
|
| 493 |
+
.. versionadded:: 21.3.0
|
| 494 |
+
"""
|
| 495 |
+
return _NumberValidator(val, ">", operator.gt)
|
| 496 |
+
|
| 497 |
+
|
| 498 |
+
@attrs(repr=False, frozen=True, slots=True)
|
| 499 |
+
class _MaxLengthValidator:
|
| 500 |
+
max_length = attrib()
|
| 501 |
+
|
| 502 |
+
def __call__(self, inst, attr, value):
|
| 503 |
+
"""
|
| 504 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 505 |
+
"""
|
| 506 |
+
if len(value) > self.max_length:
|
| 507 |
+
msg = f"Length of '{attr.name}' must be <= {self.max_length}: {len(value)}"
|
| 508 |
+
raise ValueError(msg)
|
| 509 |
+
|
| 510 |
+
def __repr__(self):
|
| 511 |
+
return f"<max_len validator for {self.max_length}>"
|
| 512 |
+
|
| 513 |
+
|
| 514 |
+
def max_len(length):
|
| 515 |
+
"""
|
| 516 |
+
A validator that raises `ValueError` if the initializer is called
|
| 517 |
+
with a string or iterable that is longer than *length*.
|
| 518 |
+
|
| 519 |
+
Args:
|
| 520 |
+
length (int): Maximum length of the string or iterable
|
| 521 |
+
|
| 522 |
+
.. versionadded:: 21.3.0
|
| 523 |
+
"""
|
| 524 |
+
return _MaxLengthValidator(length)
|
| 525 |
+
|
| 526 |
+
|
| 527 |
+
@attrs(repr=False, frozen=True, slots=True)
|
| 528 |
+
class _MinLengthValidator:
|
| 529 |
+
min_length = attrib()
|
| 530 |
+
|
| 531 |
+
def __call__(self, inst, attr, value):
|
| 532 |
+
"""
|
| 533 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 534 |
+
"""
|
| 535 |
+
if len(value) < self.min_length:
|
| 536 |
+
msg = f"Length of '{attr.name}' must be >= {self.min_length}: {len(value)}"
|
| 537 |
+
raise ValueError(msg)
|
| 538 |
+
|
| 539 |
+
def __repr__(self):
|
| 540 |
+
return f"<min_len validator for {self.min_length}>"
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
def min_len(length):
|
| 544 |
+
"""
|
| 545 |
+
A validator that raises `ValueError` if the initializer is called
|
| 546 |
+
with a string or iterable that is shorter than *length*.
|
| 547 |
+
|
| 548 |
+
Args:
|
| 549 |
+
length (int): Minimum length of the string or iterable
|
| 550 |
+
|
| 551 |
+
.. versionadded:: 22.1.0
|
| 552 |
+
"""
|
| 553 |
+
return _MinLengthValidator(length)
|
| 554 |
+
|
| 555 |
+
|
| 556 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 557 |
+
class _SubclassOfValidator:
|
| 558 |
+
type = attrib()
|
| 559 |
+
|
| 560 |
+
def __call__(self, inst, attr, value):
|
| 561 |
+
"""
|
| 562 |
+
We use a callable class to be able to change the ``__repr__``.
|
| 563 |
+
"""
|
| 564 |
+
if not issubclass(value, self.type):
|
| 565 |
+
msg = f"'{attr.name}' must be a subclass of {self.type!r} (got {value!r})."
|
| 566 |
+
raise TypeError(
|
| 567 |
+
msg,
|
| 568 |
+
attr,
|
| 569 |
+
self.type,
|
| 570 |
+
value,
|
| 571 |
+
)
|
| 572 |
+
|
| 573 |
+
def __repr__(self):
|
| 574 |
+
return f"<subclass_of validator for type {self.type!r}>"
|
| 575 |
+
|
| 576 |
+
|
| 577 |
+
def _subclass_of(type):
|
| 578 |
+
"""
|
| 579 |
+
A validator that raises a `TypeError` if the initializer is called with a
|
| 580 |
+
wrong type for this particular attribute (checks are performed using
|
| 581 |
+
`issubclass` therefore it's also valid to pass a tuple of types).
|
| 582 |
+
|
| 583 |
+
Args:
|
| 584 |
+
type (type | tuple[type, ...]): The type(s) to check for.
|
| 585 |
+
|
| 586 |
+
Raises:
|
| 587 |
+
TypeError:
|
| 588 |
+
With a human readable error message, the attribute (of type
|
| 589 |
+
`attrs.Attribute`), the expected type, and the value it got.
|
| 590 |
+
"""
|
| 591 |
+
return _SubclassOfValidator(type)
|
| 592 |
+
|
| 593 |
+
|
| 594 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 595 |
+
class _NotValidator:
|
| 596 |
+
validator = attrib()
|
| 597 |
+
msg = attrib(
|
| 598 |
+
converter=default_if_none(
|
| 599 |
+
"not_ validator child '{validator!r}' "
|
| 600 |
+
"did not raise a captured error"
|
| 601 |
+
)
|
| 602 |
+
)
|
| 603 |
+
exc_types = attrib(
|
| 604 |
+
validator=deep_iterable(
|
| 605 |
+
member_validator=_subclass_of(Exception),
|
| 606 |
+
iterable_validator=instance_of(tuple),
|
| 607 |
+
),
|
| 608 |
+
)
|
| 609 |
+
|
| 610 |
+
def __call__(self, inst, attr, value):
|
| 611 |
+
try:
|
| 612 |
+
self.validator(inst, attr, value)
|
| 613 |
+
except self.exc_types:
|
| 614 |
+
pass # suppress error to invert validity
|
| 615 |
+
else:
|
| 616 |
+
raise ValueError(
|
| 617 |
+
self.msg.format(
|
| 618 |
+
validator=self.validator,
|
| 619 |
+
exc_types=self.exc_types,
|
| 620 |
+
),
|
| 621 |
+
attr,
|
| 622 |
+
self.validator,
|
| 623 |
+
value,
|
| 624 |
+
self.exc_types,
|
| 625 |
+
)
|
| 626 |
+
|
| 627 |
+
def __repr__(self):
|
| 628 |
+
return f"<not_ validator wrapping {self.validator!r}, capturing {self.exc_types!r}>"
|
| 629 |
+
|
| 630 |
+
|
| 631 |
+
def not_(validator, *, msg=None, exc_types=(ValueError, TypeError)):
|
| 632 |
+
"""
|
| 633 |
+
A validator that wraps and logically 'inverts' the validator passed to it.
|
| 634 |
+
It will raise a `ValueError` if the provided validator *doesn't* raise a
|
| 635 |
+
`ValueError` or `TypeError` (by default), and will suppress the exception
|
| 636 |
+
if the provided validator *does*.
|
| 637 |
+
|
| 638 |
+
Intended to be used with existing validators to compose logic without
|
| 639 |
+
needing to create inverted variants, for example, ``not_(in_(...))``.
|
| 640 |
+
|
| 641 |
+
Args:
|
| 642 |
+
validator: A validator to be logically inverted.
|
| 643 |
+
|
| 644 |
+
msg (str):
|
| 645 |
+
Message to raise if validator fails. Formatted with keys
|
| 646 |
+
``exc_types`` and ``validator``.
|
| 647 |
+
|
| 648 |
+
exc_types (tuple[type, ...]):
|
| 649 |
+
Exception type(s) to capture. Other types raised by child
|
| 650 |
+
validators will not be intercepted and pass through.
|
| 651 |
+
|
| 652 |
+
Raises:
|
| 653 |
+
ValueError:
|
| 654 |
+
With a human readable error message, the attribute (of type
|
| 655 |
+
`attrs.Attribute`), the validator that failed to raise an
|
| 656 |
+
exception, the value it got, and the expected exception types.
|
| 657 |
+
|
| 658 |
+
.. versionadded:: 22.2.0
|
| 659 |
+
"""
|
| 660 |
+
try:
|
| 661 |
+
exc_types = tuple(exc_types)
|
| 662 |
+
except TypeError:
|
| 663 |
+
exc_types = (exc_types,)
|
| 664 |
+
return _NotValidator(validator, msg, exc_types)
|
| 665 |
+
|
| 666 |
+
|
| 667 |
+
@attrs(repr=False, slots=True, unsafe_hash=True)
|
| 668 |
+
class _OrValidator:
|
| 669 |
+
validators = attrib()
|
| 670 |
+
|
| 671 |
+
def __call__(self, inst, attr, value):
|
| 672 |
+
for v in self.validators:
|
| 673 |
+
try:
|
| 674 |
+
v(inst, attr, value)
|
| 675 |
+
except Exception: # noqa: BLE001, PERF203, S112
|
| 676 |
+
continue
|
| 677 |
+
else:
|
| 678 |
+
return
|
| 679 |
+
|
| 680 |
+
msg = f"None of {self.validators!r} satisfied for value {value!r}"
|
| 681 |
+
raise ValueError(msg)
|
| 682 |
+
|
| 683 |
+
def __repr__(self):
|
| 684 |
+
return f"<or validator wrapping {self.validators!r}>"
|
| 685 |
+
|
| 686 |
+
|
| 687 |
+
def or_(*validators):
|
| 688 |
+
"""
|
| 689 |
+
A validator that composes multiple validators into one.
|
| 690 |
+
|
| 691 |
+
When called on a value, it runs all wrapped validators until one of them is
|
| 692 |
+
satisfied.
|
| 693 |
+
|
| 694 |
+
Args:
|
| 695 |
+
validators (~collections.abc.Iterable[typing.Callable]):
|
| 696 |
+
Arbitrary number of validators.
|
| 697 |
+
|
| 698 |
+
Raises:
|
| 699 |
+
ValueError:
|
| 700 |
+
If no validator is satisfied. Raised with a human-readable error
|
| 701 |
+
message listing all the wrapped validators and the value that
|
| 702 |
+
failed all of them.
|
| 703 |
+
|
| 704 |
+
.. versionadded:: 24.1.0
|
| 705 |
+
"""
|
| 706 |
+
vals = []
|
| 707 |
+
for v in validators:
|
| 708 |
+
vals.extend(v.validators if isinstance(v, _OrValidator) else [v])
|
| 709 |
+
|
| 710 |
+
return _OrValidator(tuple(vals))
|
.venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
.venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The MIT License (MIT)
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-2024 Thomas Kemmer
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
| 6 |
+
this software and associated documentation files (the "Software"), to deal in
|
| 7 |
+
the Software without restriction, including without limitation the rights to
|
| 8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
| 9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
| 10 |
+
subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
| 17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
| 18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
| 19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
| 20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
.venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/METADATA
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.2
|
| 2 |
+
Name: cachetools
|
| 3 |
+
Version: 5.5.1
|
| 4 |
+
Summary: Extensible memoizing collections and decorators
|
| 5 |
+
Home-page: https://github.com/tkem/cachetools/
|
| 6 |
+
Author: Thomas Kemmer
|
| 7 |
+
Author-email: tkemmer@computer.org
|
| 8 |
+
License: MIT
|
| 9 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 10 |
+
Classifier: Environment :: Other Environment
|
| 11 |
+
Classifier: Intended Audience :: Developers
|
| 12 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 13 |
+
Classifier: Operating System :: OS Independent
|
| 14 |
+
Classifier: Programming Language :: Python
|
| 15 |
+
Classifier: Programming Language :: Python :: 3
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.7
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 23 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 24 |
+
Requires-Python: >=3.7
|
| 25 |
+
License-File: LICENSE
|
| 26 |
+
|
| 27 |
+
cachetools
|
| 28 |
+
========================================================================
|
| 29 |
+
|
| 30 |
+
.. image:: https://img.shields.io/pypi/v/cachetools
|
| 31 |
+
:target: https://pypi.org/project/cachetools/
|
| 32 |
+
:alt: Latest PyPI version
|
| 33 |
+
|
| 34 |
+
.. image:: https://img.shields.io/github/actions/workflow/status/tkem/cachetools/ci.yml
|
| 35 |
+
:target: https://github.com/tkem/cachetools/actions/workflows/ci.yml
|
| 36 |
+
:alt: CI build status
|
| 37 |
+
|
| 38 |
+
.. image:: https://img.shields.io/readthedocs/cachetools
|
| 39 |
+
:target: https://cachetools.readthedocs.io/
|
| 40 |
+
:alt: Documentation build status
|
| 41 |
+
|
| 42 |
+
.. image:: https://img.shields.io/codecov/c/github/tkem/cachetools/master.svg
|
| 43 |
+
:target: https://codecov.io/gh/tkem/cachetools
|
| 44 |
+
:alt: Test coverage
|
| 45 |
+
|
| 46 |
+
.. image:: https://img.shields.io/librariesio/sourcerank/pypi/cachetools
|
| 47 |
+
:target: https://libraries.io/pypi/cachetools
|
| 48 |
+
:alt: Libraries.io SourceRank
|
| 49 |
+
|
| 50 |
+
.. image:: https://img.shields.io/github/license/tkem/cachetools
|
| 51 |
+
:target: https://raw.github.com/tkem/cachetools/master/LICENSE
|
| 52 |
+
:alt: License
|
| 53 |
+
|
| 54 |
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
| 55 |
+
:target: https://github.com/psf/black
|
| 56 |
+
:alt: Code style: black
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
This module provides various memoizing collections and decorators,
|
| 60 |
+
including variants of the Python Standard Library's `@lru_cache`_
|
| 61 |
+
function decorator.
|
| 62 |
+
|
| 63 |
+
.. code-block:: python
|
| 64 |
+
|
| 65 |
+
from cachetools import cached, LRUCache, TTLCache
|
| 66 |
+
|
| 67 |
+
# speed up calculating Fibonacci numbers with dynamic programming
|
| 68 |
+
@cached(cache={})
|
| 69 |
+
def fib(n):
|
| 70 |
+
return n if n < 2 else fib(n - 1) + fib(n - 2)
|
| 71 |
+
|
| 72 |
+
# cache least recently used Python Enhancement Proposals
|
| 73 |
+
@cached(cache=LRUCache(maxsize=32))
|
| 74 |
+
def get_pep(num):
|
| 75 |
+
url = 'http://www.python.org/dev/peps/pep-%04d/' % num
|
| 76 |
+
with urllib.request.urlopen(url) as s:
|
| 77 |
+
return s.read()
|
| 78 |
+
|
| 79 |
+
# cache weather data for no longer than ten minutes
|
| 80 |
+
@cached(cache=TTLCache(maxsize=1024, ttl=600))
|
| 81 |
+
def get_weather(place):
|
| 82 |
+
return owm.weather_at_place(place).get_weather()
|
| 83 |
+
|
| 84 |
+
For the purpose of this module, a *cache* is a mutable_ mapping_ of a
|
| 85 |
+
fixed maximum size. When the cache is full, i.e. by adding another
|
| 86 |
+
item the cache would exceed its maximum size, the cache must choose
|
| 87 |
+
which item(s) to discard based on a suitable `cache algorithm`_.
|
| 88 |
+
|
| 89 |
+
This module provides multiple cache classes based on different cache
|
| 90 |
+
algorithms, as well as decorators for easily memoizing function and
|
| 91 |
+
method calls.
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
Installation
|
| 95 |
+
------------------------------------------------------------------------
|
| 96 |
+
|
| 97 |
+
cachetools is available from PyPI_ and can be installed by running::
|
| 98 |
+
|
| 99 |
+
pip install cachetools
|
| 100 |
+
|
| 101 |
+
Typing stubs for this package are provided by typeshed_ and can be
|
| 102 |
+
installed by running::
|
| 103 |
+
|
| 104 |
+
pip install types-cachetools
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
Project Resources
|
| 108 |
+
------------------------------------------------------------------------
|
| 109 |
+
|
| 110 |
+
- `Documentation`_
|
| 111 |
+
- `Issue tracker`_
|
| 112 |
+
- `Source code`_
|
| 113 |
+
- `Change log`_
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
Related Projects
|
| 117 |
+
------------------------------------------------------------------------
|
| 118 |
+
|
| 119 |
+
- asyncache_: Helpers to use cachetools with async functions
|
| 120 |
+
- cacheing_: Pure Python Cacheing Library
|
| 121 |
+
- CacheToolsUtils_: Cachetools Utilities
|
| 122 |
+
- kids.cache_: Kids caching library
|
| 123 |
+
- shelved-cache_: Persistent cache for Python cachetools
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
License
|
| 127 |
+
------------------------------------------------------------------------
|
| 128 |
+
|
| 129 |
+
Copyright (c) 2014-2024 Thomas Kemmer.
|
| 130 |
+
|
| 131 |
+
Licensed under the `MIT License`_.
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
.. _@lru_cache: https://docs.python.org/3/library/functools.html#functools.lru_cache
|
| 135 |
+
.. _mutable: https://docs.python.org/dev/glossary.html#term-mutable
|
| 136 |
+
.. _mapping: https://docs.python.org/dev/glossary.html#term-mapping
|
| 137 |
+
.. _cache algorithm: https://en.wikipedia.org/wiki/Cache_algorithms
|
| 138 |
+
|
| 139 |
+
.. _PyPI: https://pypi.org/project/cachetools/
|
| 140 |
+
.. _typeshed: https://github.com/python/typeshed/
|
| 141 |
+
.. _Documentation: https://cachetools.readthedocs.io/
|
| 142 |
+
.. _Issue tracker: https://github.com/tkem/cachetools/issues/
|
| 143 |
+
.. _Source code: https://github.com/tkem/cachetools/
|
| 144 |
+
.. _Change log: https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst
|
| 145 |
+
.. _MIT License: https://raw.github.com/tkem/cachetools/master/LICENSE
|
| 146 |
+
|
| 147 |
+
.. _asyncache: https://pypi.org/project/asyncache/
|
| 148 |
+
.. _cacheing: https://github.com/breid48/cacheing
|
| 149 |
+
.. _CacheToolsUtils: https://pypi.org/project/CacheToolsUtils/
|
| 150 |
+
.. _kids.cache: https://pypi.org/project/kids.cache/
|
| 151 |
+
.. _shelved-cache: https://pypi.org/project/shelved-cache/
|
.venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/RECORD
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cachetools-5.5.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
cachetools-5.5.1.dist-info/LICENSE,sha256=L00v8F8Fxdo4efQCkrdgAzLXddx-0yDUPdQvPNfZLJs,1085
|
| 3 |
+
cachetools-5.5.1.dist-info/METADATA,sha256=Nixq3sz0v5CU9SuVh7-Nmnlc9arJXVTAgPi4529VJRU,5379
|
| 4 |
+
cachetools-5.5.1.dist-info/RECORD,,
|
| 5 |
+
cachetools-5.5.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
| 6 |
+
cachetools-5.5.1.dist-info/top_level.txt,sha256=ai2FH78TGwoBcCgVfoqbzk5IQCtnDukdSs4zKuVPvDs,11
|
| 7 |
+
cachetools/__init__.py,sha256=8FSISszrQC5dE0HjoiivM7z9Azm8cEo3uX4rwzDdlf0,25557
|
| 8 |
+
cachetools/__pycache__/__init__.cpython-311.pyc,,
|
| 9 |
+
cachetools/__pycache__/func.cpython-311.pyc,,
|
| 10 |
+
cachetools/__pycache__/keys.cpython-311.pyc,,
|
| 11 |
+
cachetools/func.py,sha256=aOVfSkuNWMRADpkHZGK7LeJ_VZ8wljzbRwIAliOuhAg,3719
|
| 12 |
+
cachetools/keys.py,sha256=AOgfoi-oioBOnEEk115_9qs0HKISrYnbcV4F0hyZ1yk,1777
|
.venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (75.8.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
.venv/lib/python3.11/site-packages/cachetools-5.5.1.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
cachetools
|
.venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
.venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/LICENSE.txt
ADDED
|
@@ -0,0 +1,971 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2005-2023, NumPy Developers.
|
| 2 |
+
All rights reserved.
|
| 3 |
+
|
| 4 |
+
Redistribution and use in source and binary forms, with or without
|
| 5 |
+
modification, are permitted provided that the following conditions are
|
| 6 |
+
met:
|
| 7 |
+
|
| 8 |
+
* Redistributions of source code must retain the above copyright
|
| 9 |
+
notice, this list of conditions and the following disclaimer.
|
| 10 |
+
|
| 11 |
+
* Redistributions in binary form must reproduce the above
|
| 12 |
+
copyright notice, this list of conditions and the following
|
| 13 |
+
disclaimer in the documentation and/or other materials provided
|
| 14 |
+
with the distribution.
|
| 15 |
+
|
| 16 |
+
* Neither the name of the NumPy Developers nor the names of any
|
| 17 |
+
contributors may be used to endorse or promote products derived
|
| 18 |
+
from this software without specific prior written permission.
|
| 19 |
+
|
| 20 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 21 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 22 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 23 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 24 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 25 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 26 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 27 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 28 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 29 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 30 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 31 |
+
|
| 32 |
+
----
|
| 33 |
+
|
| 34 |
+
The NumPy repository and source distributions bundle several libraries that are
|
| 35 |
+
compatibly licensed. We list these here.
|
| 36 |
+
|
| 37 |
+
Name: lapack-lite
|
| 38 |
+
Files: numpy/linalg/lapack_lite/*
|
| 39 |
+
License: BSD-3-Clause
|
| 40 |
+
For details, see numpy/linalg/lapack_lite/LICENSE.txt
|
| 41 |
+
|
| 42 |
+
Name: tempita
|
| 43 |
+
Files: tools/npy_tempita/*
|
| 44 |
+
License: MIT
|
| 45 |
+
For details, see tools/npy_tempita/license.txt
|
| 46 |
+
|
| 47 |
+
Name: dragon4
|
| 48 |
+
Files: numpy/core/src/multiarray/dragon4.c
|
| 49 |
+
License: MIT
|
| 50 |
+
For license text, see numpy/core/src/multiarray/dragon4.c
|
| 51 |
+
|
| 52 |
+
Name: libdivide
|
| 53 |
+
Files: numpy/core/include/numpy/libdivide/*
|
| 54 |
+
License: Zlib
|
| 55 |
+
For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
Note that the following files are vendored in the repository and sdist but not
|
| 59 |
+
installed in built numpy packages:
|
| 60 |
+
|
| 61 |
+
Name: Meson
|
| 62 |
+
Files: vendored-meson/meson/*
|
| 63 |
+
License: Apache 2.0
|
| 64 |
+
For license text, see vendored-meson/meson/COPYING
|
| 65 |
+
|
| 66 |
+
Name: spin
|
| 67 |
+
Files: .spin/cmds.py
|
| 68 |
+
License: BSD-3
|
| 69 |
+
For license text, see .spin/LICENSE
|
| 70 |
+
|
| 71 |
+
----
|
| 72 |
+
|
| 73 |
+
This binary distribution of NumPy also bundles the following software:
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
Name: OpenBLAS
|
| 77 |
+
Files: numpy.libs/libopenblas*.so
|
| 78 |
+
Description: bundled as a dynamically linked library
|
| 79 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 80 |
+
License: BSD-3-Clause
|
| 81 |
+
Copyright (c) 2011-2014, The OpenBLAS Project
|
| 82 |
+
All rights reserved.
|
| 83 |
+
|
| 84 |
+
Redistribution and use in source and binary forms, with or without
|
| 85 |
+
modification, are permitted provided that the following conditions are
|
| 86 |
+
met:
|
| 87 |
+
|
| 88 |
+
1. Redistributions of source code must retain the above copyright
|
| 89 |
+
notice, this list of conditions and the following disclaimer.
|
| 90 |
+
|
| 91 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 92 |
+
notice, this list of conditions and the following disclaimer in
|
| 93 |
+
the documentation and/or other materials provided with the
|
| 94 |
+
distribution.
|
| 95 |
+
3. Neither the name of the OpenBLAS project nor the names of
|
| 96 |
+
its contributors may be used to endorse or promote products
|
| 97 |
+
derived from this software without specific prior written
|
| 98 |
+
permission.
|
| 99 |
+
|
| 100 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 101 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 102 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 103 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
| 104 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 105 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 106 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 107 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 108 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
| 109 |
+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
Name: LAPACK
|
| 113 |
+
Files: numpy.libs/libopenblas*.so
|
| 114 |
+
Description: bundled in OpenBLAS
|
| 115 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 116 |
+
License: BSD-3-Clause-Attribution
|
| 117 |
+
Copyright (c) 1992-2013 The University of Tennessee and The University
|
| 118 |
+
of Tennessee Research Foundation. All rights
|
| 119 |
+
reserved.
|
| 120 |
+
Copyright (c) 2000-2013 The University of California Berkeley. All
|
| 121 |
+
rights reserved.
|
| 122 |
+
Copyright (c) 2006-2013 The University of Colorado Denver. All rights
|
| 123 |
+
reserved.
|
| 124 |
+
|
| 125 |
+
$COPYRIGHT$
|
| 126 |
+
|
| 127 |
+
Additional copyrights may follow
|
| 128 |
+
|
| 129 |
+
$HEADER$
|
| 130 |
+
|
| 131 |
+
Redistribution and use in source and binary forms, with or without
|
| 132 |
+
modification, are permitted provided that the following conditions are
|
| 133 |
+
met:
|
| 134 |
+
|
| 135 |
+
- Redistributions of source code must retain the above copyright
|
| 136 |
+
notice, this list of conditions and the following disclaimer.
|
| 137 |
+
|
| 138 |
+
- Redistributions in binary form must reproduce the above copyright
|
| 139 |
+
notice, this list of conditions and the following disclaimer listed
|
| 140 |
+
in this license in the documentation and/or other materials
|
| 141 |
+
provided with the distribution.
|
| 142 |
+
|
| 143 |
+
- Neither the name of the copyright holders nor the names of its
|
| 144 |
+
contributors may be used to endorse or promote products derived from
|
| 145 |
+
this software without specific prior written permission.
|
| 146 |
+
|
| 147 |
+
The copyright holders provide no reassurances that the source code
|
| 148 |
+
provided does not infringe any patent, copyright, or any other
|
| 149 |
+
intellectual property rights of third parties. The copyright holders
|
| 150 |
+
disclaim any liability to any recipient for claims brought against
|
| 151 |
+
recipient by any third party for infringement of that parties
|
| 152 |
+
intellectual property rights.
|
| 153 |
+
|
| 154 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 155 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 156 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 157 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 158 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 159 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 160 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 161 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 162 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 163 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 164 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
Name: GCC runtime library
|
| 168 |
+
Files: numpy.libs/libgfortran*.so
|
| 169 |
+
Description: dynamically linked to files compiled with gcc
|
| 170 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
|
| 171 |
+
License: GPL-3.0-with-GCC-exception
|
| 172 |
+
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
| 173 |
+
|
| 174 |
+
Libgfortran is free software; you can redistribute it and/or modify
|
| 175 |
+
it under the terms of the GNU General Public License as published by
|
| 176 |
+
the Free Software Foundation; either version 3, or (at your option)
|
| 177 |
+
any later version.
|
| 178 |
+
|
| 179 |
+
Libgfortran is distributed in the hope that it will be useful,
|
| 180 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 181 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 182 |
+
GNU General Public License for more details.
|
| 183 |
+
|
| 184 |
+
Under Section 7 of GPL version 3, you are granted additional
|
| 185 |
+
permissions described in the GCC Runtime Library Exception, version
|
| 186 |
+
3.1, as published by the Free Software Foundation.
|
| 187 |
+
|
| 188 |
+
You should have received a copy of the GNU General Public License and
|
| 189 |
+
a copy of the GCC Runtime Library Exception along with this program;
|
| 190 |
+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
| 191 |
+
<http://www.gnu.org/licenses/>.
|
| 192 |
+
|
| 193 |
+
----
|
| 194 |
+
|
| 195 |
+
Full text of license texts referred to above follows (that they are
|
| 196 |
+
listed below does not necessarily imply the conditions apply to the
|
| 197 |
+
present binary release):
|
| 198 |
+
|
| 199 |
+
----
|
| 200 |
+
|
| 201 |
+
GCC RUNTIME LIBRARY EXCEPTION
|
| 202 |
+
|
| 203 |
+
Version 3.1, 31 March 2009
|
| 204 |
+
|
| 205 |
+
Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/>
|
| 206 |
+
|
| 207 |
+
Everyone is permitted to copy and distribute verbatim copies of this
|
| 208 |
+
license document, but changing it is not allowed.
|
| 209 |
+
|
| 210 |
+
This GCC Runtime Library Exception ("Exception") is an additional
|
| 211 |
+
permission under section 7 of the GNU General Public License, version
|
| 212 |
+
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
|
| 213 |
+
bears a notice placed by the copyright holder of the file stating that
|
| 214 |
+
the file is governed by GPLv3 along with this Exception.
|
| 215 |
+
|
| 216 |
+
When you use GCC to compile a program, GCC may combine portions of
|
| 217 |
+
certain GCC header files and runtime libraries with the compiled
|
| 218 |
+
program. The purpose of this Exception is to allow compilation of
|
| 219 |
+
non-GPL (including proprietary) programs to use, in this way, the
|
| 220 |
+
header files and runtime libraries covered by this Exception.
|
| 221 |
+
|
| 222 |
+
0. Definitions.
|
| 223 |
+
|
| 224 |
+
A file is an "Independent Module" if it either requires the Runtime
|
| 225 |
+
Library for execution after a Compilation Process, or makes use of an
|
| 226 |
+
interface provided by the Runtime Library, but is not otherwise based
|
| 227 |
+
on the Runtime Library.
|
| 228 |
+
|
| 229 |
+
"GCC" means a version of the GNU Compiler Collection, with or without
|
| 230 |
+
modifications, governed by version 3 (or a specified later version) of
|
| 231 |
+
the GNU General Public License (GPL) with the option of using any
|
| 232 |
+
subsequent versions published by the FSF.
|
| 233 |
+
|
| 234 |
+
"GPL-compatible Software" is software whose conditions of propagation,
|
| 235 |
+
modification and use would permit combination with GCC in accord with
|
| 236 |
+
the license of GCC.
|
| 237 |
+
|
| 238 |
+
"Target Code" refers to output from any compiler for a real or virtual
|
| 239 |
+
target processor architecture, in executable form or suitable for
|
| 240 |
+
input to an assembler, loader, linker and/or execution
|
| 241 |
+
phase. Notwithstanding that, Target Code does not include data in any
|
| 242 |
+
format that is used as a compiler intermediate representation, or used
|
| 243 |
+
for producing a compiler intermediate representation.
|
| 244 |
+
|
| 245 |
+
The "Compilation Process" transforms code entirely represented in
|
| 246 |
+
non-intermediate languages designed for human-written code, and/or in
|
| 247 |
+
Java Virtual Machine byte code, into Target Code. Thus, for example,
|
| 248 |
+
use of source code generators and preprocessors need not be considered
|
| 249 |
+
part of the Compilation Process, since the Compilation Process can be
|
| 250 |
+
understood as starting with the output of the generators or
|
| 251 |
+
preprocessors.
|
| 252 |
+
|
| 253 |
+
A Compilation Process is "Eligible" if it is done using GCC, alone or
|
| 254 |
+
with other GPL-compatible software, or if it is done without using any
|
| 255 |
+
work based on GCC. For example, using non-GPL-compatible Software to
|
| 256 |
+
optimize any GCC intermediate representations would not qualify as an
|
| 257 |
+
Eligible Compilation Process.
|
| 258 |
+
|
| 259 |
+
1. Grant of Additional Permission.
|
| 260 |
+
|
| 261 |
+
You have permission to propagate a work of Target Code formed by
|
| 262 |
+
combining the Runtime Library with Independent Modules, even if such
|
| 263 |
+
propagation would otherwise violate the terms of GPLv3, provided that
|
| 264 |
+
all Target Code was generated by Eligible Compilation Processes. You
|
| 265 |
+
may then convey such a combination under terms of your choice,
|
| 266 |
+
consistent with the licensing of the Independent Modules.
|
| 267 |
+
|
| 268 |
+
2. No Weakening of GCC Copyleft.
|
| 269 |
+
|
| 270 |
+
The availability of this Exception does not imply any general
|
| 271 |
+
presumption that third-party software is unaffected by the copyleft
|
| 272 |
+
requirements of the license of GCC.
|
| 273 |
+
|
| 274 |
+
----
|
| 275 |
+
|
| 276 |
+
GNU GENERAL PUBLIC LICENSE
|
| 277 |
+
Version 3, 29 June 2007
|
| 278 |
+
|
| 279 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
| 280 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 281 |
+
of this license document, but changing it is not allowed.
|
| 282 |
+
|
| 283 |
+
Preamble
|
| 284 |
+
|
| 285 |
+
The GNU General Public License is a free, copyleft license for
|
| 286 |
+
software and other kinds of works.
|
| 287 |
+
|
| 288 |
+
The licenses for most software and other practical works are designed
|
| 289 |
+
to take away your freedom to share and change the works. By contrast,
|
| 290 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 291 |
+
share and change all versions of a program--to make sure it remains free
|
| 292 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 293 |
+
GNU General Public License for most of our software; it applies also to
|
| 294 |
+
any other work released this way by its authors. You can apply it to
|
| 295 |
+
your programs, too.
|
| 296 |
+
|
| 297 |
+
When we speak of free software, we are referring to freedom, not
|
| 298 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 299 |
+
have the freedom to distribute copies of free software (and charge for
|
| 300 |
+
them if you wish), that you receive source code or can get it if you
|
| 301 |
+
want it, that you can change the software or use pieces of it in new
|
| 302 |
+
free programs, and that you know you can do these things.
|
| 303 |
+
|
| 304 |
+
To protect your rights, we need to prevent others from denying you
|
| 305 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 306 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 307 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 308 |
+
|
| 309 |
+
For example, if you distribute copies of such a program, whether
|
| 310 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 311 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 312 |
+
or can get the source code. And you must show them these terms so they
|
| 313 |
+
know their rights.
|
| 314 |
+
|
| 315 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 316 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 317 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 318 |
+
|
| 319 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 320 |
+
that there is no warranty for this free software. For both users' and
|
| 321 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 322 |
+
changed, so that their problems will not be attributed erroneously to
|
| 323 |
+
authors of previous versions.
|
| 324 |
+
|
| 325 |
+
Some devices are designed to deny users access to install or run
|
| 326 |
+
modified versions of the software inside them, although the manufacturer
|
| 327 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 328 |
+
protecting users' freedom to change the software. The systematic
|
| 329 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 330 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 331 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 332 |
+
products. If such problems arise substantially in other domains, we
|
| 333 |
+
stand ready to extend this provision to those domains in future versions
|
| 334 |
+
of the GPL, as needed to protect the freedom of users.
|
| 335 |
+
|
| 336 |
+
Finally, every program is threatened constantly by software patents.
|
| 337 |
+
States should not allow patents to restrict development and use of
|
| 338 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 339 |
+
avoid the special danger that patents applied to a free program could
|
| 340 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 341 |
+
patents cannot be used to render the program non-free.
|
| 342 |
+
|
| 343 |
+
The precise terms and conditions for copying, distribution and
|
| 344 |
+
modification follow.
|
| 345 |
+
|
| 346 |
+
TERMS AND CONDITIONS
|
| 347 |
+
|
| 348 |
+
0. Definitions.
|
| 349 |
+
|
| 350 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 351 |
+
|
| 352 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 353 |
+
works, such as semiconductor masks.
|
| 354 |
+
|
| 355 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 356 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 357 |
+
"recipients" may be individuals or organizations.
|
| 358 |
+
|
| 359 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 360 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 361 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 362 |
+
earlier work or a work "based on" the earlier work.
|
| 363 |
+
|
| 364 |
+
A "covered work" means either the unmodified Program or a work based
|
| 365 |
+
on the Program.
|
| 366 |
+
|
| 367 |
+
To "propagate" a work means to do anything with it that, without
|
| 368 |
+
permission, would make you directly or secondarily liable for
|
| 369 |
+
infringement under applicable copyright law, except executing it on a
|
| 370 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 371 |
+
distribution (with or without modification), making available to the
|
| 372 |
+
public, and in some countries other activities as well.
|
| 373 |
+
|
| 374 |
+
To "convey" a work means any kind of propagation that enables other
|
| 375 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 376 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 377 |
+
|
| 378 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 379 |
+
to the extent that it includes a convenient and prominently visible
|
| 380 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 381 |
+
tells the user that there is no warranty for the work (except to the
|
| 382 |
+
extent that warranties are provided), that licensees may convey the
|
| 383 |
+
work under this License, and how to view a copy of this License. If
|
| 384 |
+
the interface presents a list of user commands or options, such as a
|
| 385 |
+
menu, a prominent item in the list meets this criterion.
|
| 386 |
+
|
| 387 |
+
1. Source Code.
|
| 388 |
+
|
| 389 |
+
The "source code" for a work means the preferred form of the work
|
| 390 |
+
for making modifications to it. "Object code" means any non-source
|
| 391 |
+
form of a work.
|
| 392 |
+
|
| 393 |
+
A "Standard Interface" means an interface that either is an official
|
| 394 |
+
standard defined by a recognized standards body, or, in the case of
|
| 395 |
+
interfaces specified for a particular programming language, one that
|
| 396 |
+
is widely used among developers working in that language.
|
| 397 |
+
|
| 398 |
+
The "System Libraries" of an executable work include anything, other
|
| 399 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 400 |
+
packaging a Major Component, but which is not part of that Major
|
| 401 |
+
Component, and (b) serves only to enable use of the work with that
|
| 402 |
+
Major Component, or to implement a Standard Interface for which an
|
| 403 |
+
implementation is available to the public in source code form. A
|
| 404 |
+
"Major Component", in this context, means a major essential component
|
| 405 |
+
(kernel, window system, and so on) of the specific operating system
|
| 406 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 407 |
+
produce the work, or an object code interpreter used to run it.
|
| 408 |
+
|
| 409 |
+
The "Corresponding Source" for a work in object code form means all
|
| 410 |
+
the source code needed to generate, install, and (for an executable
|
| 411 |
+
work) run the object code and to modify the work, including scripts to
|
| 412 |
+
control those activities. However, it does not include the work's
|
| 413 |
+
System Libraries, or general-purpose tools or generally available free
|
| 414 |
+
programs which are used unmodified in performing those activities but
|
| 415 |
+
which are not part of the work. For example, Corresponding Source
|
| 416 |
+
includes interface definition files associated with source files for
|
| 417 |
+
the work, and the source code for shared libraries and dynamically
|
| 418 |
+
linked subprograms that the work is specifically designed to require,
|
| 419 |
+
such as by intimate data communication or control flow between those
|
| 420 |
+
subprograms and other parts of the work.
|
| 421 |
+
|
| 422 |
+
The Corresponding Source need not include anything that users
|
| 423 |
+
can regenerate automatically from other parts of the Corresponding
|
| 424 |
+
Source.
|
| 425 |
+
|
| 426 |
+
The Corresponding Source for a work in source code form is that
|
| 427 |
+
same work.
|
| 428 |
+
|
| 429 |
+
2. Basic Permissions.
|
| 430 |
+
|
| 431 |
+
All rights granted under this License are granted for the term of
|
| 432 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 433 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 434 |
+
permission to run the unmodified Program. The output from running a
|
| 435 |
+
covered work is covered by this License only if the output, given its
|
| 436 |
+
content, constitutes a covered work. This License acknowledges your
|
| 437 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 438 |
+
|
| 439 |
+
You may make, run and propagate covered works that you do not
|
| 440 |
+
convey, without conditions so long as your license otherwise remains
|
| 441 |
+
in force. You may convey covered works to others for the sole purpose
|
| 442 |
+
of having them make modifications exclusively for you, or provide you
|
| 443 |
+
with facilities for running those works, provided that you comply with
|
| 444 |
+
the terms of this License in conveying all material for which you do
|
| 445 |
+
not control copyright. Those thus making or running the covered works
|
| 446 |
+
for you must do so exclusively on your behalf, under your direction
|
| 447 |
+
and control, on terms that prohibit them from making any copies of
|
| 448 |
+
your copyrighted material outside their relationship with you.
|
| 449 |
+
|
| 450 |
+
Conveying under any other circumstances is permitted solely under
|
| 451 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 452 |
+
makes it unnecessary.
|
| 453 |
+
|
| 454 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 455 |
+
|
| 456 |
+
No covered work shall be deemed part of an effective technological
|
| 457 |
+
measure under any applicable law fulfilling obligations under article
|
| 458 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 459 |
+
similar laws prohibiting or restricting circumvention of such
|
| 460 |
+
measures.
|
| 461 |
+
|
| 462 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 463 |
+
circumvention of technological measures to the extent such circumvention
|
| 464 |
+
is effected by exercising rights under this License with respect to
|
| 465 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 466 |
+
modification of the work as a means of enforcing, against the work's
|
| 467 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 468 |
+
technological measures.
|
| 469 |
+
|
| 470 |
+
4. Conveying Verbatim Copies.
|
| 471 |
+
|
| 472 |
+
You may convey verbatim copies of the Program's source code as you
|
| 473 |
+
receive it, in any medium, provided that you conspicuously and
|
| 474 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 475 |
+
keep intact all notices stating that this License and any
|
| 476 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 477 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 478 |
+
recipients a copy of this License along with the Program.
|
| 479 |
+
|
| 480 |
+
You may charge any price or no price for each copy that you convey,
|
| 481 |
+
and you may offer support or warranty protection for a fee.
|
| 482 |
+
|
| 483 |
+
5. Conveying Modified Source Versions.
|
| 484 |
+
|
| 485 |
+
You may convey a work based on the Program, or the modifications to
|
| 486 |
+
produce it from the Program, in the form of source code under the
|
| 487 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 488 |
+
|
| 489 |
+
a) The work must carry prominent notices stating that you modified
|
| 490 |
+
it, and giving a relevant date.
|
| 491 |
+
|
| 492 |
+
b) The work must carry prominent notices stating that it is
|
| 493 |
+
released under this License and any conditions added under section
|
| 494 |
+
7. This requirement modifies the requirement in section 4 to
|
| 495 |
+
"keep intact all notices".
|
| 496 |
+
|
| 497 |
+
c) You must license the entire work, as a whole, under this
|
| 498 |
+
License to anyone who comes into possession of a copy. This
|
| 499 |
+
License will therefore apply, along with any applicable section 7
|
| 500 |
+
additional terms, to the whole of the work, and all its parts,
|
| 501 |
+
regardless of how they are packaged. This License gives no
|
| 502 |
+
permission to license the work in any other way, but it does not
|
| 503 |
+
invalidate such permission if you have separately received it.
|
| 504 |
+
|
| 505 |
+
d) If the work has interactive user interfaces, each must display
|
| 506 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 507 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 508 |
+
work need not make them do so.
|
| 509 |
+
|
| 510 |
+
A compilation of a covered work with other separate and independent
|
| 511 |
+
works, which are not by their nature extensions of the covered work,
|
| 512 |
+
and which are not combined with it such as to form a larger program,
|
| 513 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 514 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 515 |
+
used to limit the access or legal rights of the compilation's users
|
| 516 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 517 |
+
in an aggregate does not cause this License to apply to the other
|
| 518 |
+
parts of the aggregate.
|
| 519 |
+
|
| 520 |
+
6. Conveying Non-Source Forms.
|
| 521 |
+
|
| 522 |
+
You may convey a covered work in object code form under the terms
|
| 523 |
+
of sections 4 and 5, provided that you also convey the
|
| 524 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 525 |
+
in one of these ways:
|
| 526 |
+
|
| 527 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 528 |
+
(including a physical distribution medium), accompanied by the
|
| 529 |
+
Corresponding Source fixed on a durable physical medium
|
| 530 |
+
customarily used for software interchange.
|
| 531 |
+
|
| 532 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 533 |
+
(including a physical distribution medium), accompanied by a
|
| 534 |
+
written offer, valid for at least three years and valid for as
|
| 535 |
+
long as you offer spare parts or customer support for that product
|
| 536 |
+
model, to give anyone who possesses the object code either (1) a
|
| 537 |
+
copy of the Corresponding Source for all the software in the
|
| 538 |
+
product that is covered by this License, on a durable physical
|
| 539 |
+
medium customarily used for software interchange, for a price no
|
| 540 |
+
more than your reasonable cost of physically performing this
|
| 541 |
+
conveying of source, or (2) access to copy the
|
| 542 |
+
Corresponding Source from a network server at no charge.
|
| 543 |
+
|
| 544 |
+
c) Convey individual copies of the object code with a copy of the
|
| 545 |
+
written offer to provide the Corresponding Source. This
|
| 546 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 547 |
+
only if you received the object code with such an offer, in accord
|
| 548 |
+
with subsection 6b.
|
| 549 |
+
|
| 550 |
+
d) Convey the object code by offering access from a designated
|
| 551 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 552 |
+
Corresponding Source in the same way through the same place at no
|
| 553 |
+
further charge. You need not require recipients to copy the
|
| 554 |
+
Corresponding Source along with the object code. If the place to
|
| 555 |
+
copy the object code is a network server, the Corresponding Source
|
| 556 |
+
may be on a different server (operated by you or a third party)
|
| 557 |
+
that supports equivalent copying facilities, provided you maintain
|
| 558 |
+
clear directions next to the object code saying where to find the
|
| 559 |
+
Corresponding Source. Regardless of what server hosts the
|
| 560 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 561 |
+
available for as long as needed to satisfy these requirements.
|
| 562 |
+
|
| 563 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 564 |
+
you inform other peers where the object code and Corresponding
|
| 565 |
+
Source of the work are being offered to the general public at no
|
| 566 |
+
charge under subsection 6d.
|
| 567 |
+
|
| 568 |
+
A separable portion of the object code, whose source code is excluded
|
| 569 |
+
from the Corresponding Source as a System Library, need not be
|
| 570 |
+
included in conveying the object code work.
|
| 571 |
+
|
| 572 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 573 |
+
tangible personal property which is normally used for personal, family,
|
| 574 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 575 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 576 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 577 |
+
product received by a particular user, "normally used" refers to a
|
| 578 |
+
typical or common use of that class of product, regardless of the status
|
| 579 |
+
of the particular user or of the way in which the particular user
|
| 580 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 581 |
+
is a consumer product regardless of whether the product has substantial
|
| 582 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 583 |
+
the only significant mode of use of the product.
|
| 584 |
+
|
| 585 |
+
"Installation Information" for a User Product means any methods,
|
| 586 |
+
procedures, authorization keys, or other information required to install
|
| 587 |
+
and execute modified versions of a covered work in that User Product from
|
| 588 |
+
a modified version of its Corresponding Source. The information must
|
| 589 |
+
suffice to ensure that the continued functioning of the modified object
|
| 590 |
+
code is in no case prevented or interfered with solely because
|
| 591 |
+
modification has been made.
|
| 592 |
+
|
| 593 |
+
If you convey an object code work under this section in, or with, or
|
| 594 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 595 |
+
part of a transaction in which the right of possession and use of the
|
| 596 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 597 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 598 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 599 |
+
by the Installation Information. But this requirement does not apply
|
| 600 |
+
if neither you nor any third party retains the ability to install
|
| 601 |
+
modified object code on the User Product (for example, the work has
|
| 602 |
+
been installed in ROM).
|
| 603 |
+
|
| 604 |
+
The requirement to provide Installation Information does not include a
|
| 605 |
+
requirement to continue to provide support service, warranty, or updates
|
| 606 |
+
for a work that has been modified or installed by the recipient, or for
|
| 607 |
+
the User Product in which it has been modified or installed. Access to a
|
| 608 |
+
network may be denied when the modification itself materially and
|
| 609 |
+
adversely affects the operation of the network or violates the rules and
|
| 610 |
+
protocols for communication across the network.
|
| 611 |
+
|
| 612 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 613 |
+
in accord with this section must be in a format that is publicly
|
| 614 |
+
documented (and with an implementation available to the public in
|
| 615 |
+
source code form), and must require no special password or key for
|
| 616 |
+
unpacking, reading or copying.
|
| 617 |
+
|
| 618 |
+
7. Additional Terms.
|
| 619 |
+
|
| 620 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 621 |
+
License by making exceptions from one or more of its conditions.
|
| 622 |
+
Additional permissions that are applicable to the entire Program shall
|
| 623 |
+
be treated as though they were included in this License, to the extent
|
| 624 |
+
that they are valid under applicable law. If additional permissions
|
| 625 |
+
apply only to part of the Program, that part may be used separately
|
| 626 |
+
under those permissions, but the entire Program remains governed by
|
| 627 |
+
this License without regard to the additional permissions.
|
| 628 |
+
|
| 629 |
+
When you convey a copy of a covered work, you may at your option
|
| 630 |
+
remove any additional permissions from that copy, or from any part of
|
| 631 |
+
it. (Additional permissions may be written to require their own
|
| 632 |
+
removal in certain cases when you modify the work.) You may place
|
| 633 |
+
additional permissions on material, added by you to a covered work,
|
| 634 |
+
for which you have or can give appropriate copyright permission.
|
| 635 |
+
|
| 636 |
+
Notwithstanding any other provision of this License, for material you
|
| 637 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 638 |
+
that material) supplement the terms of this License with terms:
|
| 639 |
+
|
| 640 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 641 |
+
terms of sections 15 and 16 of this License; or
|
| 642 |
+
|
| 643 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 644 |
+
author attributions in that material or in the Appropriate Legal
|
| 645 |
+
Notices displayed by works containing it; or
|
| 646 |
+
|
| 647 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 648 |
+
requiring that modified versions of such material be marked in
|
| 649 |
+
reasonable ways as different from the original version; or
|
| 650 |
+
|
| 651 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 652 |
+
authors of the material; or
|
| 653 |
+
|
| 654 |
+
e) Declining to grant rights under trademark law for use of some
|
| 655 |
+
trade names, trademarks, or service marks; or
|
| 656 |
+
|
| 657 |
+
f) Requiring indemnification of licensors and authors of that
|
| 658 |
+
material by anyone who conveys the material (or modified versions of
|
| 659 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 660 |
+
any liability that these contractual assumptions directly impose on
|
| 661 |
+
those licensors and authors.
|
| 662 |
+
|
| 663 |
+
All other non-permissive additional terms are considered "further
|
| 664 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 665 |
+
received it, or any part of it, contains a notice stating that it is
|
| 666 |
+
governed by this License along with a term that is a further
|
| 667 |
+
restriction, you may remove that term. If a license document contains
|
| 668 |
+
a further restriction but permits relicensing or conveying under this
|
| 669 |
+
License, you may add to a covered work material governed by the terms
|
| 670 |
+
of that license document, provided that the further restriction does
|
| 671 |
+
not survive such relicensing or conveying.
|
| 672 |
+
|
| 673 |
+
If you add terms to a covered work in accord with this section, you
|
| 674 |
+
must place, in the relevant source files, a statement of the
|
| 675 |
+
additional terms that apply to those files, or a notice indicating
|
| 676 |
+
where to find the applicable terms.
|
| 677 |
+
|
| 678 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 679 |
+
form of a separately written license, or stated as exceptions;
|
| 680 |
+
the above requirements apply either way.
|
| 681 |
+
|
| 682 |
+
8. Termination.
|
| 683 |
+
|
| 684 |
+
You may not propagate or modify a covered work except as expressly
|
| 685 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 686 |
+
modify it is void, and will automatically terminate your rights under
|
| 687 |
+
this License (including any patent licenses granted under the third
|
| 688 |
+
paragraph of section 11).
|
| 689 |
+
|
| 690 |
+
However, if you cease all violation of this License, then your
|
| 691 |
+
license from a particular copyright holder is reinstated (a)
|
| 692 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 693 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 694 |
+
holder fails to notify you of the violation by some reasonable means
|
| 695 |
+
prior to 60 days after the cessation.
|
| 696 |
+
|
| 697 |
+
Moreover, your license from a particular copyright holder is
|
| 698 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 699 |
+
violation by some reasonable means, this is the first time you have
|
| 700 |
+
received notice of violation of this License (for any work) from that
|
| 701 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 702 |
+
your receipt of the notice.
|
| 703 |
+
|
| 704 |
+
Termination of your rights under this section does not terminate the
|
| 705 |
+
licenses of parties who have received copies or rights from you under
|
| 706 |
+
this License. If your rights have been terminated and not permanently
|
| 707 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 708 |
+
material under section 10.
|
| 709 |
+
|
| 710 |
+
9. Acceptance Not Required for Having Copies.
|
| 711 |
+
|
| 712 |
+
You are not required to accept this License in order to receive or
|
| 713 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 714 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 715 |
+
to receive a copy likewise does not require acceptance. However,
|
| 716 |
+
nothing other than this License grants you permission to propagate or
|
| 717 |
+
modify any covered work. These actions infringe copyright if you do
|
| 718 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 719 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 720 |
+
|
| 721 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 722 |
+
|
| 723 |
+
Each time you convey a covered work, the recipient automatically
|
| 724 |
+
receives a license from the original licensors, to run, modify and
|
| 725 |
+
propagate that work, subject to this License. You are not responsible
|
| 726 |
+
for enforcing compliance by third parties with this License.
|
| 727 |
+
|
| 728 |
+
An "entity transaction" is a transaction transferring control of an
|
| 729 |
+
organization, or substantially all assets of one, or subdividing an
|
| 730 |
+
organization, or merging organizations. If propagation of a covered
|
| 731 |
+
work results from an entity transaction, each party to that
|
| 732 |
+
transaction who receives a copy of the work also receives whatever
|
| 733 |
+
licenses to the work the party's predecessor in interest had or could
|
| 734 |
+
give under the previous paragraph, plus a right to possession of the
|
| 735 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 736 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 737 |
+
|
| 738 |
+
You may not impose any further restrictions on the exercise of the
|
| 739 |
+
rights granted or affirmed under this License. For example, you may
|
| 740 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 741 |
+
rights granted under this License, and you may not initiate litigation
|
| 742 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 743 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 744 |
+
sale, or importing the Program or any portion of it.
|
| 745 |
+
|
| 746 |
+
11. Patents.
|
| 747 |
+
|
| 748 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 749 |
+
License of the Program or a work on which the Program is based. The
|
| 750 |
+
work thus licensed is called the contributor's "contributor version".
|
| 751 |
+
|
| 752 |
+
A contributor's "essential patent claims" are all patent claims
|
| 753 |
+
owned or controlled by the contributor, whether already acquired or
|
| 754 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 755 |
+
by this License, of making, using, or selling its contributor version,
|
| 756 |
+
but do not include claims that would be infringed only as a
|
| 757 |
+
consequence of further modification of the contributor version. For
|
| 758 |
+
purposes of this definition, "control" includes the right to grant
|
| 759 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 760 |
+
this License.
|
| 761 |
+
|
| 762 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 763 |
+
patent license under the contributor's essential patent claims, to
|
| 764 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 765 |
+
propagate the contents of its contributor version.
|
| 766 |
+
|
| 767 |
+
In the following three paragraphs, a "patent license" is any express
|
| 768 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 769 |
+
(such as an express permission to practice a patent or covenant not to
|
| 770 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 771 |
+
party means to make such an agreement or commitment not to enforce a
|
| 772 |
+
patent against the party.
|
| 773 |
+
|
| 774 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 775 |
+
and the Corresponding Source of the work is not available for anyone
|
| 776 |
+
to copy, free of charge and under the terms of this License, through a
|
| 777 |
+
publicly available network server or other readily accessible means,
|
| 778 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 779 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 780 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 781 |
+
consistent with the requirements of this License, to extend the patent
|
| 782 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 783 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 784 |
+
covered work in a country, or your recipient's use of the covered work
|
| 785 |
+
in a country, would infringe one or more identifiable patents in that
|
| 786 |
+
country that you have reason to believe are valid.
|
| 787 |
+
|
| 788 |
+
If, pursuant to or in connection with a single transaction or
|
| 789 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 790 |
+
covered work, and grant a patent license to some of the parties
|
| 791 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 792 |
+
or convey a specific copy of the covered work, then the patent license
|
| 793 |
+
you grant is automatically extended to all recipients of the covered
|
| 794 |
+
work and works based on it.
|
| 795 |
+
|
| 796 |
+
A patent license is "discriminatory" if it does not include within
|
| 797 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 798 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 799 |
+
specifically granted under this License. You may not convey a covered
|
| 800 |
+
work if you are a party to an arrangement with a third party that is
|
| 801 |
+
in the business of distributing software, under which you make payment
|
| 802 |
+
to the third party based on the extent of your activity of conveying
|
| 803 |
+
the work, and under which the third party grants, to any of the
|
| 804 |
+
parties who would receive the covered work from you, a discriminatory
|
| 805 |
+
patent license (a) in connection with copies of the covered work
|
| 806 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 807 |
+
for and in connection with specific products or compilations that
|
| 808 |
+
contain the covered work, unless you entered into that arrangement,
|
| 809 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 810 |
+
|
| 811 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 812 |
+
any implied license or other defenses to infringement that may
|
| 813 |
+
otherwise be available to you under applicable patent law.
|
| 814 |
+
|
| 815 |
+
12. No Surrender of Others' Freedom.
|
| 816 |
+
|
| 817 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 818 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 819 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 820 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 821 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 822 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 823 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 824 |
+
the Program, the only way you could satisfy both those terms and this
|
| 825 |
+
License would be to refrain entirely from conveying the Program.
|
| 826 |
+
|
| 827 |
+
13. Use with the GNU Affero General Public License.
|
| 828 |
+
|
| 829 |
+
Notwithstanding any other provision of this License, you have
|
| 830 |
+
permission to link or combine any covered work with a work licensed
|
| 831 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 832 |
+
combined work, and to convey the resulting work. The terms of this
|
| 833 |
+
License will continue to apply to the part which is the covered work,
|
| 834 |
+
but the special requirements of the GNU Affero General Public License,
|
| 835 |
+
section 13, concerning interaction through a network will apply to the
|
| 836 |
+
combination as such.
|
| 837 |
+
|
| 838 |
+
14. Revised Versions of this License.
|
| 839 |
+
|
| 840 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 841 |
+
the GNU General Public License from time to time. Such new versions will
|
| 842 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 843 |
+
address new problems or concerns.
|
| 844 |
+
|
| 845 |
+
Each version is given a distinguishing version number. If the
|
| 846 |
+
Program specifies that a certain numbered version of the GNU General
|
| 847 |
+
Public License "or any later version" applies to it, you have the
|
| 848 |
+
option of following the terms and conditions either of that numbered
|
| 849 |
+
version or of any later version published by the Free Software
|
| 850 |
+
Foundation. If the Program does not specify a version number of the
|
| 851 |
+
GNU General Public License, you may choose any version ever published
|
| 852 |
+
by the Free Software Foundation.
|
| 853 |
+
|
| 854 |
+
If the Program specifies that a proxy can decide which future
|
| 855 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 856 |
+
public statement of acceptance of a version permanently authorizes you
|
| 857 |
+
to choose that version for the Program.
|
| 858 |
+
|
| 859 |
+
Later license versions may give you additional or different
|
| 860 |
+
permissions. However, no additional obligations are imposed on any
|
| 861 |
+
author or copyright holder as a result of your choosing to follow a
|
| 862 |
+
later version.
|
| 863 |
+
|
| 864 |
+
15. Disclaimer of Warranty.
|
| 865 |
+
|
| 866 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 867 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 868 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 869 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 870 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 871 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 872 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 873 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 874 |
+
|
| 875 |
+
16. Limitation of Liability.
|
| 876 |
+
|
| 877 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 878 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 879 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 880 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 881 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 882 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 883 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 884 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 885 |
+
SUCH DAMAGES.
|
| 886 |
+
|
| 887 |
+
17. Interpretation of Sections 15 and 16.
|
| 888 |
+
|
| 889 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 890 |
+
above cannot be given local legal effect according to their terms,
|
| 891 |
+
reviewing courts shall apply local law that most closely approximates
|
| 892 |
+
an absolute waiver of all civil liability in connection with the
|
| 893 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 894 |
+
copy of the Program in return for a fee.
|
| 895 |
+
|
| 896 |
+
END OF TERMS AND CONDITIONS
|
| 897 |
+
|
| 898 |
+
How to Apply These Terms to Your New Programs
|
| 899 |
+
|
| 900 |
+
If you develop a new program, and you want it to be of the greatest
|
| 901 |
+
possible use to the public, the best way to achieve this is to make it
|
| 902 |
+
free software which everyone can redistribute and change under these terms.
|
| 903 |
+
|
| 904 |
+
To do so, attach the following notices to the program. It is safest
|
| 905 |
+
to attach them to the start of each source file to most effectively
|
| 906 |
+
state the exclusion of warranty; and each file should have at least
|
| 907 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 908 |
+
|
| 909 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 910 |
+
Copyright (C) <year> <name of author>
|
| 911 |
+
|
| 912 |
+
This program is free software: you can redistribute it and/or modify
|
| 913 |
+
it under the terms of the GNU General Public License as published by
|
| 914 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 915 |
+
(at your option) any later version.
|
| 916 |
+
|
| 917 |
+
This program is distributed in the hope that it will be useful,
|
| 918 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 919 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 920 |
+
GNU General Public License for more details.
|
| 921 |
+
|
| 922 |
+
You should have received a copy of the GNU General Public License
|
| 923 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 924 |
+
|
| 925 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 926 |
+
|
| 927 |
+
If the program does terminal interaction, make it output a short
|
| 928 |
+
notice like this when it starts in an interactive mode:
|
| 929 |
+
|
| 930 |
+
<program> Copyright (C) <year> <name of author>
|
| 931 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 932 |
+
This is free software, and you are welcome to redistribute it
|
| 933 |
+
under certain conditions; type `show c' for details.
|
| 934 |
+
|
| 935 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 936 |
+
parts of the General Public License. Of course, your program's commands
|
| 937 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 938 |
+
|
| 939 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 940 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 941 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 942 |
+
<http://www.gnu.org/licenses/>.
|
| 943 |
+
|
| 944 |
+
The GNU General Public License does not permit incorporating your program
|
| 945 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 946 |
+
may consider it more useful to permit linking proprietary applications with
|
| 947 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 948 |
+
Public License instead of this License. But first, please read
|
| 949 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
| 950 |
+
|
| 951 |
+
Name: libquadmath
|
| 952 |
+
Files: numpy.libs/libquadmath*.so
|
| 953 |
+
Description: dynamically linked to files compiled with gcc
|
| 954 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
|
| 955 |
+
License: LGPL-2.1-or-later
|
| 956 |
+
|
| 957 |
+
GCC Quad-Precision Math Library
|
| 958 |
+
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
| 959 |
+
Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
| 960 |
+
|
| 961 |
+
This file is part of the libquadmath library.
|
| 962 |
+
Libquadmath is free software; you can redistribute it and/or
|
| 963 |
+
modify it under the terms of the GNU Library General Public
|
| 964 |
+
License as published by the Free Software Foundation; either
|
| 965 |
+
version 2.1 of the License, or (at your option) any later version.
|
| 966 |
+
|
| 967 |
+
Libquadmath is distributed in the hope that it will be useful,
|
| 968 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 969 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 970 |
+
Lesser General Public License for more details.
|
| 971 |
+
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
.venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/METADATA
ADDED
|
@@ -0,0 +1,1092 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: numpy
|
| 3 |
+
Version: 1.26.4
|
| 4 |
+
Summary: Fundamental package for array computing in Python
|
| 5 |
+
Home-page: https://numpy.org
|
| 6 |
+
Author: Travis E. Oliphant et al.
|
| 7 |
+
Maintainer-Email: NumPy Developers <numpy-discussion@python.org>
|
| 8 |
+
License: Copyright (c) 2005-2023, NumPy Developers.
|
| 9 |
+
All rights reserved.
|
| 10 |
+
|
| 11 |
+
Redistribution and use in source and binary forms, with or without
|
| 12 |
+
modification, are permitted provided that the following conditions are
|
| 13 |
+
met:
|
| 14 |
+
|
| 15 |
+
* Redistributions of source code must retain the above copyright
|
| 16 |
+
notice, this list of conditions and the following disclaimer.
|
| 17 |
+
|
| 18 |
+
* Redistributions in binary form must reproduce the above
|
| 19 |
+
copyright notice, this list of conditions and the following
|
| 20 |
+
disclaimer in the documentation and/or other materials provided
|
| 21 |
+
with the distribution.
|
| 22 |
+
|
| 23 |
+
* Neither the name of the NumPy Developers nor the names of any
|
| 24 |
+
contributors may be used to endorse or promote products derived
|
| 25 |
+
from this software without specific prior written permission.
|
| 26 |
+
|
| 27 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 28 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 29 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 30 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 31 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 32 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 33 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 34 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 35 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 36 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 37 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 38 |
+
|
| 39 |
+
----
|
| 40 |
+
|
| 41 |
+
The NumPy repository and source distributions bundle several libraries that are
|
| 42 |
+
compatibly licensed. We list these here.
|
| 43 |
+
|
| 44 |
+
Name: lapack-lite
|
| 45 |
+
Files: numpy/linalg/lapack_lite/*
|
| 46 |
+
License: BSD-3-Clause
|
| 47 |
+
For details, see numpy/linalg/lapack_lite/LICENSE.txt
|
| 48 |
+
|
| 49 |
+
Name: tempita
|
| 50 |
+
Files: tools/npy_tempita/*
|
| 51 |
+
License: MIT
|
| 52 |
+
For details, see tools/npy_tempita/license.txt
|
| 53 |
+
|
| 54 |
+
Name: dragon4
|
| 55 |
+
Files: numpy/core/src/multiarray/dragon4.c
|
| 56 |
+
License: MIT
|
| 57 |
+
For license text, see numpy/core/src/multiarray/dragon4.c
|
| 58 |
+
|
| 59 |
+
Name: libdivide
|
| 60 |
+
Files: numpy/core/include/numpy/libdivide/*
|
| 61 |
+
License: Zlib
|
| 62 |
+
For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
Note that the following files are vendored in the repository and sdist but not
|
| 66 |
+
installed in built numpy packages:
|
| 67 |
+
|
| 68 |
+
Name: Meson
|
| 69 |
+
Files: vendored-meson/meson/*
|
| 70 |
+
License: Apache 2.0
|
| 71 |
+
For license text, see vendored-meson/meson/COPYING
|
| 72 |
+
|
| 73 |
+
Name: spin
|
| 74 |
+
Files: .spin/cmds.py
|
| 75 |
+
License: BSD-3
|
| 76 |
+
For license text, see .spin/LICENSE
|
| 77 |
+
|
| 78 |
+
----
|
| 79 |
+
|
| 80 |
+
This binary distribution of NumPy also bundles the following software:
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
Name: OpenBLAS
|
| 84 |
+
Files: numpy.libs/libopenblas*.so
|
| 85 |
+
Description: bundled as a dynamically linked library
|
| 86 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 87 |
+
License: BSD-3-Clause
|
| 88 |
+
Copyright (c) 2011-2014, The OpenBLAS Project
|
| 89 |
+
All rights reserved.
|
| 90 |
+
|
| 91 |
+
Redistribution and use in source and binary forms, with or without
|
| 92 |
+
modification, are permitted provided that the following conditions are
|
| 93 |
+
met:
|
| 94 |
+
|
| 95 |
+
1. Redistributions of source code must retain the above copyright
|
| 96 |
+
notice, this list of conditions and the following disclaimer.
|
| 97 |
+
|
| 98 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 99 |
+
notice, this list of conditions and the following disclaimer in
|
| 100 |
+
the documentation and/or other materials provided with the
|
| 101 |
+
distribution.
|
| 102 |
+
3. Neither the name of the OpenBLAS project nor the names of
|
| 103 |
+
its contributors may be used to endorse or promote products
|
| 104 |
+
derived from this software without specific prior written
|
| 105 |
+
permission.
|
| 106 |
+
|
| 107 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 108 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 109 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 110 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
| 111 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 112 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 113 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 114 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 115 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
| 116 |
+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
Name: LAPACK
|
| 120 |
+
Files: numpy.libs/libopenblas*.so
|
| 121 |
+
Description: bundled in OpenBLAS
|
| 122 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 123 |
+
License: BSD-3-Clause-Attribution
|
| 124 |
+
Copyright (c) 1992-2013 The University of Tennessee and The University
|
| 125 |
+
of Tennessee Research Foundation. All rights
|
| 126 |
+
reserved.
|
| 127 |
+
Copyright (c) 2000-2013 The University of California Berkeley. All
|
| 128 |
+
rights reserved.
|
| 129 |
+
Copyright (c) 2006-2013 The University of Colorado Denver. All rights
|
| 130 |
+
reserved.
|
| 131 |
+
|
| 132 |
+
$COPYRIGHT$
|
| 133 |
+
|
| 134 |
+
Additional copyrights may follow
|
| 135 |
+
|
| 136 |
+
$HEADER$
|
| 137 |
+
|
| 138 |
+
Redistribution and use in source and binary forms, with or without
|
| 139 |
+
modification, are permitted provided that the following conditions are
|
| 140 |
+
met:
|
| 141 |
+
|
| 142 |
+
- Redistributions of source code must retain the above copyright
|
| 143 |
+
notice, this list of conditions and the following disclaimer.
|
| 144 |
+
|
| 145 |
+
- Redistributions in binary form must reproduce the above copyright
|
| 146 |
+
notice, this list of conditions and the following disclaimer listed
|
| 147 |
+
in this license in the documentation and/or other materials
|
| 148 |
+
provided with the distribution.
|
| 149 |
+
|
| 150 |
+
- Neither the name of the copyright holders nor the names of its
|
| 151 |
+
contributors may be used to endorse or promote products derived from
|
| 152 |
+
this software without specific prior written permission.
|
| 153 |
+
|
| 154 |
+
The copyright holders provide no reassurances that the source code
|
| 155 |
+
provided does not infringe any patent, copyright, or any other
|
| 156 |
+
intellectual property rights of third parties. The copyright holders
|
| 157 |
+
disclaim any liability to any recipient for claims brought against
|
| 158 |
+
recipient by any third party for infringement of that parties
|
| 159 |
+
intellectual property rights.
|
| 160 |
+
|
| 161 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 162 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 163 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 164 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 165 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 166 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 167 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 168 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 169 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 170 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 171 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
Name: GCC runtime library
|
| 175 |
+
Files: numpy.libs/libgfortran*.so
|
| 176 |
+
Description: dynamically linked to files compiled with gcc
|
| 177 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
|
| 178 |
+
License: GPL-3.0-with-GCC-exception
|
| 179 |
+
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
| 180 |
+
|
| 181 |
+
Libgfortran is free software; you can redistribute it and/or modify
|
| 182 |
+
it under the terms of the GNU General Public License as published by
|
| 183 |
+
the Free Software Foundation; either version 3, or (at your option)
|
| 184 |
+
any later version.
|
| 185 |
+
|
| 186 |
+
Libgfortran is distributed in the hope that it will be useful,
|
| 187 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 188 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 189 |
+
GNU General Public License for more details.
|
| 190 |
+
|
| 191 |
+
Under Section 7 of GPL version 3, you are granted additional
|
| 192 |
+
permissions described in the GCC Runtime Library Exception, version
|
| 193 |
+
3.1, as published by the Free Software Foundation.
|
| 194 |
+
|
| 195 |
+
You should have received a copy of the GNU General Public License and
|
| 196 |
+
a copy of the GCC Runtime Library Exception along with this program;
|
| 197 |
+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
| 198 |
+
<http://www.gnu.org/licenses/>.
|
| 199 |
+
|
| 200 |
+
----
|
| 201 |
+
|
| 202 |
+
Full text of license texts referred to above follows (that they are
|
| 203 |
+
listed below does not necessarily imply the conditions apply to the
|
| 204 |
+
present binary release):
|
| 205 |
+
|
| 206 |
+
----
|
| 207 |
+
|
| 208 |
+
GCC RUNTIME LIBRARY EXCEPTION
|
| 209 |
+
|
| 210 |
+
Version 3.1, 31 March 2009
|
| 211 |
+
|
| 212 |
+
Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/>
|
| 213 |
+
|
| 214 |
+
Everyone is permitted to copy and distribute verbatim copies of this
|
| 215 |
+
license document, but changing it is not allowed.
|
| 216 |
+
|
| 217 |
+
This GCC Runtime Library Exception ("Exception") is an additional
|
| 218 |
+
permission under section 7 of the GNU General Public License, version
|
| 219 |
+
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
|
| 220 |
+
bears a notice placed by the copyright holder of the file stating that
|
| 221 |
+
the file is governed by GPLv3 along with this Exception.
|
| 222 |
+
|
| 223 |
+
When you use GCC to compile a program, GCC may combine portions of
|
| 224 |
+
certain GCC header files and runtime libraries with the compiled
|
| 225 |
+
program. The purpose of this Exception is to allow compilation of
|
| 226 |
+
non-GPL (including proprietary) programs to use, in this way, the
|
| 227 |
+
header files and runtime libraries covered by this Exception.
|
| 228 |
+
|
| 229 |
+
0. Definitions.
|
| 230 |
+
|
| 231 |
+
A file is an "Independent Module" if it either requires the Runtime
|
| 232 |
+
Library for execution after a Compilation Process, or makes use of an
|
| 233 |
+
interface provided by the Runtime Library, but is not otherwise based
|
| 234 |
+
on the Runtime Library.
|
| 235 |
+
|
| 236 |
+
"GCC" means a version of the GNU Compiler Collection, with or without
|
| 237 |
+
modifications, governed by version 3 (or a specified later version) of
|
| 238 |
+
the GNU General Public License (GPL) with the option of using any
|
| 239 |
+
subsequent versions published by the FSF.
|
| 240 |
+
|
| 241 |
+
"GPL-compatible Software" is software whose conditions of propagation,
|
| 242 |
+
modification and use would permit combination with GCC in accord with
|
| 243 |
+
the license of GCC.
|
| 244 |
+
|
| 245 |
+
"Target Code" refers to output from any compiler for a real or virtual
|
| 246 |
+
target processor architecture, in executable form or suitable for
|
| 247 |
+
input to an assembler, loader, linker and/or execution
|
| 248 |
+
phase. Notwithstanding that, Target Code does not include data in any
|
| 249 |
+
format that is used as a compiler intermediate representation, or used
|
| 250 |
+
for producing a compiler intermediate representation.
|
| 251 |
+
|
| 252 |
+
The "Compilation Process" transforms code entirely represented in
|
| 253 |
+
non-intermediate languages designed for human-written code, and/or in
|
| 254 |
+
Java Virtual Machine byte code, into Target Code. Thus, for example,
|
| 255 |
+
use of source code generators and preprocessors need not be considered
|
| 256 |
+
part of the Compilation Process, since the Compilation Process can be
|
| 257 |
+
understood as starting with the output of the generators or
|
| 258 |
+
preprocessors.
|
| 259 |
+
|
| 260 |
+
A Compilation Process is "Eligible" if it is done using GCC, alone or
|
| 261 |
+
with other GPL-compatible software, or if it is done without using any
|
| 262 |
+
work based on GCC. For example, using non-GPL-compatible Software to
|
| 263 |
+
optimize any GCC intermediate representations would not qualify as an
|
| 264 |
+
Eligible Compilation Process.
|
| 265 |
+
|
| 266 |
+
1. Grant of Additional Permission.
|
| 267 |
+
|
| 268 |
+
You have permission to propagate a work of Target Code formed by
|
| 269 |
+
combining the Runtime Library with Independent Modules, even if such
|
| 270 |
+
propagation would otherwise violate the terms of GPLv3, provided that
|
| 271 |
+
all Target Code was generated by Eligible Compilation Processes. You
|
| 272 |
+
may then convey such a combination under terms of your choice,
|
| 273 |
+
consistent with the licensing of the Independent Modules.
|
| 274 |
+
|
| 275 |
+
2. No Weakening of GCC Copyleft.
|
| 276 |
+
|
| 277 |
+
The availability of this Exception does not imply any general
|
| 278 |
+
presumption that third-party software is unaffected by the copyleft
|
| 279 |
+
requirements of the license of GCC.
|
| 280 |
+
|
| 281 |
+
----
|
| 282 |
+
|
| 283 |
+
GNU GENERAL PUBLIC LICENSE
|
| 284 |
+
Version 3, 29 June 2007
|
| 285 |
+
|
| 286 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
| 287 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 288 |
+
of this license document, but changing it is not allowed.
|
| 289 |
+
|
| 290 |
+
Preamble
|
| 291 |
+
|
| 292 |
+
The GNU General Public License is a free, copyleft license for
|
| 293 |
+
software and other kinds of works.
|
| 294 |
+
|
| 295 |
+
The licenses for most software and other practical works are designed
|
| 296 |
+
to take away your freedom to share and change the works. By contrast,
|
| 297 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 298 |
+
share and change all versions of a program--to make sure it remains free
|
| 299 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 300 |
+
GNU General Public License for most of our software; it applies also to
|
| 301 |
+
any other work released this way by its authors. You can apply it to
|
| 302 |
+
your programs, too.
|
| 303 |
+
|
| 304 |
+
When we speak of free software, we are referring to freedom, not
|
| 305 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 306 |
+
have the freedom to distribute copies of free software (and charge for
|
| 307 |
+
them if you wish), that you receive source code or can get it if you
|
| 308 |
+
want it, that you can change the software or use pieces of it in new
|
| 309 |
+
free programs, and that you know you can do these things.
|
| 310 |
+
|
| 311 |
+
To protect your rights, we need to prevent others from denying you
|
| 312 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 313 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 314 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 315 |
+
|
| 316 |
+
For example, if you distribute copies of such a program, whether
|
| 317 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 318 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 319 |
+
or can get the source code. And you must show them these terms so they
|
| 320 |
+
know their rights.
|
| 321 |
+
|
| 322 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 323 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 324 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 325 |
+
|
| 326 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 327 |
+
that there is no warranty for this free software. For both users' and
|
| 328 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 329 |
+
changed, so that their problems will not be attributed erroneously to
|
| 330 |
+
authors of previous versions.
|
| 331 |
+
|
| 332 |
+
Some devices are designed to deny users access to install or run
|
| 333 |
+
modified versions of the software inside them, although the manufacturer
|
| 334 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 335 |
+
protecting users' freedom to change the software. The systematic
|
| 336 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 337 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 338 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 339 |
+
products. If such problems arise substantially in other domains, we
|
| 340 |
+
stand ready to extend this provision to those domains in future versions
|
| 341 |
+
of the GPL, as needed to protect the freedom of users.
|
| 342 |
+
|
| 343 |
+
Finally, every program is threatened constantly by software patents.
|
| 344 |
+
States should not allow patents to restrict development and use of
|
| 345 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 346 |
+
avoid the special danger that patents applied to a free program could
|
| 347 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 348 |
+
patents cannot be used to render the program non-free.
|
| 349 |
+
|
| 350 |
+
The precise terms and conditions for copying, distribution and
|
| 351 |
+
modification follow.
|
| 352 |
+
|
| 353 |
+
TERMS AND CONDITIONS
|
| 354 |
+
|
| 355 |
+
0. Definitions.
|
| 356 |
+
|
| 357 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 358 |
+
|
| 359 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 360 |
+
works, such as semiconductor masks.
|
| 361 |
+
|
| 362 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 363 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 364 |
+
"recipients" may be individuals or organizations.
|
| 365 |
+
|
| 366 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 367 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 368 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 369 |
+
earlier work or a work "based on" the earlier work.
|
| 370 |
+
|
| 371 |
+
A "covered work" means either the unmodified Program or a work based
|
| 372 |
+
on the Program.
|
| 373 |
+
|
| 374 |
+
To "propagate" a work means to do anything with it that, without
|
| 375 |
+
permission, would make you directly or secondarily liable for
|
| 376 |
+
infringement under applicable copyright law, except executing it on a
|
| 377 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 378 |
+
distribution (with or without modification), making available to the
|
| 379 |
+
public, and in some countries other activities as well.
|
| 380 |
+
|
| 381 |
+
To "convey" a work means any kind of propagation that enables other
|
| 382 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 383 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 384 |
+
|
| 385 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 386 |
+
to the extent that it includes a convenient and prominently visible
|
| 387 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 388 |
+
tells the user that there is no warranty for the work (except to the
|
| 389 |
+
extent that warranties are provided), that licensees may convey the
|
| 390 |
+
work under this License, and how to view a copy of this License. If
|
| 391 |
+
the interface presents a list of user commands or options, such as a
|
| 392 |
+
menu, a prominent item in the list meets this criterion.
|
| 393 |
+
|
| 394 |
+
1. Source Code.
|
| 395 |
+
|
| 396 |
+
The "source code" for a work means the preferred form of the work
|
| 397 |
+
for making modifications to it. "Object code" means any non-source
|
| 398 |
+
form of a work.
|
| 399 |
+
|
| 400 |
+
A "Standard Interface" means an interface that either is an official
|
| 401 |
+
standard defined by a recognized standards body, or, in the case of
|
| 402 |
+
interfaces specified for a particular programming language, one that
|
| 403 |
+
is widely used among developers working in that language.
|
| 404 |
+
|
| 405 |
+
The "System Libraries" of an executable work include anything, other
|
| 406 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 407 |
+
packaging a Major Component, but which is not part of that Major
|
| 408 |
+
Component, and (b) serves only to enable use of the work with that
|
| 409 |
+
Major Component, or to implement a Standard Interface for which an
|
| 410 |
+
implementation is available to the public in source code form. A
|
| 411 |
+
"Major Component", in this context, means a major essential component
|
| 412 |
+
(kernel, window system, and so on) of the specific operating system
|
| 413 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 414 |
+
produce the work, or an object code interpreter used to run it.
|
| 415 |
+
|
| 416 |
+
The "Corresponding Source" for a work in object code form means all
|
| 417 |
+
the source code needed to generate, install, and (for an executable
|
| 418 |
+
work) run the object code and to modify the work, including scripts to
|
| 419 |
+
control those activities. However, it does not include the work's
|
| 420 |
+
System Libraries, or general-purpose tools or generally available free
|
| 421 |
+
programs which are used unmodified in performing those activities but
|
| 422 |
+
which are not part of the work. For example, Corresponding Source
|
| 423 |
+
includes interface definition files associated with source files for
|
| 424 |
+
the work, and the source code for shared libraries and dynamically
|
| 425 |
+
linked subprograms that the work is specifically designed to require,
|
| 426 |
+
such as by intimate data communication or control flow between those
|
| 427 |
+
subprograms and other parts of the work.
|
| 428 |
+
|
| 429 |
+
The Corresponding Source need not include anything that users
|
| 430 |
+
can regenerate automatically from other parts of the Corresponding
|
| 431 |
+
Source.
|
| 432 |
+
|
| 433 |
+
The Corresponding Source for a work in source code form is that
|
| 434 |
+
same work.
|
| 435 |
+
|
| 436 |
+
2. Basic Permissions.
|
| 437 |
+
|
| 438 |
+
All rights granted under this License are granted for the term of
|
| 439 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 440 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 441 |
+
permission to run the unmodified Program. The output from running a
|
| 442 |
+
covered work is covered by this License only if the output, given its
|
| 443 |
+
content, constitutes a covered work. This License acknowledges your
|
| 444 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 445 |
+
|
| 446 |
+
You may make, run and propagate covered works that you do not
|
| 447 |
+
convey, without conditions so long as your license otherwise remains
|
| 448 |
+
in force. You may convey covered works to others for the sole purpose
|
| 449 |
+
of having them make modifications exclusively for you, or provide you
|
| 450 |
+
with facilities for running those works, provided that you comply with
|
| 451 |
+
the terms of this License in conveying all material for which you do
|
| 452 |
+
not control copyright. Those thus making or running the covered works
|
| 453 |
+
for you must do so exclusively on your behalf, under your direction
|
| 454 |
+
and control, on terms that prohibit them from making any copies of
|
| 455 |
+
your copyrighted material outside their relationship with you.
|
| 456 |
+
|
| 457 |
+
Conveying under any other circumstances is permitted solely under
|
| 458 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 459 |
+
makes it unnecessary.
|
| 460 |
+
|
| 461 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 462 |
+
|
| 463 |
+
No covered work shall be deemed part of an effective technological
|
| 464 |
+
measure under any applicable law fulfilling obligations under article
|
| 465 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 466 |
+
similar laws prohibiting or restricting circumvention of such
|
| 467 |
+
measures.
|
| 468 |
+
|
| 469 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 470 |
+
circumvention of technological measures to the extent such circumvention
|
| 471 |
+
is effected by exercising rights under this License with respect to
|
| 472 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 473 |
+
modification of the work as a means of enforcing, against the work's
|
| 474 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 475 |
+
technological measures.
|
| 476 |
+
|
| 477 |
+
4. Conveying Verbatim Copies.
|
| 478 |
+
|
| 479 |
+
You may convey verbatim copies of the Program's source code as you
|
| 480 |
+
receive it, in any medium, provided that you conspicuously and
|
| 481 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 482 |
+
keep intact all notices stating that this License and any
|
| 483 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 484 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 485 |
+
recipients a copy of this License along with the Program.
|
| 486 |
+
|
| 487 |
+
You may charge any price or no price for each copy that you convey,
|
| 488 |
+
and you may offer support or warranty protection for a fee.
|
| 489 |
+
|
| 490 |
+
5. Conveying Modified Source Versions.
|
| 491 |
+
|
| 492 |
+
You may convey a work based on the Program, or the modifications to
|
| 493 |
+
produce it from the Program, in the form of source code under the
|
| 494 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 495 |
+
|
| 496 |
+
a) The work must carry prominent notices stating that you modified
|
| 497 |
+
it, and giving a relevant date.
|
| 498 |
+
|
| 499 |
+
b) The work must carry prominent notices stating that it is
|
| 500 |
+
released under this License and any conditions added under section
|
| 501 |
+
7. This requirement modifies the requirement in section 4 to
|
| 502 |
+
"keep intact all notices".
|
| 503 |
+
|
| 504 |
+
c) You must license the entire work, as a whole, under this
|
| 505 |
+
License to anyone who comes into possession of a copy. This
|
| 506 |
+
License will therefore apply, along with any applicable section 7
|
| 507 |
+
additional terms, to the whole of the work, and all its parts,
|
| 508 |
+
regardless of how they are packaged. This License gives no
|
| 509 |
+
permission to license the work in any other way, but it does not
|
| 510 |
+
invalidate such permission if you have separately received it.
|
| 511 |
+
|
| 512 |
+
d) If the work has interactive user interfaces, each must display
|
| 513 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 514 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 515 |
+
work need not make them do so.
|
| 516 |
+
|
| 517 |
+
A compilation of a covered work with other separate and independent
|
| 518 |
+
works, which are not by their nature extensions of the covered work,
|
| 519 |
+
and which are not combined with it such as to form a larger program,
|
| 520 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 521 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 522 |
+
used to limit the access or legal rights of the compilation's users
|
| 523 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 524 |
+
in an aggregate does not cause this License to apply to the other
|
| 525 |
+
parts of the aggregate.
|
| 526 |
+
|
| 527 |
+
6. Conveying Non-Source Forms.
|
| 528 |
+
|
| 529 |
+
You may convey a covered work in object code form under the terms
|
| 530 |
+
of sections 4 and 5, provided that you also convey the
|
| 531 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 532 |
+
in one of these ways:
|
| 533 |
+
|
| 534 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 535 |
+
(including a physical distribution medium), accompanied by the
|
| 536 |
+
Corresponding Source fixed on a durable physical medium
|
| 537 |
+
customarily used for software interchange.
|
| 538 |
+
|
| 539 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 540 |
+
(including a physical distribution medium), accompanied by a
|
| 541 |
+
written offer, valid for at least three years and valid for as
|
| 542 |
+
long as you offer spare parts or customer support for that product
|
| 543 |
+
model, to give anyone who possesses the object code either (1) a
|
| 544 |
+
copy of the Corresponding Source for all the software in the
|
| 545 |
+
product that is covered by this License, on a durable physical
|
| 546 |
+
medium customarily used for software interchange, for a price no
|
| 547 |
+
more than your reasonable cost of physically performing this
|
| 548 |
+
conveying of source, or (2) access to copy the
|
| 549 |
+
Corresponding Source from a network server at no charge.
|
| 550 |
+
|
| 551 |
+
c) Convey individual copies of the object code with a copy of the
|
| 552 |
+
written offer to provide the Corresponding Source. This
|
| 553 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 554 |
+
only if you received the object code with such an offer, in accord
|
| 555 |
+
with subsection 6b.
|
| 556 |
+
|
| 557 |
+
d) Convey the object code by offering access from a designated
|
| 558 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 559 |
+
Corresponding Source in the same way through the same place at no
|
| 560 |
+
further charge. You need not require recipients to copy the
|
| 561 |
+
Corresponding Source along with the object code. If the place to
|
| 562 |
+
copy the object code is a network server, the Corresponding Source
|
| 563 |
+
may be on a different server (operated by you or a third party)
|
| 564 |
+
that supports equivalent copying facilities, provided you maintain
|
| 565 |
+
clear directions next to the object code saying where to find the
|
| 566 |
+
Corresponding Source. Regardless of what server hosts the
|
| 567 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 568 |
+
available for as long as needed to satisfy these requirements.
|
| 569 |
+
|
| 570 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 571 |
+
you inform other peers where the object code and Corresponding
|
| 572 |
+
Source of the work are being offered to the general public at no
|
| 573 |
+
charge under subsection 6d.
|
| 574 |
+
|
| 575 |
+
A separable portion of the object code, whose source code is excluded
|
| 576 |
+
from the Corresponding Source as a System Library, need not be
|
| 577 |
+
included in conveying the object code work.
|
| 578 |
+
|
| 579 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 580 |
+
tangible personal property which is normally used for personal, family,
|
| 581 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 582 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 583 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 584 |
+
product received by a particular user, "normally used" refers to a
|
| 585 |
+
typical or common use of that class of product, regardless of the status
|
| 586 |
+
of the particular user or of the way in which the particular user
|
| 587 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 588 |
+
is a consumer product regardless of whether the product has substantial
|
| 589 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 590 |
+
the only significant mode of use of the product.
|
| 591 |
+
|
| 592 |
+
"Installation Information" for a User Product means any methods,
|
| 593 |
+
procedures, authorization keys, or other information required to install
|
| 594 |
+
and execute modified versions of a covered work in that User Product from
|
| 595 |
+
a modified version of its Corresponding Source. The information must
|
| 596 |
+
suffice to ensure that the continued functioning of the modified object
|
| 597 |
+
code is in no case prevented or interfered with solely because
|
| 598 |
+
modification has been made.
|
| 599 |
+
|
| 600 |
+
If you convey an object code work under this section in, or with, or
|
| 601 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 602 |
+
part of a transaction in which the right of possession and use of the
|
| 603 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 604 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 605 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 606 |
+
by the Installation Information. But this requirement does not apply
|
| 607 |
+
if neither you nor any third party retains the ability to install
|
| 608 |
+
modified object code on the User Product (for example, the work has
|
| 609 |
+
been installed in ROM).
|
| 610 |
+
|
| 611 |
+
The requirement to provide Installation Information does not include a
|
| 612 |
+
requirement to continue to provide support service, warranty, or updates
|
| 613 |
+
for a work that has been modified or installed by the recipient, or for
|
| 614 |
+
the User Product in which it has been modified or installed. Access to a
|
| 615 |
+
network may be denied when the modification itself materially and
|
| 616 |
+
adversely affects the operation of the network or violates the rules and
|
| 617 |
+
protocols for communication across the network.
|
| 618 |
+
|
| 619 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 620 |
+
in accord with this section must be in a format that is publicly
|
| 621 |
+
documented (and with an implementation available to the public in
|
| 622 |
+
source code form), and must require no special password or key for
|
| 623 |
+
unpacking, reading or copying.
|
| 624 |
+
|
| 625 |
+
7. Additional Terms.
|
| 626 |
+
|
| 627 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 628 |
+
License by making exceptions from one or more of its conditions.
|
| 629 |
+
Additional permissions that are applicable to the entire Program shall
|
| 630 |
+
be treated as though they were included in this License, to the extent
|
| 631 |
+
that they are valid under applicable law. If additional permissions
|
| 632 |
+
apply only to part of the Program, that part may be used separately
|
| 633 |
+
under those permissions, but the entire Program remains governed by
|
| 634 |
+
this License without regard to the additional permissions.
|
| 635 |
+
|
| 636 |
+
When you convey a copy of a covered work, you may at your option
|
| 637 |
+
remove any additional permissions from that copy, or from any part of
|
| 638 |
+
it. (Additional permissions may be written to require their own
|
| 639 |
+
removal in certain cases when you modify the work.) You may place
|
| 640 |
+
additional permissions on material, added by you to a covered work,
|
| 641 |
+
for which you have or can give appropriate copyright permission.
|
| 642 |
+
|
| 643 |
+
Notwithstanding any other provision of this License, for material you
|
| 644 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 645 |
+
that material) supplement the terms of this License with terms:
|
| 646 |
+
|
| 647 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 648 |
+
terms of sections 15 and 16 of this License; or
|
| 649 |
+
|
| 650 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 651 |
+
author attributions in that material or in the Appropriate Legal
|
| 652 |
+
Notices displayed by works containing it; or
|
| 653 |
+
|
| 654 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 655 |
+
requiring that modified versions of such material be marked in
|
| 656 |
+
reasonable ways as different from the original version; or
|
| 657 |
+
|
| 658 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 659 |
+
authors of the material; or
|
| 660 |
+
|
| 661 |
+
e) Declining to grant rights under trademark law for use of some
|
| 662 |
+
trade names, trademarks, or service marks; or
|
| 663 |
+
|
| 664 |
+
f) Requiring indemnification of licensors and authors of that
|
| 665 |
+
material by anyone who conveys the material (or modified versions of
|
| 666 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 667 |
+
any liability that these contractual assumptions directly impose on
|
| 668 |
+
those licensors and authors.
|
| 669 |
+
|
| 670 |
+
All other non-permissive additional terms are considered "further
|
| 671 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 672 |
+
received it, or any part of it, contains a notice stating that it is
|
| 673 |
+
governed by this License along with a term that is a further
|
| 674 |
+
restriction, you may remove that term. If a license document contains
|
| 675 |
+
a further restriction but permits relicensing or conveying under this
|
| 676 |
+
License, you may add to a covered work material governed by the terms
|
| 677 |
+
of that license document, provided that the further restriction does
|
| 678 |
+
not survive such relicensing or conveying.
|
| 679 |
+
|
| 680 |
+
If you add terms to a covered work in accord with this section, you
|
| 681 |
+
must place, in the relevant source files, a statement of the
|
| 682 |
+
additional terms that apply to those files, or a notice indicating
|
| 683 |
+
where to find the applicable terms.
|
| 684 |
+
|
| 685 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 686 |
+
form of a separately written license, or stated as exceptions;
|
| 687 |
+
the above requirements apply either way.
|
| 688 |
+
|
| 689 |
+
8. Termination.
|
| 690 |
+
|
| 691 |
+
You may not propagate or modify a covered work except as expressly
|
| 692 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 693 |
+
modify it is void, and will automatically terminate your rights under
|
| 694 |
+
this License (including any patent licenses granted under the third
|
| 695 |
+
paragraph of section 11).
|
| 696 |
+
|
| 697 |
+
However, if you cease all violation of this License, then your
|
| 698 |
+
license from a particular copyright holder is reinstated (a)
|
| 699 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 700 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 701 |
+
holder fails to notify you of the violation by some reasonable means
|
| 702 |
+
prior to 60 days after the cessation.
|
| 703 |
+
|
| 704 |
+
Moreover, your license from a particular copyright holder is
|
| 705 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 706 |
+
violation by some reasonable means, this is the first time you have
|
| 707 |
+
received notice of violation of this License (for any work) from that
|
| 708 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 709 |
+
your receipt of the notice.
|
| 710 |
+
|
| 711 |
+
Termination of your rights under this section does not terminate the
|
| 712 |
+
licenses of parties who have received copies or rights from you under
|
| 713 |
+
this License. If your rights have been terminated and not permanently
|
| 714 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 715 |
+
material under section 10.
|
| 716 |
+
|
| 717 |
+
9. Acceptance Not Required for Having Copies.
|
| 718 |
+
|
| 719 |
+
You are not required to accept this License in order to receive or
|
| 720 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 721 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 722 |
+
to receive a copy likewise does not require acceptance. However,
|
| 723 |
+
nothing other than this License grants you permission to propagate or
|
| 724 |
+
modify any covered work. These actions infringe copyright if you do
|
| 725 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 726 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 727 |
+
|
| 728 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 729 |
+
|
| 730 |
+
Each time you convey a covered work, the recipient automatically
|
| 731 |
+
receives a license from the original licensors, to run, modify and
|
| 732 |
+
propagate that work, subject to this License. You are not responsible
|
| 733 |
+
for enforcing compliance by third parties with this License.
|
| 734 |
+
|
| 735 |
+
An "entity transaction" is a transaction transferring control of an
|
| 736 |
+
organization, or substantially all assets of one, or subdividing an
|
| 737 |
+
organization, or merging organizations. If propagation of a covered
|
| 738 |
+
work results from an entity transaction, each party to that
|
| 739 |
+
transaction who receives a copy of the work also receives whatever
|
| 740 |
+
licenses to the work the party's predecessor in interest had or could
|
| 741 |
+
give under the previous paragraph, plus a right to possession of the
|
| 742 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 743 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 744 |
+
|
| 745 |
+
You may not impose any further restrictions on the exercise of the
|
| 746 |
+
rights granted or affirmed under this License. For example, you may
|
| 747 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 748 |
+
rights granted under this License, and you may not initiate litigation
|
| 749 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 750 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 751 |
+
sale, or importing the Program or any portion of it.
|
| 752 |
+
|
| 753 |
+
11. Patents.
|
| 754 |
+
|
| 755 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 756 |
+
License of the Program or a work on which the Program is based. The
|
| 757 |
+
work thus licensed is called the contributor's "contributor version".
|
| 758 |
+
|
| 759 |
+
A contributor's "essential patent claims" are all patent claims
|
| 760 |
+
owned or controlled by the contributor, whether already acquired or
|
| 761 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 762 |
+
by this License, of making, using, or selling its contributor version,
|
| 763 |
+
but do not include claims that would be infringed only as a
|
| 764 |
+
consequence of further modification of the contributor version. For
|
| 765 |
+
purposes of this definition, "control" includes the right to grant
|
| 766 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 767 |
+
this License.
|
| 768 |
+
|
| 769 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 770 |
+
patent license under the contributor's essential patent claims, to
|
| 771 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 772 |
+
propagate the contents of its contributor version.
|
| 773 |
+
|
| 774 |
+
In the following three paragraphs, a "patent license" is any express
|
| 775 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 776 |
+
(such as an express permission to practice a patent or covenant not to
|
| 777 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 778 |
+
party means to make such an agreement or commitment not to enforce a
|
| 779 |
+
patent against the party.
|
| 780 |
+
|
| 781 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 782 |
+
and the Corresponding Source of the work is not available for anyone
|
| 783 |
+
to copy, free of charge and under the terms of this License, through a
|
| 784 |
+
publicly available network server or other readily accessible means,
|
| 785 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 786 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 787 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 788 |
+
consistent with the requirements of this License, to extend the patent
|
| 789 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 790 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 791 |
+
covered work in a country, or your recipient's use of the covered work
|
| 792 |
+
in a country, would infringe one or more identifiable patents in that
|
| 793 |
+
country that you have reason to believe are valid.
|
| 794 |
+
|
| 795 |
+
If, pursuant to or in connection with a single transaction or
|
| 796 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 797 |
+
covered work, and grant a patent license to some of the parties
|
| 798 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 799 |
+
or convey a specific copy of the covered work, then the patent license
|
| 800 |
+
you grant is automatically extended to all recipients of the covered
|
| 801 |
+
work and works based on it.
|
| 802 |
+
|
| 803 |
+
A patent license is "discriminatory" if it does not include within
|
| 804 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 805 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 806 |
+
specifically granted under this License. You may not convey a covered
|
| 807 |
+
work if you are a party to an arrangement with a third party that is
|
| 808 |
+
in the business of distributing software, under which you make payment
|
| 809 |
+
to the third party based on the extent of your activity of conveying
|
| 810 |
+
the work, and under which the third party grants, to any of the
|
| 811 |
+
parties who would receive the covered work from you, a discriminatory
|
| 812 |
+
patent license (a) in connection with copies of the covered work
|
| 813 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 814 |
+
for and in connection with specific products or compilations that
|
| 815 |
+
contain the covered work, unless you entered into that arrangement,
|
| 816 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 817 |
+
|
| 818 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 819 |
+
any implied license or other defenses to infringement that may
|
| 820 |
+
otherwise be available to you under applicable patent law.
|
| 821 |
+
|
| 822 |
+
12. No Surrender of Others' Freedom.
|
| 823 |
+
|
| 824 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 825 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 826 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 827 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 828 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 829 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 830 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 831 |
+
the Program, the only way you could satisfy both those terms and this
|
| 832 |
+
License would be to refrain entirely from conveying the Program.
|
| 833 |
+
|
| 834 |
+
13. Use with the GNU Affero General Public License.
|
| 835 |
+
|
| 836 |
+
Notwithstanding any other provision of this License, you have
|
| 837 |
+
permission to link or combine any covered work with a work licensed
|
| 838 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 839 |
+
combined work, and to convey the resulting work. The terms of this
|
| 840 |
+
License will continue to apply to the part which is the covered work,
|
| 841 |
+
but the special requirements of the GNU Affero General Public License,
|
| 842 |
+
section 13, concerning interaction through a network will apply to the
|
| 843 |
+
combination as such.
|
| 844 |
+
|
| 845 |
+
14. Revised Versions of this License.
|
| 846 |
+
|
| 847 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 848 |
+
the GNU General Public License from time to time. Such new versions will
|
| 849 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 850 |
+
address new problems or concerns.
|
| 851 |
+
|
| 852 |
+
Each version is given a distinguishing version number. If the
|
| 853 |
+
Program specifies that a certain numbered version of the GNU General
|
| 854 |
+
Public License "or any later version" applies to it, you have the
|
| 855 |
+
option of following the terms and conditions either of that numbered
|
| 856 |
+
version or of any later version published by the Free Software
|
| 857 |
+
Foundation. If the Program does not specify a version number of the
|
| 858 |
+
GNU General Public License, you may choose any version ever published
|
| 859 |
+
by the Free Software Foundation.
|
| 860 |
+
|
| 861 |
+
If the Program specifies that a proxy can decide which future
|
| 862 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 863 |
+
public statement of acceptance of a version permanently authorizes you
|
| 864 |
+
to choose that version for the Program.
|
| 865 |
+
|
| 866 |
+
Later license versions may give you additional or different
|
| 867 |
+
permissions. However, no additional obligations are imposed on any
|
| 868 |
+
author or copyright holder as a result of your choosing to follow a
|
| 869 |
+
later version.
|
| 870 |
+
|
| 871 |
+
15. Disclaimer of Warranty.
|
| 872 |
+
|
| 873 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 874 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 875 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 876 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 877 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 878 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 879 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 880 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 881 |
+
|
| 882 |
+
16. Limitation of Liability.
|
| 883 |
+
|
| 884 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 885 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 886 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 887 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 888 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 889 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 890 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 891 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 892 |
+
SUCH DAMAGES.
|
| 893 |
+
|
| 894 |
+
17. Interpretation of Sections 15 and 16.
|
| 895 |
+
|
| 896 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 897 |
+
above cannot be given local legal effect according to their terms,
|
| 898 |
+
reviewing courts shall apply local law that most closely approximates
|
| 899 |
+
an absolute waiver of all civil liability in connection with the
|
| 900 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 901 |
+
copy of the Program in return for a fee.
|
| 902 |
+
|
| 903 |
+
END OF TERMS AND CONDITIONS
|
| 904 |
+
|
| 905 |
+
How to Apply These Terms to Your New Programs
|
| 906 |
+
|
| 907 |
+
If you develop a new program, and you want it to be of the greatest
|
| 908 |
+
possible use to the public, the best way to achieve this is to make it
|
| 909 |
+
free software which everyone can redistribute and change under these terms.
|
| 910 |
+
|
| 911 |
+
To do so, attach the following notices to the program. It is safest
|
| 912 |
+
to attach them to the start of each source file to most effectively
|
| 913 |
+
state the exclusion of warranty; and each file should have at least
|
| 914 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 915 |
+
|
| 916 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 917 |
+
Copyright (C) <year> <name of author>
|
| 918 |
+
|
| 919 |
+
This program is free software: you can redistribute it and/or modify
|
| 920 |
+
it under the terms of the GNU General Public License as published by
|
| 921 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 922 |
+
(at your option) any later version.
|
| 923 |
+
|
| 924 |
+
This program is distributed in the hope that it will be useful,
|
| 925 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 926 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 927 |
+
GNU General Public License for more details.
|
| 928 |
+
|
| 929 |
+
You should have received a copy of the GNU General Public License
|
| 930 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 931 |
+
|
| 932 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 933 |
+
|
| 934 |
+
If the program does terminal interaction, make it output a short
|
| 935 |
+
notice like this when it starts in an interactive mode:
|
| 936 |
+
|
| 937 |
+
<program> Copyright (C) <year> <name of author>
|
| 938 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 939 |
+
This is free software, and you are welcome to redistribute it
|
| 940 |
+
under certain conditions; type `show c' for details.
|
| 941 |
+
|
| 942 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 943 |
+
parts of the General Public License. Of course, your program's commands
|
| 944 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 945 |
+
|
| 946 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 947 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 948 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 949 |
+
<http://www.gnu.org/licenses/>.
|
| 950 |
+
|
| 951 |
+
The GNU General Public License does not permit incorporating your program
|
| 952 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 953 |
+
may consider it more useful to permit linking proprietary applications with
|
| 954 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 955 |
+
Public License instead of this License. But first, please read
|
| 956 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
| 957 |
+
|
| 958 |
+
Name: libquadmath
|
| 959 |
+
Files: numpy.libs/libquadmath*.so
|
| 960 |
+
Description: dynamically linked to files compiled with gcc
|
| 961 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
|
| 962 |
+
License: LGPL-2.1-or-later
|
| 963 |
+
|
| 964 |
+
GCC Quad-Precision Math Library
|
| 965 |
+
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
| 966 |
+
Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
| 967 |
+
|
| 968 |
+
This file is part of the libquadmath library.
|
| 969 |
+
Libquadmath is free software; you can redistribute it and/or
|
| 970 |
+
modify it under the terms of the GNU Library General Public
|
| 971 |
+
License as published by the Free Software Foundation; either
|
| 972 |
+
version 2.1 of the License, or (at your option) any later version.
|
| 973 |
+
|
| 974 |
+
Libquadmath is distributed in the hope that it will be useful,
|
| 975 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 976 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 977 |
+
Lesser General Public License for more details.
|
| 978 |
+
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
| 979 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 980 |
+
Classifier: Intended Audience :: Science/Research
|
| 981 |
+
Classifier: Intended Audience :: Developers
|
| 982 |
+
Classifier: License :: OSI Approved :: BSD License
|
| 983 |
+
Classifier: Programming Language :: C
|
| 984 |
+
Classifier: Programming Language :: Python
|
| 985 |
+
Classifier: Programming Language :: Python :: 3
|
| 986 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 987 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 988 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 989 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 990 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 991 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 992 |
+
Classifier: Topic :: Software Development
|
| 993 |
+
Classifier: Topic :: Scientific/Engineering
|
| 994 |
+
Classifier: Typing :: Typed
|
| 995 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 996 |
+
Classifier: Operating System :: POSIX
|
| 997 |
+
Classifier: Operating System :: Unix
|
| 998 |
+
Classifier: Operating System :: MacOS
|
| 999 |
+
Project-URL: Homepage, https://numpy.org
|
| 1000 |
+
Project-URL: Documentation, https://numpy.org/doc/
|
| 1001 |
+
Project-URL: Source, https://github.com/numpy/numpy
|
| 1002 |
+
Project-URL: Download, https://pypi.org/project/numpy/#files
|
| 1003 |
+
Project-URL: Tracker, https://github.com/numpy/numpy/issues
|
| 1004 |
+
Project-URL: Release notes, https://numpy.org/doc/stable/release
|
| 1005 |
+
Requires-Python: >=3.9
|
| 1006 |
+
Description-Content-Type: text/markdown
|
| 1007 |
+
|
| 1008 |
+
<h1 align="center">
|
| 1009 |
+
<img src="https://raw.githubusercontent.com/numpy/numpy/main/branding/logo/primary/numpylogo.svg" width="300">
|
| 1010 |
+
</h1><br>
|
| 1011 |
+
|
| 1012 |
+
|
| 1013 |
+
[](
|
| 1014 |
+
https://numfocus.org)
|
| 1015 |
+
[](
|
| 1016 |
+
https://pypi.org/project/numpy/)
|
| 1017 |
+
[](
|
| 1018 |
+
https://anaconda.org/conda-forge/numpy)
|
| 1019 |
+
[](
|
| 1020 |
+
https://stackoverflow.com/questions/tagged/numpy)
|
| 1021 |
+
[](
|
| 1022 |
+
https://doi.org/10.1038/s41586-020-2649-2)
|
| 1023 |
+
[](https://api.securityscorecards.dev/projects/github.com/numpy/numpy)
|
| 1024 |
+
|
| 1025 |
+
|
| 1026 |
+
NumPy is the fundamental package for scientific computing with Python.
|
| 1027 |
+
|
| 1028 |
+
- **Website:** https://www.numpy.org
|
| 1029 |
+
- **Documentation:** https://numpy.org/doc
|
| 1030 |
+
- **Mailing list:** https://mail.python.org/mailman/listinfo/numpy-discussion
|
| 1031 |
+
- **Source code:** https://github.com/numpy/numpy
|
| 1032 |
+
- **Contributing:** https://www.numpy.org/devdocs/dev/index.html
|
| 1033 |
+
- **Bug reports:** https://github.com/numpy/numpy/issues
|
| 1034 |
+
- **Report a security vulnerability:** https://tidelift.com/docs/security
|
| 1035 |
+
|
| 1036 |
+
It provides:
|
| 1037 |
+
|
| 1038 |
+
- a powerful N-dimensional array object
|
| 1039 |
+
- sophisticated (broadcasting) functions
|
| 1040 |
+
- tools for integrating C/C++ and Fortran code
|
| 1041 |
+
- useful linear algebra, Fourier transform, and random number capabilities
|
| 1042 |
+
|
| 1043 |
+
Testing:
|
| 1044 |
+
|
| 1045 |
+
NumPy requires `pytest` and `hypothesis`. Tests can then be run after installation with:
|
| 1046 |
+
|
| 1047 |
+
python -c "import numpy, sys; sys.exit(numpy.test() is False)"
|
| 1048 |
+
|
| 1049 |
+
Code of Conduct
|
| 1050 |
+
----------------------
|
| 1051 |
+
|
| 1052 |
+
NumPy is a community-driven open source project developed by a diverse group of
|
| 1053 |
+
[contributors](https://numpy.org/teams/). The NumPy leadership has made a strong
|
| 1054 |
+
commitment to creating an open, inclusive, and positive community. Please read the
|
| 1055 |
+
[NumPy Code of Conduct](https://numpy.org/code-of-conduct/) for guidance on how to interact
|
| 1056 |
+
with others in a way that makes our community thrive.
|
| 1057 |
+
|
| 1058 |
+
Call for Contributions
|
| 1059 |
+
----------------------
|
| 1060 |
+
|
| 1061 |
+
The NumPy project welcomes your expertise and enthusiasm!
|
| 1062 |
+
|
| 1063 |
+
Small improvements or fixes are always appreciated. If you are considering larger contributions
|
| 1064 |
+
to the source code, please contact us through the [mailing
|
| 1065 |
+
list](https://mail.python.org/mailman/listinfo/numpy-discussion) first.
|
| 1066 |
+
|
| 1067 |
+
Writing code isn’t the only way to contribute to NumPy. You can also:
|
| 1068 |
+
- review pull requests
|
| 1069 |
+
- help us stay on top of new and old issues
|
| 1070 |
+
- develop tutorials, presentations, and other educational materials
|
| 1071 |
+
- maintain and improve [our website](https://github.com/numpy/numpy.org)
|
| 1072 |
+
- develop graphic design for our brand assets and promotional materials
|
| 1073 |
+
- translate website content
|
| 1074 |
+
- help with outreach and onboard new contributors
|
| 1075 |
+
- write grant proposals and help with other fundraising efforts
|
| 1076 |
+
|
| 1077 |
+
For more information about the ways you can contribute to NumPy, visit [our website](https://numpy.org/contribute/).
|
| 1078 |
+
If you’re unsure where to start or how your skills fit in, reach out! You can
|
| 1079 |
+
ask on the mailing list or here, on GitHub, by opening a new issue or leaving a
|
| 1080 |
+
comment on a relevant issue that is already open.
|
| 1081 |
+
|
| 1082 |
+
Our preferred channels of communication are all public, but if you’d like to
|
| 1083 |
+
speak to us in private first, contact our community coordinators at
|
| 1084 |
+
numpy-team@googlegroups.com or on Slack (write numpy-team@googlegroups.com for
|
| 1085 |
+
an invitation).
|
| 1086 |
+
|
| 1087 |
+
We also have a biweekly community call, details of which are announced on the
|
| 1088 |
+
mailing list. You are very welcome to join.
|
| 1089 |
+
|
| 1090 |
+
If you are new to contributing to open source, [this
|
| 1091 |
+
guide](https://opensource.guide/how-to-contribute/) helps explain why, what,
|
| 1092 |
+
and how to successfully get involved.
|
.venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/RECORD
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
.venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: meson
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp311-cp311-manylinux_2_17_x86_64
|
| 5 |
+
Tag: cp311-cp311-manylinux2014_x86_64
|
| 6 |
+
|
.venv/lib/python3.11/site-packages/numpy-1.26.4.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[array_api]
|
| 2 |
+
numpy = numpy.array_api
|
| 3 |
+
|
| 4 |
+
[pyinstaller40]
|
| 5 |
+
hook-dirs = numpy:_pyinstaller_hooks_dir
|
| 6 |
+
|
| 7 |
+
[console_scripts]
|
| 8 |
+
f2py = numpy.f2py.f2py2e:main
|
| 9 |
+
|
.venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
.venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/License.txt
ADDED
|
@@ -0,0 +1,1568 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
nvidia-compute-license-questions@nvidia.com.
|
| 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 oss-requests@nvidia.com. 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 (ahmad.ahmad@kaust.edu.sa)
|
| 1265 |
+
David Keyes (david.keyes@kaust.edu.sa)
|
| 1266 |
+
Hatem Ltaief (hatem.ltaief@kaust.edu.sa)
|
| 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.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/METADATA
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: nvidia-curand-cu12
|
| 3 |
+
Version: 10.3.5.147
|
| 4 |
+
Summary: CURAND native runtime libraries
|
| 5 |
+
Home-page: https://developer.nvidia.com/cuda-zone
|
| 6 |
+
Author: Nvidia CUDA Installer Team
|
| 7 |
+
Author-email: cuda_installer@nvidia.com
|
| 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 |
+
CURAND native runtime libraries
|
.venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/RECORD
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
nvidia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 2 |
+
nvidia/__pycache__/__init__.cpython-311.pyc,,
|
| 3 |
+
nvidia/curand/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 4 |
+
nvidia/curand/__pycache__/__init__.cpython-311.pyc,,
|
| 5 |
+
nvidia/curand/include/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
nvidia/curand/include/__pycache__/__init__.cpython-311.pyc,,
|
| 7 |
+
nvidia/curand/include/curand.h,sha256=PSwpaDTgFZ4X95KNhip35vChk_nWdB4r086wK1XHqYs,43966
|
| 8 |
+
nvidia/curand/include/curand_discrete.h,sha256=2qD3BkI622XEu0444wVP7HeYkKAx0Rjr2HDhqU4SA7E,3486
|
| 9 |
+
nvidia/curand/include/curand_discrete2.h,sha256=ZrQTO5R9x83AMX88uq7M8M94DLSC5VEz0PAkfcwtQeg,10883
|
| 10 |
+
nvidia/curand/include/curand_globals.h,sha256=bES1Kx0NrATXk1DReMMkqWrB062nOnaAp39y22wViXU,3717
|
| 11 |
+
nvidia/curand/include/curand_kernel.h,sha256=SjfAeh13ybXIxiekcgczzua02kIAqETopJKRhYvCat8,53133
|
| 12 |
+
nvidia/curand/include/curand_lognormal.h,sha256=-X-iNkJSzWpAYYjogm689EJTZfzore9sxU7ObddljLk,28142
|
| 13 |
+
nvidia/curand/include/curand_mrg32k3a.h,sha256=ZVVREjGNsJQJ-3IzZZ_LKGtGteslicb8E0Aly49BKPs,170296
|
| 14 |
+
nvidia/curand/include/curand_mtgp32.h,sha256=Qhrmx0pHWF-P2Uu5bKwYE9ymEWq3c7qBzCITVMaKMfI,7845
|
| 15 |
+
nvidia/curand/include/curand_mtgp32_host.h,sha256=SXqzmSQkzTLSRJ4pojTg_TNCC3T-G89HdBK-boSDqr4,18274
|
| 16 |
+
nvidia/curand/include/curand_mtgp32_kernel.h,sha256=ajZnXr5ZXnQExElf6LPpigrrKPTmMIZbRyTEnJ-BDhw,13731
|
| 17 |
+
nvidia/curand/include/curand_mtgp32dc_p_11213.h,sha256=7_gGYUH47UugIAEt60vYH5nFa-QUwTpDwSEgLg9cZts,276889
|
| 18 |
+
nvidia/curand/include/curand_normal.h,sha256=lnmYVk2fn0oEVWOytdKhXrHL36GLCjMnB8OnZeCaYcA,26953
|
| 19 |
+
nvidia/curand/include/curand_normal_static.h,sha256=5K4iTC9AuSWCe1LVxuj_0y3BVjtp0bxO6hndv2rbmiw,4727
|
| 20 |
+
nvidia/curand/include/curand_philox4x32_x.h,sha256=T21IP-Rdg3_tSVU9Je4dLKuwEqE4ovfwi7r1hOY92Dw,7166
|
| 21 |
+
nvidia/curand/include/curand_poisson.h,sha256=KrhXOmO_D7aclnj8geIyHqdpSQwWHurS9V_pVtgzodM,25461
|
| 22 |
+
nvidia/curand/include/curand_precalc.h,sha256=I6NZdgT42fMm9qSCtP-rlOAqt4Zsqgal0ajktcPmEak,1392393
|
| 23 |
+
nvidia/curand/include/curand_uniform.h,sha256=gpmRgQu5r6ppgLTg60NXoDdVJS6wMUy6jC5bh8l04e8,17472
|
| 24 |
+
nvidia/curand/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 25 |
+
nvidia/curand/lib/__pycache__/__init__.cpython-311.pyc,,
|
| 26 |
+
nvidia/curand/lib/libcurand.so.10,sha256=2rgHS2ELgqhjpC7O2niOmwg2S1Rbq5SFCTBrSMRgGM8,96525744
|
| 27 |
+
nvidia_curand_cu12-10.3.5.147.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 28 |
+
nvidia_curand_cu12-10.3.5.147.dist-info/License.txt,sha256=rW9YU_ugyg0VnQ9Y1JrkmDDC-Mk_epJki5zpCttMbM0,59262
|
| 29 |
+
nvidia_curand_cu12-10.3.5.147.dist-info/METADATA,sha256=dJa5-rFt0tbZqHTScSynDoxiJxHTkFBVBtliv7bhDz0,1507
|
| 30 |
+
nvidia_curand_cu12-10.3.5.147.dist-info/RECORD,,
|
| 31 |
+
nvidia_curand_cu12-10.3.5.147.dist-info/WHEEL,sha256=XDTs3wIbcE-BcRO08VJlZpA6z9OaC1mOKPCGGGwuM2g,109
|
| 32 |
+
nvidia_curand_cu12-10.3.5.147.dist-info/top_level.txt,sha256=fTkAtiFuL16nUrB9ytDDtpytz2t0B4NvYTnRzwAhO14,7
|
.venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.42.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-manylinux2014_x86_64
|
| 5 |
+
|
.venv/lib/python3.11/site-packages/nvidia_curand_cu12-10.3.5.147.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
nvidia
|
.venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
.venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/License.txt
ADDED
|
@@ -0,0 +1,1568 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
nvidia-compute-license-questions@nvidia.com.
|
| 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 oss-requests@nvidia.com. 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 (ahmad.ahmad@kaust.edu.sa)
|
| 1265 |
+
David Keyes (david.keyes@kaust.edu.sa)
|
| 1266 |
+
Hatem Ltaief (hatem.ltaief@kaust.edu.sa)
|
| 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.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/METADATA
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: nvidia-cusolver-cu12
|
| 3 |
+
Version: 11.6.1.9
|
| 4 |
+
Summary: CUDA solver native runtime libraries
|
| 5 |
+
Home-page: https://developer.nvidia.com/cuda-zone
|
| 6 |
+
Author: Nvidia CUDA Installer Team
|
| 7 |
+
Author-email: cuda_installer@nvidia.com
|
| 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 |
+
Requires-Dist: nvidia-cublas-cu12
|
| 35 |
+
Requires-Dist: nvidia-nvjitlink-cu12
|
| 36 |
+
Requires-Dist: nvidia-cusparse-cu12
|
| 37 |
+
|
| 38 |
+
CUDA solver native runtime libraries
|
.venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/RECORD
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
nvidia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 2 |
+
nvidia/__pycache__/__init__.cpython-311.pyc,,
|
| 3 |
+
nvidia/cusolver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 4 |
+
nvidia/cusolver/__pycache__/__init__.cpython-311.pyc,,
|
| 5 |
+
nvidia/cusolver/include/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
nvidia/cusolver/include/__pycache__/__init__.cpython-311.pyc,,
|
| 7 |
+
nvidia/cusolver/include/cusolverDn.h,sha256=ZwkCl1sSSJFEAPIcR45LRiDhYr0lqsx8O0ZHtypY5IQ,149391
|
| 8 |
+
nvidia/cusolver/include/cusolverMg.h,sha256=N8989nnS2BleeMyuftbQgBDJ4sMAkLPSnmy_S_7fxng,11549
|
| 9 |
+
nvidia/cusolver/include/cusolverRf.h,sha256=7BZfWeuMJ8w1Pz4iZeGmwvDZbDNNq0ivG5MHtiATtls,14292
|
| 10 |
+
nvidia/cusolver/include/cusolverSp.h,sha256=8fev0XawDBd0xrOxUlQ3WhclKlUuVAT64zKxwnP8iT0,32561
|
| 11 |
+
nvidia/cusolver/include/cusolverSp_LOWLEVEL_PREVIEW.h,sha256=rTuS0rxwGV3bAz50ua59WVPQ9SvlijORj732oPejoCk,37495
|
| 12 |
+
nvidia/cusolver/include/cusolver_common.h,sha256=PRpWKxS4IUGUl9-Yr1MS5kEVkWcf7yNwTJbn25cXPxI,8731
|
| 13 |
+
nvidia/cusolver/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 14 |
+
nvidia/cusolver/lib/__pycache__/__init__.cpython-311.pyc,,
|
| 15 |
+
nvidia/cusolver/lib/libcusolver.so.11,sha256=syDsTChhs1-SciHay8lHqrgEUJkCSHvkZnASeNblCtY,120220216
|
| 16 |
+
nvidia/cusolver/lib/libcusolverMg.so.11,sha256=R2YnSaKV93G5Kr6NmdzV8VGVPVYGmhn0OXe5eGjsIes,82303400
|
| 17 |
+
nvidia_cusolver_cu12-11.6.1.9.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 18 |
+
nvidia_cusolver_cu12-11.6.1.9.dist-info/License.txt,sha256=rW9YU_ugyg0VnQ9Y1JrkmDDC-Mk_epJki5zpCttMbM0,59262
|
| 19 |
+
nvidia_cusolver_cu12-11.6.1.9.dist-info/METADATA,sha256=GyFsT_e6yEQGoYwHw2EZmgZBEXTF4K07q8dYUOQ-U28,1624
|
| 20 |
+
nvidia_cusolver_cu12-11.6.1.9.dist-info/RECORD,,
|
| 21 |
+
nvidia_cusolver_cu12-11.6.1.9.dist-info/WHEEL,sha256=XDTs3wIbcE-BcRO08VJlZpA6z9OaC1mOKPCGGGwuM2g,109
|
| 22 |
+
nvidia_cusolver_cu12-11.6.1.9.dist-info/top_level.txt,sha256=fTkAtiFuL16nUrB9ytDDtpytz2t0B4NvYTnRzwAhO14,7
|
.venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.42.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-manylinux2014_x86_64
|
| 5 |
+
|
.venv/lib/python3.11/site-packages/nvidia_cusolver_cu12-11.6.1.9.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
nvidia
|
.venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
.venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright 2008 Google Inc. All rights reserved.
|
| 2 |
+
|
| 3 |
+
Redistribution and use in source and binary forms, with or without
|
| 4 |
+
modification, are permitted provided that the following conditions are
|
| 5 |
+
met:
|
| 6 |
+
|
| 7 |
+
* Redistributions of source code must retain the above copyright
|
| 8 |
+
notice, this list of conditions and the following disclaimer.
|
| 9 |
+
* Redistributions in binary form must reproduce the above
|
| 10 |
+
copyright notice, this list of conditions and the following disclaimer
|
| 11 |
+
in the documentation and/or other materials provided with the
|
| 12 |
+
distribution.
|
| 13 |
+
* Neither the name of Google Inc. nor the names of its
|
| 14 |
+
contributors may be used to endorse or promote products derived from
|
| 15 |
+
this software without specific prior written permission.
|
| 16 |
+
|
| 17 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 18 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 19 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 20 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 21 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 22 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 23 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 24 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 25 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 26 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 27 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 28 |
+
|
| 29 |
+
Code generated by the Protocol Buffer compiler is owned by the owner
|
| 30 |
+
of the input file used when generating it. This code is not
|
| 31 |
+
standalone and requires a support library to be linked with it. This
|
| 32 |
+
support library is itself covered by the above license.
|
.venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/METADATA
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: protobuf
|
| 3 |
+
Author: protobuf@googlegroups.com
|
| 4 |
+
Author-email: protobuf@googlegroups.com
|
| 5 |
+
Home-page: https://developers.google.com/protocol-buffers/
|
| 6 |
+
License: 3-Clause BSD License
|
| 7 |
+
Classifier: Programming Language :: Python
|
| 8 |
+
Classifier: Programming Language :: Python :: 3
|
| 9 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 10 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 11 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 12 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 13 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 14 |
+
Requires-Python: >=3.8
|
| 15 |
+
Version: 5.29.3
|
| 16 |
+
|
| 17 |
+
UNKNOWN
|
.venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/RECORD
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
google/_upb/_message.abi3.so,sha256=NNXmkM6cyUNtdgk5dC1t8aCvsljfioOf5_9IxJgJXzA,390920
|
| 2 |
+
google/protobuf/__init__.py,sha256=wZgAgq5MnVvml5NxeeSKxt51dUSWZ_IjRM8nL9INJuo,346
|
| 3 |
+
google/protobuf/__pycache__/__init__.cpython-311.pyc,,
|
| 4 |
+
google/protobuf/__pycache__/any.cpython-311.pyc,,
|
| 5 |
+
google/protobuf/__pycache__/any_pb2.cpython-311.pyc,,
|
| 6 |
+
google/protobuf/__pycache__/api_pb2.cpython-311.pyc,,
|
| 7 |
+
google/protobuf/__pycache__/descriptor.cpython-311.pyc,,
|
| 8 |
+
google/protobuf/__pycache__/descriptor_database.cpython-311.pyc,,
|
| 9 |
+
google/protobuf/__pycache__/descriptor_pb2.cpython-311.pyc,,
|
| 10 |
+
google/protobuf/__pycache__/descriptor_pool.cpython-311.pyc,,
|
| 11 |
+
google/protobuf/__pycache__/duration.cpython-311.pyc,,
|
| 12 |
+
google/protobuf/__pycache__/duration_pb2.cpython-311.pyc,,
|
| 13 |
+
google/protobuf/__pycache__/empty_pb2.cpython-311.pyc,,
|
| 14 |
+
google/protobuf/__pycache__/field_mask_pb2.cpython-311.pyc,,
|
| 15 |
+
google/protobuf/__pycache__/json_format.cpython-311.pyc,,
|
| 16 |
+
google/protobuf/__pycache__/message.cpython-311.pyc,,
|
| 17 |
+
google/protobuf/__pycache__/message_factory.cpython-311.pyc,,
|
| 18 |
+
google/protobuf/__pycache__/proto.cpython-311.pyc,,
|
| 19 |
+
google/protobuf/__pycache__/proto_builder.cpython-311.pyc,,
|
| 20 |
+
google/protobuf/__pycache__/proto_json.cpython-311.pyc,,
|
| 21 |
+
google/protobuf/__pycache__/reflection.cpython-311.pyc,,
|
| 22 |
+
google/protobuf/__pycache__/runtime_version.cpython-311.pyc,,
|
| 23 |
+
google/protobuf/__pycache__/service.cpython-311.pyc,,
|
| 24 |
+
google/protobuf/__pycache__/service_reflection.cpython-311.pyc,,
|
| 25 |
+
google/protobuf/__pycache__/source_context_pb2.cpython-311.pyc,,
|
| 26 |
+
google/protobuf/__pycache__/struct_pb2.cpython-311.pyc,,
|
| 27 |
+
google/protobuf/__pycache__/symbol_database.cpython-311.pyc,,
|
| 28 |
+
google/protobuf/__pycache__/text_encoding.cpython-311.pyc,,
|
| 29 |
+
google/protobuf/__pycache__/text_format.cpython-311.pyc,,
|
| 30 |
+
google/protobuf/__pycache__/timestamp.cpython-311.pyc,,
|
| 31 |
+
google/protobuf/__pycache__/timestamp_pb2.cpython-311.pyc,,
|
| 32 |
+
google/protobuf/__pycache__/type_pb2.cpython-311.pyc,,
|
| 33 |
+
google/protobuf/__pycache__/unknown_fields.cpython-311.pyc,,
|
| 34 |
+
google/protobuf/__pycache__/wrappers_pb2.cpython-311.pyc,,
|
| 35 |
+
google/protobuf/any.py,sha256=AZuOL26Bo8AFFUjHLhh_OQP2ceUJEgOUTqImjxXAJkc,975
|
| 36 |
+
google/protobuf/any_pb2.py,sha256=eSAjMGiijdoGdEkiEUmoe77n7ct83FOZAfwQeQjpljk,1725
|
| 37 |
+
google/protobuf/api_pb2.py,sha256=5yaBnA8cGv3VH8mpA5_Q2rNA5zuUopchFbSsnYpynG8,3145
|
| 38 |
+
google/protobuf/compiler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 39 |
+
google/protobuf/compiler/__pycache__/__init__.cpython-311.pyc,,
|
| 40 |
+
google/protobuf/compiler/__pycache__/plugin_pb2.cpython-311.pyc,,
|
| 41 |
+
google/protobuf/compiler/plugin_pb2.py,sha256=OBvH22GKF5JEB75u2Fx0fgzAOA_vC8qZnZEiulQSQYk,3797
|
| 42 |
+
google/protobuf/descriptor.py,sha256=xM9LaJQJbyt0fxMdJwZdSzCS8tZK4LvHw5Yd2F9KgKU,52253
|
| 43 |
+
google/protobuf/descriptor_database.py,sha256=GDiSu-vBZBZ-L1YHQXSTsbsJMRNY-20icb6pj3ER8E8,5444
|
| 44 |
+
google/protobuf/descriptor_pb2.py,sha256=KWQIQRHJnQH3UBs0jBeGETFDA7OZQpvzDEDI6V5YC6o,343365
|
| 45 |
+
google/protobuf/descriptor_pool.py,sha256=DA5XTv-jmRCJ1O4b_Yswg93KzmFpzaWOPofRGzhXeBY,48430
|
| 46 |
+
google/protobuf/duration.py,sha256=vQTwVyiiyGm3Wy3LW8ohA3tkGkrUKoTn_p4SdEBU8bM,2672
|
| 47 |
+
google/protobuf/duration_pb2.py,sha256=kCK_boGkvLEO3cVyK_Eu6p9RefZhFXShL0_a7BHy9nU,1805
|
| 48 |
+
google/protobuf/empty_pb2.py,sha256=qpOzDZ6xQIcUjSiHfL4HbVeinWkrjW2s9Lqs1XR3yWs,1669
|
| 49 |
+
google/protobuf/field_mask_pb2.py,sha256=owPBO3dezwk8-8FKzGqJZcZMvuaeVcTrpbU6gvyXnfA,1765
|
| 50 |
+
google/protobuf/internal/__init__.py,sha256=8d_k1ksNWIuqPDEEEtOjgC3Xx8kAXD2-04R7mxJlSbs,272
|
| 51 |
+
google/protobuf/internal/__pycache__/__init__.cpython-311.pyc,,
|
| 52 |
+
google/protobuf/internal/__pycache__/_parameterized.cpython-311.pyc,,
|
| 53 |
+
google/protobuf/internal/__pycache__/api_implementation.cpython-311.pyc,,
|
| 54 |
+
google/protobuf/internal/__pycache__/builder.cpython-311.pyc,,
|
| 55 |
+
google/protobuf/internal/__pycache__/containers.cpython-311.pyc,,
|
| 56 |
+
google/protobuf/internal/__pycache__/decoder.cpython-311.pyc,,
|
| 57 |
+
google/protobuf/internal/__pycache__/encoder.cpython-311.pyc,,
|
| 58 |
+
google/protobuf/internal/__pycache__/enum_type_wrapper.cpython-311.pyc,,
|
| 59 |
+
google/protobuf/internal/__pycache__/extension_dict.cpython-311.pyc,,
|
| 60 |
+
google/protobuf/internal/__pycache__/field_mask.cpython-311.pyc,,
|
| 61 |
+
google/protobuf/internal/__pycache__/message_listener.cpython-311.pyc,,
|
| 62 |
+
google/protobuf/internal/__pycache__/python_edition_defaults.cpython-311.pyc,,
|
| 63 |
+
google/protobuf/internal/__pycache__/python_message.cpython-311.pyc,,
|
| 64 |
+
google/protobuf/internal/__pycache__/testing_refleaks.cpython-311.pyc,,
|
| 65 |
+
google/protobuf/internal/__pycache__/type_checkers.cpython-311.pyc,,
|
| 66 |
+
google/protobuf/internal/__pycache__/well_known_types.cpython-311.pyc,,
|
| 67 |
+
google/protobuf/internal/__pycache__/wire_format.cpython-311.pyc,,
|
| 68 |
+
google/protobuf/internal/_parameterized.py,sha256=_LLIH2kmUrI1hZfUlIF8OBcBbbQXgRnm39uB9TpzaHU,14073
|
| 69 |
+
google/protobuf/internal/api_implementation.py,sha256=Qnq9L9thCvgdxlhnGsaNrSCVXmMq_wCZ7-ooRNLVtzs,4787
|
| 70 |
+
google/protobuf/internal/builder.py,sha256=2veSGrr1WphCBOGE3wNXKbVPBkY1-LlSCsKOQH2Nudk,4015
|
| 71 |
+
google/protobuf/internal/containers.py,sha256=CQ0R54YddBf2uWnDqMUnaevr79BdBb1fYM33qsnYSxY,21722
|
| 72 |
+
google/protobuf/internal/decoder.py,sha256=7nDfjyHd67pwky4hNyO_gZKm0IggiAkHF2IfUlO_gMY,36727
|
| 73 |
+
google/protobuf/internal/encoder.py,sha256=Vujp3bU10dLBasUnRaGZKD-ZTLq7zEGA8wKh7mVLR-g,27297
|
| 74 |
+
google/protobuf/internal/enum_type_wrapper.py,sha256=PNhK87a_NP1JIfFHuYFibpE4hHdHYawXwqZxMEtvsvo,3747
|
| 75 |
+
google/protobuf/internal/extension_dict.py,sha256=7bT-5iqa_qw4wkk3QNtCPzGlfPU2h9FDyc5TjF2wiTo,7225
|
| 76 |
+
google/protobuf/internal/field_mask.py,sha256=Ek2eDU8mY1Shj-V2wRmOggXummBv_brbL3XOEVFR6c0,10416
|
| 77 |
+
google/protobuf/internal/message_listener.py,sha256=uh8viU_MvWdDe4Kl14CromKVFAzBMPlMzFZ4vew_UJc,2008
|
| 78 |
+
google/protobuf/internal/python_edition_defaults.py,sha256=72ruAhyM3WEiE8I29ZJZIRp_dOLJoZuBDedecOAW7aQ,434
|
| 79 |
+
google/protobuf/internal/python_message.py,sha256=GkE2xJ3KuVKA3jZonHTgaxOijVzPSQdHMZQTfH10Xzk,58179
|
| 80 |
+
google/protobuf/internal/testing_refleaks.py,sha256=Pp-e8isZv-IwZDOzPaLo9WujUXj_XghNrbV-rHswvL4,4080
|
| 81 |
+
google/protobuf/internal/type_checkers.py,sha256=1W7k9lfyeWML2Hl461xGsKCFJiN63uKBT6vyIKKz9go,15471
|
| 82 |
+
google/protobuf/internal/well_known_types.py,sha256=dv8F2oJXfU2hlBaVbfJ3bWs97bEm1FfKzWHr1-nazSM,22705
|
| 83 |
+
google/protobuf/internal/wire_format.py,sha256=EbAXZdb23iCObCZxNgaMx8-VRF2UjgyPrBCTtV10Rx8,7087
|
| 84 |
+
google/protobuf/json_format.py,sha256=d-27JdC0vA_-A1V3yTuRqR70e4xuXUHy3nbJWs-oLc8,37260
|
| 85 |
+
google/protobuf/message.py,sha256=usc6ma5tUR66le_XDFC6ce7VRX3VvQlrRFCvjshxI-k,14042
|
| 86 |
+
google/protobuf/message_factory.py,sha256=hsMGMC6BJ3ik5vjGGeIG57WLInAf1Vt8G1528XKBprc,8262
|
| 87 |
+
google/protobuf/proto.py,sha256=R-vAuadXJgPhWCeU9nHOQPmAlCvAgnkHIny7DzkkyXo,3500
|
| 88 |
+
google/protobuf/proto_builder.py,sha256=pGU2L_pPEYkylZkrvHMCUH2PFWvc9wI-awwT7F5i740,4203
|
| 89 |
+
google/protobuf/proto_json.py,sha256=fUy0Vb4m_831-oabn7JbzmyipcoJpQWtBdgTMoj8Yp4,3094
|
| 90 |
+
google/protobuf/pyext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 91 |
+
google/protobuf/pyext/__pycache__/__init__.cpython-311.pyc,,
|
| 92 |
+
google/protobuf/pyext/__pycache__/cpp_message.cpython-311.pyc,,
|
| 93 |
+
google/protobuf/pyext/cpp_message.py,sha256=8uSrWX9kD3HPRhntvTPc4bgnfQ2BzX9FPC73CgifXAw,1715
|
| 94 |
+
google/protobuf/reflection.py,sha256=aC4b3fcWr0rYi9DAk29dX3-WW0QxrRUOErzUOywxjsg,2893
|
| 95 |
+
google/protobuf/runtime_version.py,sha256=os6UnDv8YebklH-fqngHvYqWAF0E3BqPAtnrh2R_3Bg,3911
|
| 96 |
+
google/protobuf/service.py,sha256=BkCM4Acflz04MNVtFsPeMVUo_6DDERIq7Dl7g30VGO0,8059
|
| 97 |
+
google/protobuf/service_reflection.py,sha256=WHElGnPgywDtn3X8xKVNsZZOCgJOTzgpAyTd-rmCKGU,10058
|
| 98 |
+
google/protobuf/source_context_pb2.py,sha256=WLSy70L9NfXwMRPstcj75LnYa1xBsGAXubHabsGesFE,1791
|
| 99 |
+
google/protobuf/struct_pb2.py,sha256=_RzUY-mvwPfwsXVZUU2u5-jHs4ot__hpbUnPesqWXdY,3061
|
| 100 |
+
google/protobuf/symbol_database.py,sha256=ruKrtrkuxmFe7uzbJGMgOD7D6Qs2g6jFIRC3aS9NNvU,6709
|
| 101 |
+
google/protobuf/testdata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 102 |
+
google/protobuf/testdata/__pycache__/__init__.cpython-311.pyc,,
|
| 103 |
+
google/protobuf/text_encoding.py,sha256=Ao1Q6OP8i4p8VDtvpe8uW1BjX7aQZvkJggvhFYYrB7w,3621
|
| 104 |
+
google/protobuf/text_format.py,sha256=L-gxTX1L6OEHoVNuFJI2Qtp5QQvsYkJkedCNMtsm55M,63477
|
| 105 |
+
google/protobuf/timestamp.py,sha256=s23LWq6hDiFIeAtVUn8LwfEc5aRM7WAwTz_hCaOVndk,3133
|
| 106 |
+
google/protobuf/timestamp_pb2.py,sha256=92nyQXQuN6ywiT5sOTCpgQOO3waqSlpDoXHLJgbDEZc,1815
|
| 107 |
+
google/protobuf/type_pb2.py,sha256=wxOXDCwWgvTkDN9MfSW-UxPEQY3ifkResYKV8EICa9M,5438
|
| 108 |
+
google/protobuf/unknown_fields.py,sha256=RVMDxyiZcObbb40dMK-xXCAvc5pkyLNSL1y2qzPAUbA,3127
|
| 109 |
+
google/protobuf/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 110 |
+
google/protobuf/util/__pycache__/__init__.cpython-311.pyc,,
|
| 111 |
+
google/protobuf/wrappers_pb2.py,sha256=76GFOCQ5ofdBr0kfF7TzQpSW0XFPN43EyBBxkimuq9o,3037
|
| 112 |
+
protobuf-5.29.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 113 |
+
protobuf-5.29.3.dist-info/LICENSE,sha256=bl4RcySv2UTc9n82zzKYQ7wakiKajNm7Vz16gxMP6n0,1732
|
| 114 |
+
protobuf-5.29.3.dist-info/METADATA,sha256=_Y4y0cn5OJcwvuHFocWr7hlzEt3Ql8mOUpZbPhvyXqs,592
|
| 115 |
+
protobuf-5.29.3.dist-info/RECORD,,
|
| 116 |
+
protobuf-5.29.3.dist-info/WHEEL,sha256=vS6ODHxi8MEFPlH7P2fb6m0CdIf-1Dsx19UF_kqQxLY,110
|
.venv/lib/python3.11/site-packages/protobuf-5.29.3.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bazel-wheelmaker 1.0
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp38-abi3-manylinux2014_x86_64
|
.venv/lib/python3.11/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01808c761f0d8dd6a9530552183cd40999ab2b8c15faedf8d6aa36f4d2e98d24
|
| 3 |
+
size 390349
|
.venv/lib/python3.11/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0240a3a797690612d4beb061048cbf98f042c601c8411b32886ee371095d5e40
|
| 3 |
+
size 425099
|
.venv/lib/python3.11/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f58453cbae686e0de4f81241b5a5892a0a28320d3f3d9e60d82cedb369a3fc2a
|
| 3 |
+
size 343245
|
.venv/lib/python3.11/site-packages/pycparser-2.22.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|