Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/CurImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/FitsImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/FpxImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/FtexImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/GifImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/GimpGradientFile.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/GribStubImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/IcoImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageEnhance.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageFile.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageFont.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageGrab.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageTransform.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageWin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/JpegImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/MspImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/PSDraw.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/PpmImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/XVThumbImagePlugin.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/__init__.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/_tkinter_finder.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/_util.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/PIL/__pycache__/_version.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/__init__.py +46 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_catch.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_exceptions.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_formatting.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_version.cpython-310.pyc +0 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/_catch.py +138 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/_exceptions.py +321 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/_suppress.py +55 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/_version.py +16 -0
- deepseek/lib/python3.10/site-packages/exceptiongroup/py.typed +0 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/INSTALLER +1 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/LICENSE +20 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/METADATA +46 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/RECORD +44 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/REQUESTED +0 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/WHEEL +6 -0
- deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/top_level.txt +2 -0
- deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/__init__.cpython-310.pyc +0 -0
- deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/main.cpython-310.pyc +0 -0
- deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/util.cpython-310.pyc +0 -0
- deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/worker.cpython-310.pyc +0 -0
- deepseekvl2/lib/python3.10/site-packages/sympy/__init__.py +542 -0
- deepseekvl2/lib/python3.10/site-packages/sympy/abc.py +111 -0
- deepseekvl2/lib/python3.10/site-packages/sympy/conftest.py +96 -0
- deepseekvl2/lib/python3.10/site-packages/sympy/discrete/__init__.py +20 -0
- deepseekvl2/lib/python3.10/site-packages/sympy/discrete/__pycache__/__init__.cpython-310.pyc +0 -0
- deepseekvl2/lib/python3.10/site-packages/sympy/discrete/__pycache__/convolutions.cpython-310.pyc +0 -0
deepseek/lib/python3.10/site-packages/PIL/__pycache__/CurImagePlugin.cpython-310.pyc
ADDED
|
Binary file (1.47 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/FitsImagePlugin.cpython-310.pyc
ADDED
|
Binary file (3.74 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/FpxImagePlugin.cpython-310.pyc
ADDED
|
Binary file (4.43 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/FtexImagePlugin.cpython-310.pyc
ADDED
|
Binary file (3.84 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/GifImagePlugin.cpython-310.pyc
ADDED
|
Binary file (22.6 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/GimpGradientFile.cpython-310.pyc
ADDED
|
Binary file (3.7 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/GribStubImagePlugin.cpython-310.pyc
ADDED
|
Binary file (2 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/IcoImagePlugin.cpython-310.pyc
ADDED
|
Binary file (8.01 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageEnhance.cpython-310.pyc
ADDED
|
Binary file (3.71 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageFile.cpython-310.pyc
ADDED
|
Binary file (19.3 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageFont.cpython-310.pyc
ADDED
|
Binary file (58.4 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageGrab.cpython-310.pyc
ADDED
|
Binary file (3.85 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageTransform.cpython-310.pyc
ADDED
|
Binary file (4.63 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/ImageWin.cpython-310.pyc
ADDED
|
Binary file (8.6 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/JpegImagePlugin.cpython-310.pyc
ADDED
|
Binary file (18.9 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/MspImagePlugin.cpython-310.pyc
ADDED
|
Binary file (3.43 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/PSDraw.cpython-310.pyc
ADDED
|
Binary file (6.14 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/PpmImagePlugin.cpython-310.pyc
ADDED
|
Binary file (8.25 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/XVThumbImagePlugin.cpython-310.pyc
ADDED
|
Binary file (1.58 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.93 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/_tkinter_finder.cpython-310.pyc
ADDED
|
Binary file (540 Bytes). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/_util.cpython-310.pyc
ADDED
|
Binary file (1.6 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/PIL/__pycache__/_version.cpython-310.pyc
ADDED
|
Binary file (230 Bytes). View file
|
|
|
deepseek/lib/python3.10/site-packages/exceptiongroup/__init__.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__all__ = [
|
| 2 |
+
"BaseExceptionGroup",
|
| 3 |
+
"ExceptionGroup",
|
| 4 |
+
"catch",
|
| 5 |
+
"format_exception",
|
| 6 |
+
"format_exception_only",
|
| 7 |
+
"print_exception",
|
| 8 |
+
"print_exc",
|
| 9 |
+
"suppress",
|
| 10 |
+
]
|
| 11 |
+
|
| 12 |
+
import os
|
| 13 |
+
import sys
|
| 14 |
+
|
| 15 |
+
from ._catch import catch
|
| 16 |
+
from ._version import version as __version__ # noqa: F401
|
| 17 |
+
|
| 18 |
+
if sys.version_info < (3, 11):
|
| 19 |
+
from ._exceptions import BaseExceptionGroup, ExceptionGroup
|
| 20 |
+
from ._formatting import (
|
| 21 |
+
format_exception,
|
| 22 |
+
format_exception_only,
|
| 23 |
+
print_exc,
|
| 24 |
+
print_exception,
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
if os.getenv("EXCEPTIONGROUP_NO_PATCH") != "1":
|
| 28 |
+
from . import _formatting # noqa: F401
|
| 29 |
+
|
| 30 |
+
BaseExceptionGroup.__module__ = __name__
|
| 31 |
+
ExceptionGroup.__module__ = __name__
|
| 32 |
+
else:
|
| 33 |
+
from traceback import (
|
| 34 |
+
format_exception,
|
| 35 |
+
format_exception_only,
|
| 36 |
+
print_exc,
|
| 37 |
+
print_exception,
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
BaseExceptionGroup = BaseExceptionGroup
|
| 41 |
+
ExceptionGroup = ExceptionGroup
|
| 42 |
+
|
| 43 |
+
if sys.version_info < (3, 12, 1):
|
| 44 |
+
from ._suppress import suppress
|
| 45 |
+
else:
|
| 46 |
+
from contextlib import suppress
|
deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_catch.cpython-310.pyc
ADDED
|
Binary file (3.25 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_exceptions.cpython-310.pyc
ADDED
|
Binary file (9.84 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_formatting.cpython-310.pyc
ADDED
|
Binary file (12.2 kB). View file
|
|
|
deepseek/lib/python3.10/site-packages/exceptiongroup/__pycache__/_version.cpython-310.pyc
ADDED
|
Binary file (491 Bytes). View file
|
|
|
deepseek/lib/python3.10/site-packages/exceptiongroup/_catch.py
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import inspect
|
| 4 |
+
import sys
|
| 5 |
+
from collections.abc import Callable, Iterable, Mapping
|
| 6 |
+
from contextlib import AbstractContextManager
|
| 7 |
+
from types import TracebackType
|
| 8 |
+
from typing import TYPE_CHECKING, Any
|
| 9 |
+
|
| 10 |
+
if sys.version_info < (3, 11):
|
| 11 |
+
from ._exceptions import BaseExceptionGroup
|
| 12 |
+
|
| 13 |
+
if TYPE_CHECKING:
|
| 14 |
+
_Handler = Callable[[BaseExceptionGroup[Any]], Any]
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class _Catcher:
|
| 18 |
+
def __init__(self, handler_map: Mapping[tuple[type[BaseException], ...], _Handler]):
|
| 19 |
+
self._handler_map = handler_map
|
| 20 |
+
|
| 21 |
+
def __enter__(self) -> None:
|
| 22 |
+
pass
|
| 23 |
+
|
| 24 |
+
def __exit__(
|
| 25 |
+
self,
|
| 26 |
+
etype: type[BaseException] | None,
|
| 27 |
+
exc: BaseException | None,
|
| 28 |
+
tb: TracebackType | None,
|
| 29 |
+
) -> bool:
|
| 30 |
+
if exc is not None:
|
| 31 |
+
unhandled = self.handle_exception(exc)
|
| 32 |
+
if unhandled is exc:
|
| 33 |
+
return False
|
| 34 |
+
elif unhandled is None:
|
| 35 |
+
return True
|
| 36 |
+
else:
|
| 37 |
+
if isinstance(exc, BaseExceptionGroup):
|
| 38 |
+
try:
|
| 39 |
+
raise unhandled from exc.__cause__
|
| 40 |
+
except BaseExceptionGroup:
|
| 41 |
+
# Change __context__ to __cause__ because Python 3.11 does this
|
| 42 |
+
# too
|
| 43 |
+
unhandled.__context__ = exc.__cause__
|
| 44 |
+
raise
|
| 45 |
+
|
| 46 |
+
raise unhandled from exc
|
| 47 |
+
|
| 48 |
+
return False
|
| 49 |
+
|
| 50 |
+
def handle_exception(self, exc: BaseException) -> BaseException | None:
|
| 51 |
+
excgroup: BaseExceptionGroup | None
|
| 52 |
+
if isinstance(exc, BaseExceptionGroup):
|
| 53 |
+
excgroup = exc
|
| 54 |
+
else:
|
| 55 |
+
excgroup = BaseExceptionGroup("", [exc])
|
| 56 |
+
|
| 57 |
+
new_exceptions: list[BaseException] = []
|
| 58 |
+
for exc_types, handler in self._handler_map.items():
|
| 59 |
+
matched, excgroup = excgroup.split(exc_types)
|
| 60 |
+
if matched:
|
| 61 |
+
try:
|
| 62 |
+
try:
|
| 63 |
+
raise matched
|
| 64 |
+
except BaseExceptionGroup:
|
| 65 |
+
result = handler(matched)
|
| 66 |
+
except BaseExceptionGroup as new_exc:
|
| 67 |
+
if new_exc is matched:
|
| 68 |
+
new_exceptions.append(new_exc)
|
| 69 |
+
else:
|
| 70 |
+
new_exceptions.extend(new_exc.exceptions)
|
| 71 |
+
except BaseException as new_exc:
|
| 72 |
+
new_exceptions.append(new_exc)
|
| 73 |
+
else:
|
| 74 |
+
if inspect.iscoroutine(result):
|
| 75 |
+
raise TypeError(
|
| 76 |
+
f"Error trying to handle {matched!r} with {handler!r}. "
|
| 77 |
+
"Exception handler must be a sync function."
|
| 78 |
+
) from exc
|
| 79 |
+
|
| 80 |
+
if not excgroup:
|
| 81 |
+
break
|
| 82 |
+
|
| 83 |
+
if new_exceptions:
|
| 84 |
+
if len(new_exceptions) == 1:
|
| 85 |
+
return new_exceptions[0]
|
| 86 |
+
|
| 87 |
+
return BaseExceptionGroup("", new_exceptions)
|
| 88 |
+
elif (
|
| 89 |
+
excgroup and len(excgroup.exceptions) == 1 and excgroup.exceptions[0] is exc
|
| 90 |
+
):
|
| 91 |
+
return exc
|
| 92 |
+
else:
|
| 93 |
+
return excgroup
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def catch(
|
| 97 |
+
__handlers: Mapping[type[BaseException] | Iterable[type[BaseException]], _Handler],
|
| 98 |
+
) -> AbstractContextManager[None]:
|
| 99 |
+
if not isinstance(__handlers, Mapping):
|
| 100 |
+
raise TypeError("the argument must be a mapping")
|
| 101 |
+
|
| 102 |
+
handler_map: dict[
|
| 103 |
+
tuple[type[BaseException], ...], Callable[[BaseExceptionGroup]]
|
| 104 |
+
] = {}
|
| 105 |
+
for type_or_iterable, handler in __handlers.items():
|
| 106 |
+
iterable: tuple[type[BaseException]]
|
| 107 |
+
if isinstance(type_or_iterable, type) and issubclass(
|
| 108 |
+
type_or_iterable, BaseException
|
| 109 |
+
):
|
| 110 |
+
iterable = (type_or_iterable,)
|
| 111 |
+
elif isinstance(type_or_iterable, Iterable):
|
| 112 |
+
iterable = tuple(type_or_iterable)
|
| 113 |
+
else:
|
| 114 |
+
raise TypeError(
|
| 115 |
+
"each key must be either an exception classes or an iterable thereof"
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
if not callable(handler):
|
| 119 |
+
raise TypeError("handlers must be callable")
|
| 120 |
+
|
| 121 |
+
for exc_type in iterable:
|
| 122 |
+
if not isinstance(exc_type, type) or not issubclass(
|
| 123 |
+
exc_type, BaseException
|
| 124 |
+
):
|
| 125 |
+
raise TypeError(
|
| 126 |
+
"each key must be either an exception classes or an iterable "
|
| 127 |
+
"thereof"
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
if issubclass(exc_type, BaseExceptionGroup):
|
| 131 |
+
raise TypeError(
|
| 132 |
+
"catching ExceptionGroup with catch() is not allowed. "
|
| 133 |
+
"Use except instead."
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
handler_map[iterable] = handler
|
| 137 |
+
|
| 138 |
+
return _Catcher(handler_map)
|
deepseek/lib/python3.10/site-packages/exceptiongroup/_exceptions.py
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from collections.abc import Callable, Sequence
|
| 4 |
+
from functools import partial
|
| 5 |
+
from inspect import getmro, isclass
|
| 6 |
+
from typing import TYPE_CHECKING, Generic, Type, TypeVar, cast, overload
|
| 7 |
+
|
| 8 |
+
_BaseExceptionT_co = TypeVar("_BaseExceptionT_co", bound=BaseException, covariant=True)
|
| 9 |
+
_BaseExceptionT = TypeVar("_BaseExceptionT", bound=BaseException)
|
| 10 |
+
_ExceptionT_co = TypeVar("_ExceptionT_co", bound=Exception, covariant=True)
|
| 11 |
+
_ExceptionT = TypeVar("_ExceptionT", bound=Exception)
|
| 12 |
+
# using typing.Self would require a typing_extensions dependency on py<3.11
|
| 13 |
+
_ExceptionGroupSelf = TypeVar("_ExceptionGroupSelf", bound="ExceptionGroup")
|
| 14 |
+
_BaseExceptionGroupSelf = TypeVar("_BaseExceptionGroupSelf", bound="BaseExceptionGroup")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def check_direct_subclass(
|
| 18 |
+
exc: BaseException, parents: tuple[type[BaseException]]
|
| 19 |
+
) -> bool:
|
| 20 |
+
for cls in getmro(exc.__class__)[:-1]:
|
| 21 |
+
if cls in parents:
|
| 22 |
+
return True
|
| 23 |
+
|
| 24 |
+
return False
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def get_condition_filter(
|
| 28 |
+
condition: type[_BaseExceptionT]
|
| 29 |
+
| tuple[type[_BaseExceptionT], ...]
|
| 30 |
+
| Callable[[_BaseExceptionT_co], bool],
|
| 31 |
+
) -> Callable[[_BaseExceptionT_co], bool]:
|
| 32 |
+
if isclass(condition) and issubclass(
|
| 33 |
+
cast(Type[BaseException], condition), BaseException
|
| 34 |
+
):
|
| 35 |
+
return partial(check_direct_subclass, parents=(condition,))
|
| 36 |
+
elif isinstance(condition, tuple):
|
| 37 |
+
if all(isclass(x) and issubclass(x, BaseException) for x in condition):
|
| 38 |
+
return partial(check_direct_subclass, parents=condition)
|
| 39 |
+
elif callable(condition):
|
| 40 |
+
return cast("Callable[[BaseException], bool]", condition)
|
| 41 |
+
|
| 42 |
+
raise TypeError("expected a function, exception type or tuple of exception types")
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def _derive_and_copy_attributes(self, excs):
|
| 46 |
+
eg = self.derive(excs)
|
| 47 |
+
eg.__cause__ = self.__cause__
|
| 48 |
+
eg.__context__ = self.__context__
|
| 49 |
+
eg.__traceback__ = self.__traceback__
|
| 50 |
+
if hasattr(self, "__notes__"):
|
| 51 |
+
# Create a new list so that add_note() only affects one exceptiongroup
|
| 52 |
+
eg.__notes__ = list(self.__notes__)
|
| 53 |
+
return eg
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
class BaseExceptionGroup(BaseException, Generic[_BaseExceptionT_co]):
|
| 57 |
+
"""A combination of multiple unrelated exceptions."""
|
| 58 |
+
|
| 59 |
+
def __new__(
|
| 60 |
+
cls: type[_BaseExceptionGroupSelf],
|
| 61 |
+
__message: str,
|
| 62 |
+
__exceptions: Sequence[_BaseExceptionT_co],
|
| 63 |
+
) -> _BaseExceptionGroupSelf:
|
| 64 |
+
if not isinstance(__message, str):
|
| 65 |
+
raise TypeError(f"argument 1 must be str, not {type(__message)}")
|
| 66 |
+
if not isinstance(__exceptions, Sequence):
|
| 67 |
+
raise TypeError("second argument (exceptions) must be a sequence")
|
| 68 |
+
if not __exceptions:
|
| 69 |
+
raise ValueError(
|
| 70 |
+
"second argument (exceptions) must be a non-empty sequence"
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
for i, exc in enumerate(__exceptions):
|
| 74 |
+
if not isinstance(exc, BaseException):
|
| 75 |
+
raise ValueError(
|
| 76 |
+
f"Item {i} of second argument (exceptions) is not an exception"
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
if cls is BaseExceptionGroup:
|
| 80 |
+
if all(isinstance(exc, Exception) for exc in __exceptions):
|
| 81 |
+
cls = ExceptionGroup
|
| 82 |
+
|
| 83 |
+
if issubclass(cls, Exception):
|
| 84 |
+
for exc in __exceptions:
|
| 85 |
+
if not isinstance(exc, Exception):
|
| 86 |
+
if cls is ExceptionGroup:
|
| 87 |
+
raise TypeError(
|
| 88 |
+
"Cannot nest BaseExceptions in an ExceptionGroup"
|
| 89 |
+
)
|
| 90 |
+
else:
|
| 91 |
+
raise TypeError(
|
| 92 |
+
f"Cannot nest BaseExceptions in {cls.__name__!r}"
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
instance = super().__new__(cls, __message, __exceptions)
|
| 96 |
+
instance._message = __message
|
| 97 |
+
instance._exceptions = __exceptions
|
| 98 |
+
return instance
|
| 99 |
+
|
| 100 |
+
def add_note(self, note: str) -> None:
|
| 101 |
+
if not isinstance(note, str):
|
| 102 |
+
raise TypeError(
|
| 103 |
+
f"Expected a string, got note={note!r} (type {type(note).__name__})"
|
| 104 |
+
)
|
| 105 |
+
|
| 106 |
+
if not hasattr(self, "__notes__"):
|
| 107 |
+
self.__notes__: list[str] = []
|
| 108 |
+
|
| 109 |
+
self.__notes__.append(note)
|
| 110 |
+
|
| 111 |
+
@property
|
| 112 |
+
def message(self) -> str:
|
| 113 |
+
return self._message
|
| 114 |
+
|
| 115 |
+
@property
|
| 116 |
+
def exceptions(
|
| 117 |
+
self,
|
| 118 |
+
) -> tuple[_BaseExceptionT_co | BaseExceptionGroup[_BaseExceptionT_co], ...]:
|
| 119 |
+
return tuple(self._exceptions)
|
| 120 |
+
|
| 121 |
+
@overload
|
| 122 |
+
def subgroup(
|
| 123 |
+
self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...]
|
| 124 |
+
) -> ExceptionGroup[_ExceptionT] | None: ...
|
| 125 |
+
|
| 126 |
+
@overload
|
| 127 |
+
def subgroup(
|
| 128 |
+
self, __condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...]
|
| 129 |
+
) -> BaseExceptionGroup[_BaseExceptionT] | None: ...
|
| 130 |
+
|
| 131 |
+
@overload
|
| 132 |
+
def subgroup(
|
| 133 |
+
self,
|
| 134 |
+
__condition: Callable[[_BaseExceptionT_co | _BaseExceptionGroupSelf], bool],
|
| 135 |
+
) -> BaseExceptionGroup[_BaseExceptionT_co] | None: ...
|
| 136 |
+
|
| 137 |
+
def subgroup(
|
| 138 |
+
self,
|
| 139 |
+
__condition: type[_BaseExceptionT]
|
| 140 |
+
| tuple[type[_BaseExceptionT], ...]
|
| 141 |
+
| Callable[[_BaseExceptionT_co | _BaseExceptionGroupSelf], bool],
|
| 142 |
+
) -> BaseExceptionGroup[_BaseExceptionT] | None:
|
| 143 |
+
condition = get_condition_filter(__condition)
|
| 144 |
+
modified = False
|
| 145 |
+
if condition(self):
|
| 146 |
+
return self
|
| 147 |
+
|
| 148 |
+
exceptions: list[BaseException] = []
|
| 149 |
+
for exc in self.exceptions:
|
| 150 |
+
if isinstance(exc, BaseExceptionGroup):
|
| 151 |
+
subgroup = exc.subgroup(__condition)
|
| 152 |
+
if subgroup is not None:
|
| 153 |
+
exceptions.append(subgroup)
|
| 154 |
+
|
| 155 |
+
if subgroup is not exc:
|
| 156 |
+
modified = True
|
| 157 |
+
elif condition(exc):
|
| 158 |
+
exceptions.append(exc)
|
| 159 |
+
else:
|
| 160 |
+
modified = True
|
| 161 |
+
|
| 162 |
+
if not modified:
|
| 163 |
+
return self
|
| 164 |
+
elif exceptions:
|
| 165 |
+
group = _derive_and_copy_attributes(self, exceptions)
|
| 166 |
+
return group
|
| 167 |
+
else:
|
| 168 |
+
return None
|
| 169 |
+
|
| 170 |
+
@overload
|
| 171 |
+
def split(
|
| 172 |
+
self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...]
|
| 173 |
+
) -> tuple[
|
| 174 |
+
ExceptionGroup[_ExceptionT] | None,
|
| 175 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 176 |
+
]: ...
|
| 177 |
+
|
| 178 |
+
@overload
|
| 179 |
+
def split(
|
| 180 |
+
self, __condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...]
|
| 181 |
+
) -> tuple[
|
| 182 |
+
BaseExceptionGroup[_BaseExceptionT] | None,
|
| 183 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 184 |
+
]: ...
|
| 185 |
+
|
| 186 |
+
@overload
|
| 187 |
+
def split(
|
| 188 |
+
self,
|
| 189 |
+
__condition: Callable[[_BaseExceptionT_co | _BaseExceptionGroupSelf], bool],
|
| 190 |
+
) -> tuple[
|
| 191 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 192 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 193 |
+
]: ...
|
| 194 |
+
|
| 195 |
+
def split(
|
| 196 |
+
self,
|
| 197 |
+
__condition: type[_BaseExceptionT]
|
| 198 |
+
| tuple[type[_BaseExceptionT], ...]
|
| 199 |
+
| Callable[[_BaseExceptionT_co], bool],
|
| 200 |
+
) -> (
|
| 201 |
+
tuple[
|
| 202 |
+
ExceptionGroup[_ExceptionT] | None,
|
| 203 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 204 |
+
]
|
| 205 |
+
| tuple[
|
| 206 |
+
BaseExceptionGroup[_BaseExceptionT] | None,
|
| 207 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 208 |
+
]
|
| 209 |
+
| tuple[
|
| 210 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 211 |
+
BaseExceptionGroup[_BaseExceptionT_co] | None,
|
| 212 |
+
]
|
| 213 |
+
):
|
| 214 |
+
condition = get_condition_filter(__condition)
|
| 215 |
+
if condition(self):
|
| 216 |
+
return self, None
|
| 217 |
+
|
| 218 |
+
matching_exceptions: list[BaseException] = []
|
| 219 |
+
nonmatching_exceptions: list[BaseException] = []
|
| 220 |
+
for exc in self.exceptions:
|
| 221 |
+
if isinstance(exc, BaseExceptionGroup):
|
| 222 |
+
matching, nonmatching = exc.split(condition)
|
| 223 |
+
if matching is not None:
|
| 224 |
+
matching_exceptions.append(matching)
|
| 225 |
+
|
| 226 |
+
if nonmatching is not None:
|
| 227 |
+
nonmatching_exceptions.append(nonmatching)
|
| 228 |
+
elif condition(exc):
|
| 229 |
+
matching_exceptions.append(exc)
|
| 230 |
+
else:
|
| 231 |
+
nonmatching_exceptions.append(exc)
|
| 232 |
+
|
| 233 |
+
matching_group: _BaseExceptionGroupSelf | None = None
|
| 234 |
+
if matching_exceptions:
|
| 235 |
+
matching_group = _derive_and_copy_attributes(self, matching_exceptions)
|
| 236 |
+
|
| 237 |
+
nonmatching_group: _BaseExceptionGroupSelf | None = None
|
| 238 |
+
if nonmatching_exceptions:
|
| 239 |
+
nonmatching_group = _derive_and_copy_attributes(
|
| 240 |
+
self, nonmatching_exceptions
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
return matching_group, nonmatching_group
|
| 244 |
+
|
| 245 |
+
@overload
|
| 246 |
+
def derive(self, __excs: Sequence[_ExceptionT]) -> ExceptionGroup[_ExceptionT]: ...
|
| 247 |
+
|
| 248 |
+
@overload
|
| 249 |
+
def derive(
|
| 250 |
+
self, __excs: Sequence[_BaseExceptionT]
|
| 251 |
+
) -> BaseExceptionGroup[_BaseExceptionT]: ...
|
| 252 |
+
|
| 253 |
+
def derive(
|
| 254 |
+
self, __excs: Sequence[_BaseExceptionT]
|
| 255 |
+
) -> BaseExceptionGroup[_BaseExceptionT]:
|
| 256 |
+
return BaseExceptionGroup(self.message, __excs)
|
| 257 |
+
|
| 258 |
+
def __str__(self) -> str:
|
| 259 |
+
suffix = "" if len(self._exceptions) == 1 else "s"
|
| 260 |
+
return f"{self.message} ({len(self._exceptions)} sub-exception{suffix})"
|
| 261 |
+
|
| 262 |
+
def __repr__(self) -> str:
|
| 263 |
+
return f"{self.__class__.__name__}({self.message!r}, {self._exceptions!r})"
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
class ExceptionGroup(BaseExceptionGroup[_ExceptionT_co], Exception):
|
| 267 |
+
def __new__(
|
| 268 |
+
cls: type[_ExceptionGroupSelf],
|
| 269 |
+
__message: str,
|
| 270 |
+
__exceptions: Sequence[_ExceptionT_co],
|
| 271 |
+
) -> _ExceptionGroupSelf:
|
| 272 |
+
return super().__new__(cls, __message, __exceptions)
|
| 273 |
+
|
| 274 |
+
if TYPE_CHECKING:
|
| 275 |
+
|
| 276 |
+
@property
|
| 277 |
+
def exceptions(
|
| 278 |
+
self,
|
| 279 |
+
) -> tuple[_ExceptionT_co | ExceptionGroup[_ExceptionT_co], ...]: ...
|
| 280 |
+
|
| 281 |
+
@overload # type: ignore[override]
|
| 282 |
+
def subgroup(
|
| 283 |
+
self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...]
|
| 284 |
+
) -> ExceptionGroup[_ExceptionT] | None: ...
|
| 285 |
+
|
| 286 |
+
@overload
|
| 287 |
+
def subgroup(
|
| 288 |
+
self, __condition: Callable[[_ExceptionT_co | _ExceptionGroupSelf], bool]
|
| 289 |
+
) -> ExceptionGroup[_ExceptionT_co] | None: ...
|
| 290 |
+
|
| 291 |
+
def subgroup(
|
| 292 |
+
self,
|
| 293 |
+
__condition: type[_ExceptionT]
|
| 294 |
+
| tuple[type[_ExceptionT], ...]
|
| 295 |
+
| Callable[[_ExceptionT_co], bool],
|
| 296 |
+
) -> ExceptionGroup[_ExceptionT] | None:
|
| 297 |
+
return super().subgroup(__condition)
|
| 298 |
+
|
| 299 |
+
@overload
|
| 300 |
+
def split(
|
| 301 |
+
self, __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...]
|
| 302 |
+
) -> tuple[
|
| 303 |
+
ExceptionGroup[_ExceptionT] | None, ExceptionGroup[_ExceptionT_co] | None
|
| 304 |
+
]: ...
|
| 305 |
+
|
| 306 |
+
@overload
|
| 307 |
+
def split(
|
| 308 |
+
self, __condition: Callable[[_ExceptionT_co | _ExceptionGroupSelf], bool]
|
| 309 |
+
) -> tuple[
|
| 310 |
+
ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None
|
| 311 |
+
]: ...
|
| 312 |
+
|
| 313 |
+
def split(
|
| 314 |
+
self: _ExceptionGroupSelf,
|
| 315 |
+
__condition: type[_ExceptionT]
|
| 316 |
+
| tuple[type[_ExceptionT], ...]
|
| 317 |
+
| Callable[[_ExceptionT_co], bool],
|
| 318 |
+
) -> tuple[
|
| 319 |
+
ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None
|
| 320 |
+
]:
|
| 321 |
+
return super().split(__condition)
|
deepseek/lib/python3.10/site-packages/exceptiongroup/_suppress.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import sys
|
| 4 |
+
from contextlib import AbstractContextManager
|
| 5 |
+
from types import TracebackType
|
| 6 |
+
from typing import TYPE_CHECKING, Optional, Type, cast
|
| 7 |
+
|
| 8 |
+
if sys.version_info < (3, 11):
|
| 9 |
+
from ._exceptions import BaseExceptionGroup
|
| 10 |
+
|
| 11 |
+
if TYPE_CHECKING:
|
| 12 |
+
# requires python 3.9
|
| 13 |
+
BaseClass = AbstractContextManager[None]
|
| 14 |
+
else:
|
| 15 |
+
BaseClass = AbstractContextManager
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class suppress(BaseClass):
|
| 19 |
+
"""Backport of :class:`contextlib.suppress` from Python 3.12.1."""
|
| 20 |
+
|
| 21 |
+
def __init__(self, *exceptions: type[BaseException]):
|
| 22 |
+
self._exceptions = exceptions
|
| 23 |
+
|
| 24 |
+
def __enter__(self) -> None:
|
| 25 |
+
pass
|
| 26 |
+
|
| 27 |
+
def __exit__(
|
| 28 |
+
self,
|
| 29 |
+
exctype: Optional[Type[BaseException]],
|
| 30 |
+
excinst: Optional[BaseException],
|
| 31 |
+
exctb: Optional[TracebackType],
|
| 32 |
+
) -> bool:
|
| 33 |
+
# Unlike isinstance and issubclass, CPython exception handling
|
| 34 |
+
# currently only looks at the concrete type hierarchy (ignoring
|
| 35 |
+
# the instance and subclass checking hooks). While Guido considers
|
| 36 |
+
# that a bug rather than a feature, it's a fairly hard one to fix
|
| 37 |
+
# due to various internal implementation details. suppress provides
|
| 38 |
+
# the simpler issubclass based semantics, rather than trying to
|
| 39 |
+
# exactly reproduce the limitations of the CPython interpreter.
|
| 40 |
+
#
|
| 41 |
+
# See http://bugs.python.org/issue12029 for more details
|
| 42 |
+
if exctype is None:
|
| 43 |
+
return False
|
| 44 |
+
|
| 45 |
+
if issubclass(exctype, self._exceptions):
|
| 46 |
+
return True
|
| 47 |
+
|
| 48 |
+
if issubclass(exctype, BaseExceptionGroup):
|
| 49 |
+
match, rest = cast(BaseExceptionGroup, excinst).split(self._exceptions)
|
| 50 |
+
if rest is None:
|
| 51 |
+
return True
|
| 52 |
+
|
| 53 |
+
raise rest
|
| 54 |
+
|
| 55 |
+
return False
|
deepseek/lib/python3.10/site-packages/exceptiongroup/_version.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# file generated by setuptools_scm
|
| 2 |
+
# don't change, don't track in version control
|
| 3 |
+
TYPE_CHECKING = False
|
| 4 |
+
if TYPE_CHECKING:
|
| 5 |
+
from typing import Tuple, Union
|
| 6 |
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
| 7 |
+
else:
|
| 8 |
+
VERSION_TUPLE = object
|
| 9 |
+
|
| 10 |
+
version: str
|
| 11 |
+
__version__: str
|
| 12 |
+
__version_tuple__: VERSION_TUPLE
|
| 13 |
+
version_tuple: VERSION_TUPLE
|
| 14 |
+
|
| 15 |
+
__version__ = version = '1.2.2'
|
| 16 |
+
__version_tuple__ = version_tuple = (1, 2, 2)
|
deepseek/lib/python3.10/site-packages/exceptiongroup/py.typed
ADDED
|
File without changes
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2017-2021 Ingy döt Net
|
| 2 |
+
Copyright (c) 2006-2016 Kirill Simonov
|
| 3 |
+
|
| 4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
| 5 |
+
this software and associated documentation files (the "Software"), to deal in
|
| 6 |
+
the Software without restriction, including without limitation the rights to
|
| 7 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
| 8 |
+
of the Software, and to permit persons to whom the Software is furnished to do
|
| 9 |
+
so, subject to the following conditions:
|
| 10 |
+
|
| 11 |
+
The above copyright notice and this permission notice shall be included in all
|
| 12 |
+
copies or substantial portions of the Software.
|
| 13 |
+
|
| 14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 15 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 16 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 17 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 18 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 19 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 20 |
+
SOFTWARE.
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/METADATA
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: PyYAML
|
| 3 |
+
Version: 6.0.2
|
| 4 |
+
Summary: YAML parser and emitter for Python
|
| 5 |
+
Home-page: https://pyyaml.org/
|
| 6 |
+
Download-URL: https://pypi.org/project/PyYAML/
|
| 7 |
+
Author: Kirill Simonov
|
| 8 |
+
Author-email: xi@resolvent.net
|
| 9 |
+
License: MIT
|
| 10 |
+
Project-URL: Bug Tracker, https://github.com/yaml/pyyaml/issues
|
| 11 |
+
Project-URL: CI, https://github.com/yaml/pyyaml/actions
|
| 12 |
+
Project-URL: Documentation, https://pyyaml.org/wiki/PyYAMLDocumentation
|
| 13 |
+
Project-URL: Mailing lists, http://lists.sourceforge.net/lists/listinfo/yaml-core
|
| 14 |
+
Project-URL: Source Code, https://github.com/yaml/pyyaml
|
| 15 |
+
Platform: Any
|
| 16 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 17 |
+
Classifier: Intended Audience :: Developers
|
| 18 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 19 |
+
Classifier: Operating System :: OS Independent
|
| 20 |
+
Classifier: Programming Language :: Cython
|
| 21 |
+
Classifier: Programming Language :: Python
|
| 22 |
+
Classifier: Programming Language :: Python :: 3
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 26 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 27 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 28 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 29 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 30 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 31 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 32 |
+
Classifier: Topic :: Text Processing :: Markup
|
| 33 |
+
Requires-Python: >=3.8
|
| 34 |
+
License-File: LICENSE
|
| 35 |
+
|
| 36 |
+
YAML is a data serialization format designed for human readability
|
| 37 |
+
and interaction with scripting languages. PyYAML is a YAML parser
|
| 38 |
+
and emitter for Python.
|
| 39 |
+
|
| 40 |
+
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
|
| 41 |
+
support, capable extension API, and sensible error messages. PyYAML
|
| 42 |
+
supports standard YAML tags and provides Python-specific tags that
|
| 43 |
+
allow to represent an arbitrary Python object.
|
| 44 |
+
|
| 45 |
+
PyYAML is applicable for a broad range of tasks from complex
|
| 46 |
+
configuration files to object serialization and persistence.
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/RECORD
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
PyYAML-6.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
PyYAML-6.0.2.dist-info/LICENSE,sha256=jTko-dxEkP1jVwfLiOsmvXZBAqcoKVQwfT5RZ6V36KQ,1101
|
| 3 |
+
PyYAML-6.0.2.dist-info/METADATA,sha256=9-odFB5seu4pGPcEv7E8iyxNF51_uKnaNGjLAhz2lto,2060
|
| 4 |
+
PyYAML-6.0.2.dist-info/RECORD,,
|
| 5 |
+
PyYAML-6.0.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
PyYAML-6.0.2.dist-info/WHEEL,sha256=baMMpUvyD0gnRdCe6fvqCg8rft4FNTdLqZQ01WfKJmc,152
|
| 7 |
+
PyYAML-6.0.2.dist-info/top_level.txt,sha256=rpj0IVMTisAjh_1vG3Ccf9v5jpCQwAz6cD1IVU5ZdhQ,11
|
| 8 |
+
_yaml/__init__.py,sha256=04Ae_5osxahpJHa3XBZUAf4wi6XX32gR8D6X6p64GEA,1402
|
| 9 |
+
_yaml/__pycache__/__init__.cpython-310.pyc,,
|
| 10 |
+
yaml/__init__.py,sha256=N35S01HMesFTe0aRRMWkPj0Pa8IEbHpE9FK7cr5Bdtw,12311
|
| 11 |
+
yaml/__pycache__/__init__.cpython-310.pyc,,
|
| 12 |
+
yaml/__pycache__/composer.cpython-310.pyc,,
|
| 13 |
+
yaml/__pycache__/constructor.cpython-310.pyc,,
|
| 14 |
+
yaml/__pycache__/cyaml.cpython-310.pyc,,
|
| 15 |
+
yaml/__pycache__/dumper.cpython-310.pyc,,
|
| 16 |
+
yaml/__pycache__/emitter.cpython-310.pyc,,
|
| 17 |
+
yaml/__pycache__/error.cpython-310.pyc,,
|
| 18 |
+
yaml/__pycache__/events.cpython-310.pyc,,
|
| 19 |
+
yaml/__pycache__/loader.cpython-310.pyc,,
|
| 20 |
+
yaml/__pycache__/nodes.cpython-310.pyc,,
|
| 21 |
+
yaml/__pycache__/parser.cpython-310.pyc,,
|
| 22 |
+
yaml/__pycache__/reader.cpython-310.pyc,,
|
| 23 |
+
yaml/__pycache__/representer.cpython-310.pyc,,
|
| 24 |
+
yaml/__pycache__/resolver.cpython-310.pyc,,
|
| 25 |
+
yaml/__pycache__/scanner.cpython-310.pyc,,
|
| 26 |
+
yaml/__pycache__/serializer.cpython-310.pyc,,
|
| 27 |
+
yaml/__pycache__/tokens.cpython-310.pyc,,
|
| 28 |
+
yaml/_yaml.cpython-310-x86_64-linux-gnu.so,sha256=20HV-cVpIFuOuVUTmQ1-PQIbyt0n8ctfXq7JCMIfbrU,2383664
|
| 29 |
+
yaml/composer.py,sha256=_Ko30Wr6eDWUeUpauUGT3Lcg9QPBnOPVlTnIMRGJ9FM,4883
|
| 30 |
+
yaml/constructor.py,sha256=kNgkfaeLUkwQYY_Q6Ff1Tz2XVw_pG1xVE9Ak7z-viLA,28639
|
| 31 |
+
yaml/cyaml.py,sha256=6ZrAG9fAYvdVe2FK_w0hmXoG7ZYsoYUwapG8CiC72H0,3851
|
| 32 |
+
yaml/dumper.py,sha256=PLctZlYwZLp7XmeUdwRuv4nYOZ2UBnDIUy8-lKfLF-o,2837
|
| 33 |
+
yaml/emitter.py,sha256=jghtaU7eFwg31bG0B7RZea_29Adi9CKmXq_QjgQpCkQ,43006
|
| 34 |
+
yaml/error.py,sha256=Ah9z-toHJUbE9j-M8YpxgSRM5CgLCcwVzJgLLRF2Fxo,2533
|
| 35 |
+
yaml/events.py,sha256=50_TksgQiE4up-lKo_V-nBy-tAIxkIPQxY5qDhKCeHw,2445
|
| 36 |
+
yaml/loader.py,sha256=UVa-zIqmkFSCIYq_PgSGm4NSJttHY2Rf_zQ4_b1fHN0,2061
|
| 37 |
+
yaml/nodes.py,sha256=gPKNj8pKCdh2d4gr3gIYINnPOaOxGhJAUiYhGRnPE84,1440
|
| 38 |
+
yaml/parser.py,sha256=ilWp5vvgoHFGzvOZDItFoGjD6D42nhlZrZyjAwa0oJo,25495
|
| 39 |
+
yaml/reader.py,sha256=0dmzirOiDG4Xo41RnuQS7K9rkY3xjHiVasfDMNTqCNw,6794
|
| 40 |
+
yaml/representer.py,sha256=IuWP-cAW9sHKEnS0gCqSa894k1Bg4cgTxaDwIcbRQ-Y,14190
|
| 41 |
+
yaml/resolver.py,sha256=9L-VYfm4mWHxUD1Vg4X7rjDRK_7VZd6b92wzq7Y2IKY,9004
|
| 42 |
+
yaml/scanner.py,sha256=YEM3iLZSaQwXcQRg2l2R4MdT0zGP2F9eHkKGKnHyWQY,51279
|
| 43 |
+
yaml/serializer.py,sha256=ChuFgmhU01hj4xgI8GaKv6vfM2Bujwa9i7d2FAHj7cA,4165
|
| 44 |
+
yaml/tokens.py,sha256=lTQIzSVw8Mg9wv459-TjiOQe6wVziqaRlqX2_89rp54,2573
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/REQUESTED
ADDED
|
File without changes
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: bdist_wheel (0.44.0)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp310-cp310-manylinux_2_17_x86_64
|
| 5 |
+
Tag: cp310-cp310-manylinux2014_x86_64
|
| 6 |
+
|
deepseekvl2/lib/python3.10/site-packages/PyYAML-6.0.2.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_yaml
|
| 2 |
+
yaml
|
deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (480 Bytes). View file
|
|
|
deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/main.cpython-310.pyc
ADDED
|
Binary file (11.6 kB). View file
|
|
|
deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/util.cpython-310.pyc
ADDED
|
Binary file (13.6 kB). View file
|
|
|
deepseekvl2/lib/python3.10/site-packages/lit/__pycache__/worker.cpython-310.pyc
ADDED
|
Binary file (2.51 kB). View file
|
|
|
deepseekvl2/lib/python3.10/site-packages/sympy/__init__.py
ADDED
|
@@ -0,0 +1,542 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
SymPy is a Python library for symbolic mathematics. It aims to become a
|
| 3 |
+
full-featured computer algebra system (CAS) while keeping the code as simple
|
| 4 |
+
as possible in order to be comprehensible and easily extensible. SymPy is
|
| 5 |
+
written entirely in Python. It depends on mpmath, and other external libraries
|
| 6 |
+
may be optionally for things like plotting support.
|
| 7 |
+
|
| 8 |
+
See the webpage for more information and documentation:
|
| 9 |
+
|
| 10 |
+
https://sympy.org
|
| 11 |
+
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
import sys
|
| 16 |
+
if sys.version_info < (3, 8):
|
| 17 |
+
raise ImportError("Python version 3.8 or above is required for SymPy.")
|
| 18 |
+
del sys
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
try:
|
| 22 |
+
import mpmath
|
| 23 |
+
except ImportError:
|
| 24 |
+
raise ImportError("SymPy now depends on mpmath as an external library. "
|
| 25 |
+
"See https://docs.sympy.org/latest/install.html#mpmath for more information.")
|
| 26 |
+
|
| 27 |
+
del mpmath
|
| 28 |
+
|
| 29 |
+
from sympy.release import __version__
|
| 30 |
+
from sympy.core.cache import lazy_function
|
| 31 |
+
|
| 32 |
+
if 'dev' in __version__:
|
| 33 |
+
def enable_warnings():
|
| 34 |
+
import warnings
|
| 35 |
+
warnings.filterwarnings('default', '.*', DeprecationWarning, module='sympy.*')
|
| 36 |
+
del warnings
|
| 37 |
+
enable_warnings()
|
| 38 |
+
del enable_warnings
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def __sympy_debug():
|
| 42 |
+
# helper function so we don't import os globally
|
| 43 |
+
import os
|
| 44 |
+
debug_str = os.getenv('SYMPY_DEBUG', 'False')
|
| 45 |
+
if debug_str in ('True', 'False'):
|
| 46 |
+
return eval(debug_str)
|
| 47 |
+
else:
|
| 48 |
+
raise RuntimeError("unrecognized value for SYMPY_DEBUG: %s" %
|
| 49 |
+
debug_str)
|
| 50 |
+
SYMPY_DEBUG = __sympy_debug() # type: bool
|
| 51 |
+
|
| 52 |
+
from .core import (sympify, SympifyError, cacheit, Basic, Atom,
|
| 53 |
+
preorder_traversal, S, Expr, AtomicExpr, UnevaluatedExpr, Symbol,
|
| 54 |
+
Wild, Dummy, symbols, var, Number, Float, Rational, Integer,
|
| 55 |
+
NumberSymbol, RealNumber, igcd, ilcm, seterr, E, I, nan, oo, pi, zoo,
|
| 56 |
+
AlgebraicNumber, comp, mod_inverse, Pow, integer_nthroot, integer_log,
|
| 57 |
+
trailing, Mul, prod, Add, Mod, Rel, Eq, Ne, Lt, Le, Gt, Ge, Equality,
|
| 58 |
+
GreaterThan, LessThan, Unequality, StrictGreaterThan, StrictLessThan,
|
| 59 |
+
vectorize, Lambda, WildFunction, Derivative, diff, FunctionClass,
|
| 60 |
+
Function, Subs, expand, PoleError, count_ops, expand_mul, expand_log,
|
| 61 |
+
expand_func, expand_trig, expand_complex, expand_multinomial, nfloat,
|
| 62 |
+
expand_power_base, expand_power_exp, arity, PrecisionExhausted, N,
|
| 63 |
+
evalf, Tuple, Dict, gcd_terms, factor_terms, factor_nc, evaluate,
|
| 64 |
+
Catalan, EulerGamma, GoldenRatio, TribonacciConstant, bottom_up, use,
|
| 65 |
+
postorder_traversal, default_sort_key, ordered, num_digits)
|
| 66 |
+
|
| 67 |
+
from .logic import (to_cnf, to_dnf, to_nnf, And, Or, Not, Xor, Nand, Nor,
|
| 68 |
+
Implies, Equivalent, ITE, POSform, SOPform, simplify_logic, bool_map,
|
| 69 |
+
true, false, satisfiable)
|
| 70 |
+
|
| 71 |
+
from .assumptions import (AppliedPredicate, Predicate, AssumptionsContext,
|
| 72 |
+
assuming, Q, ask, register_handler, remove_handler, refine)
|
| 73 |
+
|
| 74 |
+
from .polys import (Poly, PurePoly, poly_from_expr, parallel_poly_from_expr,
|
| 75 |
+
degree, total_degree, degree_list, LC, LM, LT, pdiv, prem, pquo,
|
| 76 |
+
pexquo, div, rem, quo, exquo, half_gcdex, gcdex, invert,
|
| 77 |
+
subresultants, resultant, discriminant, cofactors, gcd_list, gcd,
|
| 78 |
+
lcm_list, lcm, terms_gcd, trunc, monic, content, primitive, compose,
|
| 79 |
+
decompose, sturm, gff_list, gff, sqf_norm, sqf_part, sqf_list, sqf,
|
| 80 |
+
factor_list, factor, intervals, refine_root, count_roots, all_roots,
|
| 81 |
+
real_roots, nroots, ground_roots, nth_power_roots_poly, cancel,
|
| 82 |
+
reduced, groebner, is_zero_dimensional, GroebnerBasis, poly,
|
| 83 |
+
symmetrize, horner, interpolate, rational_interpolate, viete, together,
|
| 84 |
+
BasePolynomialError, ExactQuotientFailed, PolynomialDivisionFailed,
|
| 85 |
+
OperationNotSupported, HeuristicGCDFailed, HomomorphismFailed,
|
| 86 |
+
IsomorphismFailed, ExtraneousFactors, EvaluationFailed,
|
| 87 |
+
RefinementFailed, CoercionFailed, NotInvertible, NotReversible,
|
| 88 |
+
NotAlgebraic, DomainError, PolynomialError, UnificationFailed,
|
| 89 |
+
GeneratorsError, GeneratorsNeeded, ComputationFailed,
|
| 90 |
+
UnivariatePolynomialError, MultivariatePolynomialError,
|
| 91 |
+
PolificationFailed, OptionError, FlagError, minpoly,
|
| 92 |
+
minimal_polynomial, primitive_element, field_isomorphism,
|
| 93 |
+
to_number_field, isolate, round_two, prime_decomp, prime_valuation,
|
| 94 |
+
galois_group, itermonomials, Monomial, lex, grlex,
|
| 95 |
+
grevlex, ilex, igrlex, igrevlex, CRootOf, rootof, RootOf,
|
| 96 |
+
ComplexRootOf, RootSum, roots, Domain, FiniteField, IntegerRing,
|
| 97 |
+
RationalField, RealField, ComplexField, PythonFiniteField,
|
| 98 |
+
GMPYFiniteField, PythonIntegerRing, GMPYIntegerRing, PythonRational,
|
| 99 |
+
GMPYRationalField, AlgebraicField, PolynomialRing, FractionField,
|
| 100 |
+
ExpressionDomain, FF_python, FF_gmpy, ZZ_python, ZZ_gmpy, QQ_python,
|
| 101 |
+
QQ_gmpy, GF, FF, ZZ, QQ, ZZ_I, QQ_I, RR, CC, EX, EXRAW,
|
| 102 |
+
construct_domain, swinnerton_dyer_poly, cyclotomic_poly,
|
| 103 |
+
symmetric_poly, random_poly, interpolating_poly, jacobi_poly,
|
| 104 |
+
chebyshevt_poly, chebyshevu_poly, hermite_poly, hermite_prob_poly,
|
| 105 |
+
legendre_poly, laguerre_poly, apart, apart_list, assemble_partfrac_list,
|
| 106 |
+
Options, ring, xring, vring, sring, field, xfield, vfield, sfield)
|
| 107 |
+
|
| 108 |
+
from .series import (Order, O, limit, Limit, gruntz, series, approximants,
|
| 109 |
+
residue, EmptySequence, SeqPer, SeqFormula, sequence, SeqAdd, SeqMul,
|
| 110 |
+
fourier_series, fps, difference_delta, limit_seq)
|
| 111 |
+
|
| 112 |
+
from .functions import (factorial, factorial2, rf, ff, binomial,
|
| 113 |
+
RisingFactorial, FallingFactorial, subfactorial, carmichael,
|
| 114 |
+
fibonacci, lucas, motzkin, tribonacci, harmonic, bernoulli, bell, euler,
|
| 115 |
+
catalan, genocchi, andre, partition, divisor_sigma, legendre_symbol,
|
| 116 |
+
jacobi_symbol, kronecker_symbol, mobius, primenu, primeomega,
|
| 117 |
+
totient, reduced_totient, primepi, sqrt, root, Min, Max, Id,
|
| 118 |
+
real_root, Rem, cbrt, re, im, sign, Abs, conjugate, arg, polar_lift,
|
| 119 |
+
periodic_argument, unbranched_argument, principal_branch, transpose,
|
| 120 |
+
adjoint, polarify, unpolarify, sin, cos, tan, sec, csc, cot, sinc,
|
| 121 |
+
asin, acos, atan, asec, acsc, acot, atan2, exp_polar, exp, ln, log,
|
| 122 |
+
LambertW, sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh,
|
| 123 |
+
acoth, asech, acsch, floor, ceiling, frac, Piecewise, piecewise_fold,
|
| 124 |
+
piecewise_exclusive, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv,
|
| 125 |
+
Ei, expint, E1, li, Li, Si, Ci, Shi, Chi, fresnels, fresnelc, gamma,
|
| 126 |
+
lowergamma, uppergamma, polygamma, loggamma, digamma, trigamma,
|
| 127 |
+
multigamma, dirichlet_eta, zeta, lerchphi, polylog, stieltjes, Eijk,
|
| 128 |
+
LeviCivita, KroneckerDelta, SingularityFunction, DiracDelta, Heaviside,
|
| 129 |
+
bspline_basis, bspline_basis_set, interpolating_spline, besselj,
|
| 130 |
+
bessely, besseli, besselk, hankel1, hankel2, jn, yn, jn_zeros, hn1,
|
| 131 |
+
hn2, airyai, airybi, airyaiprime, airybiprime, marcumq, hyper,
|
| 132 |
+
meijerg, appellf1, legendre, assoc_legendre, hermite, hermite_prob,
|
| 133 |
+
chebyshevt, chebyshevu, chebyshevu_root, chebyshevt_root, laguerre,
|
| 134 |
+
assoc_laguerre, gegenbauer, jacobi, jacobi_normalized, Ynm, Ynm_c,
|
| 135 |
+
Znm, elliptic_k, elliptic_f, elliptic_e, elliptic_pi, beta, mathieus,
|
| 136 |
+
mathieuc, mathieusprime, mathieucprime, riemann_xi, betainc, betainc_regularized)
|
| 137 |
+
|
| 138 |
+
from .ntheory import (nextprime, prevprime, prime, primerange,
|
| 139 |
+
randprime, Sieve, sieve, primorial, cycle_length, composite,
|
| 140 |
+
compositepi, isprime, divisors, proper_divisors, factorint,
|
| 141 |
+
multiplicity, perfect_power, pollard_pm1, pollard_rho, primefactors,
|
| 142 |
+
divisor_count, proper_divisor_count,
|
| 143 |
+
factorrat,
|
| 144 |
+
mersenne_prime_exponent, is_perfect, is_mersenne_prime, is_abundant,
|
| 145 |
+
is_deficient, is_amicable, is_carmichael, abundance, npartitions, is_primitive_root,
|
| 146 |
+
is_quad_residue, n_order, sqrt_mod,
|
| 147 |
+
quadratic_residues, primitive_root, nthroot_mod, is_nthpow_residue,
|
| 148 |
+
sqrt_mod_iter, discrete_log, quadratic_congruence,
|
| 149 |
+
binomial_coefficients, binomial_coefficients_list,
|
| 150 |
+
multinomial_coefficients, continued_fraction_periodic,
|
| 151 |
+
continued_fraction_iterator, continued_fraction_reduce,
|
| 152 |
+
continued_fraction_convergents, continued_fraction, egyptian_fraction)
|
| 153 |
+
|
| 154 |
+
from .concrete import product, Product, summation, Sum
|
| 155 |
+
|
| 156 |
+
from .discrete import (fft, ifft, ntt, intt, fwht, ifwht, mobius_transform,
|
| 157 |
+
inverse_mobius_transform, convolution, covering_product,
|
| 158 |
+
intersecting_product)
|
| 159 |
+
|
| 160 |
+
from .simplify import (simplify, hypersimp, hypersimilar, logcombine,
|
| 161 |
+
separatevars, posify, besselsimp, kroneckersimp, signsimp,
|
| 162 |
+
nsimplify, FU, fu, sqrtdenest, cse, epath, EPath, hyperexpand,
|
| 163 |
+
collect, rcollect, radsimp, collect_const, fraction, numer, denom,
|
| 164 |
+
trigsimp, exptrigsimp, powsimp, powdenest, combsimp, gammasimp,
|
| 165 |
+
ratsimp, ratsimpmodprime)
|
| 166 |
+
|
| 167 |
+
from .sets import (Set, Interval, Union, EmptySet, FiniteSet, ProductSet,
|
| 168 |
+
Intersection, DisjointUnion, imageset, Complement, SymmetricDifference, ImageSet,
|
| 169 |
+
Range, ComplexRegion, Complexes, Reals, Contains, ConditionSet, Ordinal,
|
| 170 |
+
OmegaPower, ord0, PowerSet, Naturals, Naturals0, UniversalSet,
|
| 171 |
+
Integers, Rationals)
|
| 172 |
+
|
| 173 |
+
from .solvers import (solve, solve_linear_system, solve_linear_system_LU,
|
| 174 |
+
solve_undetermined_coeffs, nsolve, solve_linear, checksol, det_quick,
|
| 175 |
+
inv_quick, check_assumptions, failing_assumptions, diophantine,
|
| 176 |
+
rsolve, rsolve_poly, rsolve_ratio, rsolve_hyper, checkodesol,
|
| 177 |
+
classify_ode, dsolve, homogeneous_order, solve_poly_system,
|
| 178 |
+
solve_triangulated, pde_separate, pde_separate_add, pde_separate_mul,
|
| 179 |
+
pdsolve, classify_pde, checkpdesol, ode_order, reduce_inequalities,
|
| 180 |
+
reduce_abs_inequality, reduce_abs_inequalities, solve_poly_inequality,
|
| 181 |
+
solve_rational_inequalities, solve_univariate_inequality, decompogen,
|
| 182 |
+
solveset, linsolve, linear_eq_to_matrix, nonlinsolve, substitution)
|
| 183 |
+
|
| 184 |
+
from .matrices import (ShapeError, NonSquareMatrixError, GramSchmidt,
|
| 185 |
+
casoratian, diag, eye, hessian, jordan_cell, list2numpy, matrix2numpy,
|
| 186 |
+
matrix_multiply_elementwise, ones, randMatrix, rot_axis1, rot_axis2,
|
| 187 |
+
rot_axis3, symarray, wronskian, zeros, MutableDenseMatrix,
|
| 188 |
+
DeferredVector, MatrixBase, Matrix, MutableMatrix,
|
| 189 |
+
MutableSparseMatrix, banded, ImmutableDenseMatrix,
|
| 190 |
+
ImmutableSparseMatrix, ImmutableMatrix, SparseMatrix, MatrixSlice,
|
| 191 |
+
BlockDiagMatrix, BlockMatrix, FunctionMatrix, Identity, Inverse,
|
| 192 |
+
MatAdd, MatMul, MatPow, MatrixExpr, MatrixSymbol, Trace, Transpose,
|
| 193 |
+
ZeroMatrix, OneMatrix, blockcut, block_collapse, matrix_symbols,
|
| 194 |
+
Adjoint, hadamard_product, HadamardProduct, HadamardPower,
|
| 195 |
+
Determinant, det, diagonalize_vector, DiagMatrix, DiagonalMatrix,
|
| 196 |
+
DiagonalOf, trace, DotProduct, kronecker_product, KroneckerProduct,
|
| 197 |
+
PermutationMatrix, MatrixPermute, Permanent, per, rot_ccw_axis1,
|
| 198 |
+
rot_ccw_axis2, rot_ccw_axis3, rot_givens)
|
| 199 |
+
|
| 200 |
+
from .geometry import (Point, Point2D, Point3D, Line, Ray, Segment, Line2D,
|
| 201 |
+
Segment2D, Ray2D, Line3D, Segment3D, Ray3D, Plane, Ellipse, Circle,
|
| 202 |
+
Polygon, RegularPolygon, Triangle, rad, deg, are_similar, centroid,
|
| 203 |
+
convex_hull, idiff, intersection, closest_points, farthest_points,
|
| 204 |
+
GeometryError, Curve, Parabola)
|
| 205 |
+
|
| 206 |
+
from .utilities import (flatten, group, take, subsets, variations,
|
| 207 |
+
numbered_symbols, cartes, capture, dict_merge, prefixes, postfixes,
|
| 208 |
+
sift, topological_sort, unflatten, has_dups, has_variety, reshape,
|
| 209 |
+
rotations, filldedent, lambdify,
|
| 210 |
+
threaded, xthreaded, public, memoize_property, timed)
|
| 211 |
+
|
| 212 |
+
from .integrals import (integrate, Integral, line_integrate, mellin_transform,
|
| 213 |
+
inverse_mellin_transform, MellinTransform, InverseMellinTransform,
|
| 214 |
+
laplace_transform, laplace_correspondence, laplace_initial_conds,
|
| 215 |
+
inverse_laplace_transform, LaplaceTransform,
|
| 216 |
+
InverseLaplaceTransform, fourier_transform, inverse_fourier_transform,
|
| 217 |
+
FourierTransform, InverseFourierTransform, sine_transform,
|
| 218 |
+
inverse_sine_transform, SineTransform, InverseSineTransform,
|
| 219 |
+
cosine_transform, inverse_cosine_transform, CosineTransform,
|
| 220 |
+
InverseCosineTransform, hankel_transform, inverse_hankel_transform,
|
| 221 |
+
HankelTransform, InverseHankelTransform, singularityintegrate)
|
| 222 |
+
|
| 223 |
+
from .tensor import (IndexedBase, Idx, Indexed, get_contraction_structure,
|
| 224 |
+
get_indices, shape, MutableDenseNDimArray, ImmutableDenseNDimArray,
|
| 225 |
+
MutableSparseNDimArray, ImmutableSparseNDimArray, NDimArray,
|
| 226 |
+
tensorproduct, tensorcontraction, tensordiagonal, derive_by_array,
|
| 227 |
+
permutedims, Array, DenseNDimArray, SparseNDimArray)
|
| 228 |
+
|
| 229 |
+
from .parsing import parse_expr
|
| 230 |
+
|
| 231 |
+
from .calculus import (euler_equations, singularities, is_increasing,
|
| 232 |
+
is_strictly_increasing, is_decreasing, is_strictly_decreasing,
|
| 233 |
+
is_monotonic, finite_diff_weights, apply_finite_diff,
|
| 234 |
+
differentiate_finite, periodicity, not_empty_in, AccumBounds,
|
| 235 |
+
is_convex, stationary_points, minimum, maximum)
|
| 236 |
+
|
| 237 |
+
from .algebras import Quaternion
|
| 238 |
+
|
| 239 |
+
from .printing import (pager_print, pretty, pretty_print, pprint,
|
| 240 |
+
pprint_use_unicode, pprint_try_use_unicode, latex, print_latex,
|
| 241 |
+
multiline_latex, mathml, print_mathml, python, print_python, pycode,
|
| 242 |
+
ccode, print_ccode, smtlib_code, glsl_code, print_glsl, cxxcode, fcode,
|
| 243 |
+
print_fcode, rcode, print_rcode, jscode, print_jscode, julia_code,
|
| 244 |
+
mathematica_code, octave_code, rust_code, print_gtk, preview, srepr,
|
| 245 |
+
print_tree, StrPrinter, sstr, sstrrepr, TableForm, dotprint,
|
| 246 |
+
maple_code, print_maple_code)
|
| 247 |
+
|
| 248 |
+
test = lazy_function('sympy.testing.runtests_pytest', 'test')
|
| 249 |
+
doctest = lazy_function('sympy.testing.runtests', 'doctest')
|
| 250 |
+
|
| 251 |
+
# This module causes conflicts with other modules:
|
| 252 |
+
# from .stats import *
|
| 253 |
+
# Adds about .04-.05 seconds of import time
|
| 254 |
+
# from combinatorics import *
|
| 255 |
+
# This module is slow to import:
|
| 256 |
+
#from physics import units
|
| 257 |
+
from .plotting import plot, textplot, plot_backends, plot_implicit, plot_parametric
|
| 258 |
+
from .interactive import init_session, init_printing, interactive_traversal
|
| 259 |
+
|
| 260 |
+
evalf._create_evalf_table()
|
| 261 |
+
|
| 262 |
+
__all__ = [
|
| 263 |
+
'__version__',
|
| 264 |
+
|
| 265 |
+
# sympy.core
|
| 266 |
+
'sympify', 'SympifyError', 'cacheit', 'Basic', 'Atom',
|
| 267 |
+
'preorder_traversal', 'S', 'Expr', 'AtomicExpr', 'UnevaluatedExpr',
|
| 268 |
+
'Symbol', 'Wild', 'Dummy', 'symbols', 'var', 'Number', 'Float',
|
| 269 |
+
'Rational', 'Integer', 'NumberSymbol', 'RealNumber', 'igcd', 'ilcm',
|
| 270 |
+
'seterr', 'E', 'I', 'nan', 'oo', 'pi', 'zoo', 'AlgebraicNumber', 'comp',
|
| 271 |
+
'mod_inverse', 'Pow', 'integer_nthroot', 'integer_log', 'trailing', 'Mul', 'prod',
|
| 272 |
+
'Add', 'Mod', 'Rel', 'Eq', 'Ne', 'Lt', 'Le', 'Gt', 'Ge', 'Equality',
|
| 273 |
+
'GreaterThan', 'LessThan', 'Unequality', 'StrictGreaterThan',
|
| 274 |
+
'StrictLessThan', 'vectorize', 'Lambda', 'WildFunction', 'Derivative',
|
| 275 |
+
'diff', 'FunctionClass', 'Function', 'Subs', 'expand', 'PoleError',
|
| 276 |
+
'count_ops', 'expand_mul', 'expand_log', 'expand_func', 'expand_trig',
|
| 277 |
+
'expand_complex', 'expand_multinomial', 'nfloat', 'expand_power_base',
|
| 278 |
+
'expand_power_exp', 'arity', 'PrecisionExhausted', 'N', 'evalf', 'Tuple',
|
| 279 |
+
'Dict', 'gcd_terms', 'factor_terms', 'factor_nc', 'evaluate', 'Catalan',
|
| 280 |
+
'EulerGamma', 'GoldenRatio', 'TribonacciConstant', 'bottom_up', 'use',
|
| 281 |
+
'postorder_traversal', 'default_sort_key', 'ordered', 'num_digits',
|
| 282 |
+
|
| 283 |
+
# sympy.logic
|
| 284 |
+
'to_cnf', 'to_dnf', 'to_nnf', 'And', 'Or', 'Not', 'Xor', 'Nand', 'Nor',
|
| 285 |
+
'Implies', 'Equivalent', 'ITE', 'POSform', 'SOPform', 'simplify_logic',
|
| 286 |
+
'bool_map', 'true', 'false', 'satisfiable',
|
| 287 |
+
|
| 288 |
+
# sympy.assumptions
|
| 289 |
+
'AppliedPredicate', 'Predicate', 'AssumptionsContext', 'assuming', 'Q',
|
| 290 |
+
'ask', 'register_handler', 'remove_handler', 'refine',
|
| 291 |
+
|
| 292 |
+
# sympy.polys
|
| 293 |
+
'Poly', 'PurePoly', 'poly_from_expr', 'parallel_poly_from_expr', 'degree',
|
| 294 |
+
'total_degree', 'degree_list', 'LC', 'LM', 'LT', 'pdiv', 'prem', 'pquo',
|
| 295 |
+
'pexquo', 'div', 'rem', 'quo', 'exquo', 'half_gcdex', 'gcdex', 'invert',
|
| 296 |
+
'subresultants', 'resultant', 'discriminant', 'cofactors', 'gcd_list',
|
| 297 |
+
'gcd', 'lcm_list', 'lcm', 'terms_gcd', 'trunc', 'monic', 'content',
|
| 298 |
+
'primitive', 'compose', 'decompose', 'sturm', 'gff_list', 'gff',
|
| 299 |
+
'sqf_norm', 'sqf_part', 'sqf_list', 'sqf', 'factor_list', 'factor',
|
| 300 |
+
'intervals', 'refine_root', 'count_roots', 'all_roots', 'real_roots',
|
| 301 |
+
'nroots', 'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced',
|
| 302 |
+
'groebner', 'is_zero_dimensional', 'GroebnerBasis', 'poly', 'symmetrize',
|
| 303 |
+
'horner', 'interpolate', 'rational_interpolate', 'viete', 'together',
|
| 304 |
+
'BasePolynomialError', 'ExactQuotientFailed', 'PolynomialDivisionFailed',
|
| 305 |
+
'OperationNotSupported', 'HeuristicGCDFailed', 'HomomorphismFailed',
|
| 306 |
+
'IsomorphismFailed', 'ExtraneousFactors', 'EvaluationFailed',
|
| 307 |
+
'RefinementFailed', 'CoercionFailed', 'NotInvertible', 'NotReversible',
|
| 308 |
+
'NotAlgebraic', 'DomainError', 'PolynomialError', 'UnificationFailed',
|
| 309 |
+
'GeneratorsError', 'GeneratorsNeeded', 'ComputationFailed',
|
| 310 |
+
'UnivariatePolynomialError', 'MultivariatePolynomialError',
|
| 311 |
+
'PolificationFailed', 'OptionError', 'FlagError', 'minpoly',
|
| 312 |
+
'minimal_polynomial', 'primitive_element', 'field_isomorphism',
|
| 313 |
+
'to_number_field', 'isolate', 'round_two', 'prime_decomp',
|
| 314 |
+
'prime_valuation', 'galois_group', 'itermonomials', 'Monomial', 'lex', 'grlex',
|
| 315 |
+
'grevlex', 'ilex', 'igrlex', 'igrevlex', 'CRootOf', 'rootof', 'RootOf',
|
| 316 |
+
'ComplexRootOf', 'RootSum', 'roots', 'Domain', 'FiniteField',
|
| 317 |
+
'IntegerRing', 'RationalField', 'RealField', 'ComplexField',
|
| 318 |
+
'PythonFiniteField', 'GMPYFiniteField', 'PythonIntegerRing',
|
| 319 |
+
'GMPYIntegerRing', 'PythonRational', 'GMPYRationalField',
|
| 320 |
+
'AlgebraicField', 'PolynomialRing', 'FractionField', 'ExpressionDomain',
|
| 321 |
+
'FF_python', 'FF_gmpy', 'ZZ_python', 'ZZ_gmpy', 'QQ_python', 'QQ_gmpy',
|
| 322 |
+
'GF', 'FF', 'ZZ', 'QQ', 'ZZ_I', 'QQ_I', 'RR', 'CC', 'EX', 'EXRAW',
|
| 323 |
+
'construct_domain', 'swinnerton_dyer_poly', 'cyclotomic_poly',
|
| 324 |
+
'symmetric_poly', 'random_poly', 'interpolating_poly', 'jacobi_poly',
|
| 325 |
+
'chebyshevt_poly', 'chebyshevu_poly', 'hermite_poly', 'hermite_prob_poly',
|
| 326 |
+
'legendre_poly', 'laguerre_poly', 'apart', 'apart_list', 'assemble_partfrac_list',
|
| 327 |
+
'Options', 'ring', 'xring', 'vring', 'sring', 'field', 'xfield', 'vfield',
|
| 328 |
+
'sfield',
|
| 329 |
+
|
| 330 |
+
# sympy.series
|
| 331 |
+
'Order', 'O', 'limit', 'Limit', 'gruntz', 'series', 'approximants',
|
| 332 |
+
'residue', 'EmptySequence', 'SeqPer', 'SeqFormula', 'sequence', 'SeqAdd',
|
| 333 |
+
'SeqMul', 'fourier_series', 'fps', 'difference_delta', 'limit_seq',
|
| 334 |
+
|
| 335 |
+
# sympy.functions
|
| 336 |
+
'factorial', 'factorial2', 'rf', 'ff', 'binomial', 'RisingFactorial',
|
| 337 |
+
'FallingFactorial', 'subfactorial', 'carmichael', 'fibonacci', 'lucas',
|
| 338 |
+
'motzkin', 'tribonacci', 'harmonic', 'bernoulli', 'bell', 'euler', 'catalan',
|
| 339 |
+
'genocchi', 'andre', 'partition', 'divisor_sigma', 'legendre_symbol', 'jacobi_symbol',
|
| 340 |
+
'kronecker_symbol', 'mobius', 'primenu', 'primeomega', 'totient', 'primepi',
|
| 341 |
+
'reduced_totient', 'sqrt', 'root', 'Min', 'Max', 'Id', 'real_root',
|
| 342 |
+
'Rem', 'cbrt', 're', 'im', 'sign', 'Abs', 'conjugate', 'arg', 'polar_lift',
|
| 343 |
+
'periodic_argument', 'unbranched_argument', 'principal_branch',
|
| 344 |
+
'transpose', 'adjoint', 'polarify', 'unpolarify', 'sin', 'cos', 'tan',
|
| 345 |
+
'sec', 'csc', 'cot', 'sinc', 'asin', 'acos', 'atan', 'asec', 'acsc',
|
| 346 |
+
'acot', 'atan2', 'exp_polar', 'exp', 'ln', 'log', 'LambertW', 'sinh',
|
| 347 |
+
'cosh', 'tanh', 'coth', 'sech', 'csch', 'asinh', 'acosh', 'atanh',
|
| 348 |
+
'acoth', 'asech', 'acsch', 'floor', 'ceiling', 'frac', 'Piecewise',
|
| 349 |
+
'piecewise_fold', 'piecewise_exclusive', 'erf', 'erfc', 'erfi', 'erf2',
|
| 350 |
+
'erfinv', 'erfcinv', 'erf2inv', 'Ei', 'expint', 'E1', 'li', 'Li', 'Si',
|
| 351 |
+
'Ci', 'Shi', 'Chi', 'fresnels', 'fresnelc', 'gamma', 'lowergamma',
|
| 352 |
+
'uppergamma', 'polygamma', 'loggamma', 'digamma', 'trigamma', 'multigamma',
|
| 353 |
+
'dirichlet_eta', 'zeta', 'lerchphi', 'polylog', 'stieltjes', 'Eijk', 'LeviCivita',
|
| 354 |
+
'KroneckerDelta', 'SingularityFunction', 'DiracDelta', 'Heaviside',
|
| 355 |
+
'bspline_basis', 'bspline_basis_set', 'interpolating_spline', 'besselj',
|
| 356 |
+
'bessely', 'besseli', 'besselk', 'hankel1', 'hankel2', 'jn', 'yn',
|
| 357 |
+
'jn_zeros', 'hn1', 'hn2', 'airyai', 'airybi', 'airyaiprime',
|
| 358 |
+
'airybiprime', 'marcumq', 'hyper', 'meijerg', 'appellf1', 'legendre',
|
| 359 |
+
'assoc_legendre', 'hermite', 'hermite_prob', 'chebyshevt', 'chebyshevu',
|
| 360 |
+
'chebyshevu_root', 'chebyshevt_root', 'laguerre', 'assoc_laguerre',
|
| 361 |
+
'gegenbauer', 'jacobi', 'jacobi_normalized', 'Ynm', 'Ynm_c', 'Znm',
|
| 362 |
+
'elliptic_k', 'elliptic_f', 'elliptic_e', 'elliptic_pi', 'beta',
|
| 363 |
+
'mathieus', 'mathieuc', 'mathieusprime', 'mathieucprime', 'riemann_xi','betainc',
|
| 364 |
+
'betainc_regularized',
|
| 365 |
+
|
| 366 |
+
# sympy.ntheory
|
| 367 |
+
'nextprime', 'prevprime', 'prime', 'primerange', 'randprime',
|
| 368 |
+
'Sieve', 'sieve', 'primorial', 'cycle_length', 'composite', 'compositepi',
|
| 369 |
+
'isprime', 'divisors', 'proper_divisors', 'factorint', 'multiplicity',
|
| 370 |
+
'perfect_power', 'pollard_pm1', 'pollard_rho', 'primefactors',
|
| 371 |
+
'divisor_count', 'proper_divisor_count',
|
| 372 |
+
'factorrat',
|
| 373 |
+
'mersenne_prime_exponent', 'is_perfect', 'is_mersenne_prime',
|
| 374 |
+
'is_abundant', 'is_deficient', 'is_amicable', 'is_carmichael', 'abundance',
|
| 375 |
+
'npartitions',
|
| 376 |
+
'is_primitive_root', 'is_quad_residue',
|
| 377 |
+
'n_order', 'sqrt_mod', 'quadratic_residues',
|
| 378 |
+
'primitive_root', 'nthroot_mod', 'is_nthpow_residue', 'sqrt_mod_iter',
|
| 379 |
+
'discrete_log', 'quadratic_congruence', 'binomial_coefficients',
|
| 380 |
+
'binomial_coefficients_list', 'multinomial_coefficients',
|
| 381 |
+
'continued_fraction_periodic', 'continued_fraction_iterator',
|
| 382 |
+
'continued_fraction_reduce', 'continued_fraction_convergents',
|
| 383 |
+
'continued_fraction', 'egyptian_fraction',
|
| 384 |
+
|
| 385 |
+
# sympy.concrete
|
| 386 |
+
'product', 'Product', 'summation', 'Sum',
|
| 387 |
+
|
| 388 |
+
# sympy.discrete
|
| 389 |
+
'fft', 'ifft', 'ntt', 'intt', 'fwht', 'ifwht', 'mobius_transform',
|
| 390 |
+
'inverse_mobius_transform', 'convolution', 'covering_product',
|
| 391 |
+
'intersecting_product',
|
| 392 |
+
|
| 393 |
+
# sympy.simplify
|
| 394 |
+
'simplify', 'hypersimp', 'hypersimilar', 'logcombine', 'separatevars',
|
| 395 |
+
'posify', 'besselsimp', 'kroneckersimp', 'signsimp',
|
| 396 |
+
'nsimplify', 'FU', 'fu', 'sqrtdenest', 'cse', 'epath', 'EPath',
|
| 397 |
+
'hyperexpand', 'collect', 'rcollect', 'radsimp', 'collect_const',
|
| 398 |
+
'fraction', 'numer', 'denom', 'trigsimp', 'exptrigsimp', 'powsimp',
|
| 399 |
+
'powdenest', 'combsimp', 'gammasimp', 'ratsimp', 'ratsimpmodprime',
|
| 400 |
+
|
| 401 |
+
# sympy.sets
|
| 402 |
+
'Set', 'Interval', 'Union', 'EmptySet', 'FiniteSet', 'ProductSet',
|
| 403 |
+
'Intersection', 'imageset', 'DisjointUnion', 'Complement', 'SymmetricDifference',
|
| 404 |
+
'ImageSet', 'Range', 'ComplexRegion', 'Reals', 'Contains', 'ConditionSet',
|
| 405 |
+
'Ordinal', 'OmegaPower', 'ord0', 'PowerSet', 'Naturals',
|
| 406 |
+
'Naturals0', 'UniversalSet', 'Integers', 'Rationals', 'Complexes',
|
| 407 |
+
|
| 408 |
+
# sympy.solvers
|
| 409 |
+
'solve', 'solve_linear_system', 'solve_linear_system_LU',
|
| 410 |
+
'solve_undetermined_coeffs', 'nsolve', 'solve_linear', 'checksol',
|
| 411 |
+
'det_quick', 'inv_quick', 'check_assumptions', 'failing_assumptions',
|
| 412 |
+
'diophantine', 'rsolve', 'rsolve_poly', 'rsolve_ratio', 'rsolve_hyper',
|
| 413 |
+
'checkodesol', 'classify_ode', 'dsolve', 'homogeneous_order',
|
| 414 |
+
'solve_poly_system', 'solve_triangulated', 'pde_separate',
|
| 415 |
+
'pde_separate_add', 'pde_separate_mul', 'pdsolve', 'classify_pde',
|
| 416 |
+
'checkpdesol', 'ode_order', 'reduce_inequalities',
|
| 417 |
+
'reduce_abs_inequality', 'reduce_abs_inequalities',
|
| 418 |
+
'solve_poly_inequality', 'solve_rational_inequalities',
|
| 419 |
+
'solve_univariate_inequality', 'decompogen', 'solveset', 'linsolve',
|
| 420 |
+
'linear_eq_to_matrix', 'nonlinsolve', 'substitution',
|
| 421 |
+
|
| 422 |
+
# sympy.matrices
|
| 423 |
+
'ShapeError', 'NonSquareMatrixError', 'GramSchmidt', 'casoratian', 'diag',
|
| 424 |
+
'eye', 'hessian', 'jordan_cell', 'list2numpy', 'matrix2numpy',
|
| 425 |
+
'matrix_multiply_elementwise', 'ones', 'randMatrix', 'rot_axis1',
|
| 426 |
+
'rot_axis2', 'rot_axis3', 'symarray', 'wronskian', 'zeros',
|
| 427 |
+
'MutableDenseMatrix', 'DeferredVector', 'MatrixBase', 'Matrix',
|
| 428 |
+
'MutableMatrix', 'MutableSparseMatrix', 'banded', 'ImmutableDenseMatrix',
|
| 429 |
+
'ImmutableSparseMatrix', 'ImmutableMatrix', 'SparseMatrix', 'MatrixSlice',
|
| 430 |
+
'BlockDiagMatrix', 'BlockMatrix', 'FunctionMatrix', 'Identity', 'Inverse',
|
| 431 |
+
'MatAdd', 'MatMul', 'MatPow', 'MatrixExpr', 'MatrixSymbol', 'Trace',
|
| 432 |
+
'Transpose', 'ZeroMatrix', 'OneMatrix', 'blockcut', 'block_collapse',
|
| 433 |
+
'matrix_symbols', 'Adjoint', 'hadamard_product', 'HadamardProduct',
|
| 434 |
+
'HadamardPower', 'Determinant', 'det', 'diagonalize_vector', 'DiagMatrix',
|
| 435 |
+
'DiagonalMatrix', 'DiagonalOf', 'trace', 'DotProduct',
|
| 436 |
+
'kronecker_product', 'KroneckerProduct', 'PermutationMatrix',
|
| 437 |
+
'MatrixPermute', 'Permanent', 'per', 'rot_ccw_axis1', 'rot_ccw_axis2',
|
| 438 |
+
'rot_ccw_axis3', 'rot_givens',
|
| 439 |
+
|
| 440 |
+
# sympy.geometry
|
| 441 |
+
'Point', 'Point2D', 'Point3D', 'Line', 'Ray', 'Segment', 'Line2D',
|
| 442 |
+
'Segment2D', 'Ray2D', 'Line3D', 'Segment3D', 'Ray3D', 'Plane', 'Ellipse',
|
| 443 |
+
'Circle', 'Polygon', 'RegularPolygon', 'Triangle', 'rad', 'deg',
|
| 444 |
+
'are_similar', 'centroid', 'convex_hull', 'idiff', 'intersection',
|
| 445 |
+
'closest_points', 'farthest_points', 'GeometryError', 'Curve', 'Parabola',
|
| 446 |
+
|
| 447 |
+
# sympy.utilities
|
| 448 |
+
'flatten', 'group', 'take', 'subsets', 'variations', 'numbered_symbols',
|
| 449 |
+
'cartes', 'capture', 'dict_merge', 'prefixes', 'postfixes', 'sift',
|
| 450 |
+
'topological_sort', 'unflatten', 'has_dups', 'has_variety', 'reshape',
|
| 451 |
+
'rotations', 'filldedent', 'lambdify', 'threaded', 'xthreaded',
|
| 452 |
+
'public', 'memoize_property', 'timed',
|
| 453 |
+
|
| 454 |
+
# sympy.integrals
|
| 455 |
+
'integrate', 'Integral', 'line_integrate', 'mellin_transform',
|
| 456 |
+
'inverse_mellin_transform', 'MellinTransform', 'InverseMellinTransform',
|
| 457 |
+
'laplace_transform', 'inverse_laplace_transform', 'LaplaceTransform',
|
| 458 |
+
'laplace_correspondence', 'laplace_initial_conds',
|
| 459 |
+
'InverseLaplaceTransform', 'fourier_transform',
|
| 460 |
+
'inverse_fourier_transform', 'FourierTransform',
|
| 461 |
+
'InverseFourierTransform', 'sine_transform', 'inverse_sine_transform',
|
| 462 |
+
'SineTransform', 'InverseSineTransform', 'cosine_transform',
|
| 463 |
+
'inverse_cosine_transform', 'CosineTransform', 'InverseCosineTransform',
|
| 464 |
+
'hankel_transform', 'inverse_hankel_transform', 'HankelTransform',
|
| 465 |
+
'InverseHankelTransform', 'singularityintegrate',
|
| 466 |
+
|
| 467 |
+
# sympy.tensor
|
| 468 |
+
'IndexedBase', 'Idx', 'Indexed', 'get_contraction_structure',
|
| 469 |
+
'get_indices', 'shape', 'MutableDenseNDimArray', 'ImmutableDenseNDimArray',
|
| 470 |
+
'MutableSparseNDimArray', 'ImmutableSparseNDimArray', 'NDimArray',
|
| 471 |
+
'tensorproduct', 'tensorcontraction', 'tensordiagonal', 'derive_by_array',
|
| 472 |
+
'permutedims', 'Array', 'DenseNDimArray', 'SparseNDimArray',
|
| 473 |
+
|
| 474 |
+
# sympy.parsing
|
| 475 |
+
'parse_expr',
|
| 476 |
+
|
| 477 |
+
# sympy.calculus
|
| 478 |
+
'euler_equations', 'singularities', 'is_increasing',
|
| 479 |
+
'is_strictly_increasing', 'is_decreasing', 'is_strictly_decreasing',
|
| 480 |
+
'is_monotonic', 'finite_diff_weights', 'apply_finite_diff',
|
| 481 |
+
'differentiate_finite', 'periodicity', 'not_empty_in',
|
| 482 |
+
'AccumBounds', 'is_convex', 'stationary_points', 'minimum', 'maximum',
|
| 483 |
+
|
| 484 |
+
# sympy.algebras
|
| 485 |
+
'Quaternion',
|
| 486 |
+
|
| 487 |
+
# sympy.printing
|
| 488 |
+
'pager_print', 'pretty', 'pretty_print', 'pprint', 'pprint_use_unicode',
|
| 489 |
+
'pprint_try_use_unicode', 'latex', 'print_latex', 'multiline_latex',
|
| 490 |
+
'mathml', 'print_mathml', 'python', 'print_python', 'pycode', 'ccode',
|
| 491 |
+
'print_ccode', 'smtlib_code', 'glsl_code', 'print_glsl', 'cxxcode', 'fcode',
|
| 492 |
+
'print_fcode', 'rcode', 'print_rcode', 'jscode', 'print_jscode',
|
| 493 |
+
'julia_code', 'mathematica_code', 'octave_code', 'rust_code', 'print_gtk',
|
| 494 |
+
'preview', 'srepr', 'print_tree', 'StrPrinter', 'sstr', 'sstrrepr',
|
| 495 |
+
'TableForm', 'dotprint', 'maple_code', 'print_maple_code',
|
| 496 |
+
|
| 497 |
+
# sympy.plotting
|
| 498 |
+
'plot', 'textplot', 'plot_backends', 'plot_implicit', 'plot_parametric',
|
| 499 |
+
|
| 500 |
+
# sympy.interactive
|
| 501 |
+
'init_session', 'init_printing', 'interactive_traversal',
|
| 502 |
+
|
| 503 |
+
# sympy.testing
|
| 504 |
+
'test', 'doctest',
|
| 505 |
+
]
|
| 506 |
+
|
| 507 |
+
|
| 508 |
+
#===========================================================================#
|
| 509 |
+
# #
|
| 510 |
+
# XXX: The names below were importable before SymPy 1.6 using #
|
| 511 |
+
# #
|
| 512 |
+
# from sympy import * #
|
| 513 |
+
# #
|
| 514 |
+
# This happened implicitly because there was no __all__ defined in this #
|
| 515 |
+
# __init__.py file. Not every package is imported. The list matches what #
|
| 516 |
+
# would have been imported before. It is possible that these packages will #
|
| 517 |
+
# not be imported by a star-import from sympy in future. #
|
| 518 |
+
# #
|
| 519 |
+
#===========================================================================#
|
| 520 |
+
|
| 521 |
+
|
| 522 |
+
__all__.extend((
|
| 523 |
+
'algebras',
|
| 524 |
+
'assumptions',
|
| 525 |
+
'calculus',
|
| 526 |
+
'concrete',
|
| 527 |
+
'discrete',
|
| 528 |
+
'external',
|
| 529 |
+
'functions',
|
| 530 |
+
'geometry',
|
| 531 |
+
'interactive',
|
| 532 |
+
'multipledispatch',
|
| 533 |
+
'ntheory',
|
| 534 |
+
'parsing',
|
| 535 |
+
'plotting',
|
| 536 |
+
'polys',
|
| 537 |
+
'printing',
|
| 538 |
+
'release',
|
| 539 |
+
'strategies',
|
| 540 |
+
'tensor',
|
| 541 |
+
'utilities',
|
| 542 |
+
))
|
deepseekvl2/lib/python3.10/site-packages/sympy/abc.py
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
This module exports all latin and greek letters as Symbols, so you can
|
| 3 |
+
conveniently do
|
| 4 |
+
|
| 5 |
+
>>> from sympy.abc import x, y
|
| 6 |
+
|
| 7 |
+
instead of the slightly more clunky-looking
|
| 8 |
+
|
| 9 |
+
>>> from sympy import symbols
|
| 10 |
+
>>> x, y = symbols('x y')
|
| 11 |
+
|
| 12 |
+
Caveats
|
| 13 |
+
=======
|
| 14 |
+
|
| 15 |
+
1. As of the time of writing this, the names ``O``, ``S``, ``I``, ``N``,
|
| 16 |
+
``E``, and ``Q`` are colliding with names defined in SymPy. If you import them
|
| 17 |
+
from both ``sympy.abc`` and ``sympy``, the second import will "win".
|
| 18 |
+
This is an issue only for * imports, which should only be used for short-lived
|
| 19 |
+
code such as interactive sessions and throwaway scripts that do not survive
|
| 20 |
+
until the next SymPy upgrade, where ``sympy`` may contain a different set of
|
| 21 |
+
names.
|
| 22 |
+
|
| 23 |
+
2. This module does not define symbol names on demand, i.e.
|
| 24 |
+
``from sympy.abc import foo`` will be reported as an error because
|
| 25 |
+
``sympy.abc`` does not contain the name ``foo``. To get a symbol named ``foo``,
|
| 26 |
+
you still need to use ``Symbol('foo')`` or ``symbols('foo')``.
|
| 27 |
+
You can freely mix usage of ``sympy.abc`` and ``Symbol``/``symbols``, though
|
| 28 |
+
sticking with one and only one way to get the symbols does tend to make the code
|
| 29 |
+
more readable.
|
| 30 |
+
|
| 31 |
+
The module also defines some special names to help detect which names clash
|
| 32 |
+
with the default SymPy namespace.
|
| 33 |
+
|
| 34 |
+
``_clash1`` defines all the single letter variables that clash with
|
| 35 |
+
SymPy objects; ``_clash2`` defines the multi-letter clashing symbols;
|
| 36 |
+
and ``_clash`` is the union of both. These can be passed for ``locals``
|
| 37 |
+
during sympification if one desires Symbols rather than the non-Symbol
|
| 38 |
+
objects for those names.
|
| 39 |
+
|
| 40 |
+
Examples
|
| 41 |
+
========
|
| 42 |
+
|
| 43 |
+
>>> from sympy import S
|
| 44 |
+
>>> from sympy.abc import _clash1, _clash2, _clash
|
| 45 |
+
>>> S("Q & C", locals=_clash1)
|
| 46 |
+
C & Q
|
| 47 |
+
>>> S('pi(x)', locals=_clash2)
|
| 48 |
+
pi(x)
|
| 49 |
+
>>> S('pi(C, Q)', locals=_clash)
|
| 50 |
+
pi(C, Q)
|
| 51 |
+
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
+
from typing import Any, Dict as tDict
|
| 55 |
+
|
| 56 |
+
import string
|
| 57 |
+
|
| 58 |
+
from .core import Symbol, symbols
|
| 59 |
+
from .core.alphabets import greeks
|
| 60 |
+
from sympy.parsing.sympy_parser import null
|
| 61 |
+
|
| 62 |
+
##### Symbol definitions #####
|
| 63 |
+
|
| 64 |
+
# Implementation note: The easiest way to avoid typos in the symbols()
|
| 65 |
+
# parameter is to copy it from the left-hand side of the assignment.
|
| 66 |
+
|
| 67 |
+
a, b, c, d, e, f, g, h, i, j = symbols('a, b, c, d, e, f, g, h, i, j')
|
| 68 |
+
k, l, m, n, o, p, q, r, s, t = symbols('k, l, m, n, o, p, q, r, s, t')
|
| 69 |
+
u, v, w, x, y, z = symbols('u, v, w, x, y, z')
|
| 70 |
+
|
| 71 |
+
A, B, C, D, E, F, G, H, I, J = symbols('A, B, C, D, E, F, G, H, I, J')
|
| 72 |
+
K, L, M, N, O, P, Q, R, S, T = symbols('K, L, M, N, O, P, Q, R, S, T')
|
| 73 |
+
U, V, W, X, Y, Z = symbols('U, V, W, X, Y, Z')
|
| 74 |
+
|
| 75 |
+
alpha, beta, gamma, delta = symbols('alpha, beta, gamma, delta')
|
| 76 |
+
epsilon, zeta, eta, theta = symbols('epsilon, zeta, eta, theta')
|
| 77 |
+
iota, kappa, lamda, mu = symbols('iota, kappa, lamda, mu')
|
| 78 |
+
nu, xi, omicron, pi = symbols('nu, xi, omicron, pi')
|
| 79 |
+
rho, sigma, tau, upsilon = symbols('rho, sigma, tau, upsilon')
|
| 80 |
+
phi, chi, psi, omega = symbols('phi, chi, psi, omega')
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
##### Clashing-symbols diagnostics #####
|
| 84 |
+
|
| 85 |
+
# We want to know which names in SymPy collide with those in here.
|
| 86 |
+
# This is mostly for diagnosing SymPy's namespace during SymPy development.
|
| 87 |
+
|
| 88 |
+
_latin = list(string.ascii_letters)
|
| 89 |
+
# QOSINE should not be imported as they clash; gamma, pi and zeta clash, too
|
| 90 |
+
_greek = list(greeks) # make a copy, so we can mutate it
|
| 91 |
+
# Note: We import lamda since lambda is a reserved keyword in Python
|
| 92 |
+
_greek.remove("lambda")
|
| 93 |
+
_greek.append("lamda")
|
| 94 |
+
|
| 95 |
+
ns: tDict[str, Any] = {}
|
| 96 |
+
exec('from sympy import *', ns)
|
| 97 |
+
_clash1: tDict[str, Any] = {}
|
| 98 |
+
_clash2: tDict[str, Any] = {}
|
| 99 |
+
while ns:
|
| 100 |
+
_k, _ = ns.popitem()
|
| 101 |
+
if _k in _greek:
|
| 102 |
+
_clash2[_k] = null
|
| 103 |
+
_greek.remove(_k)
|
| 104 |
+
elif _k in _latin:
|
| 105 |
+
_clash1[_k] = null
|
| 106 |
+
_latin.remove(_k)
|
| 107 |
+
_clash = {}
|
| 108 |
+
_clash.update(_clash1)
|
| 109 |
+
_clash.update(_clash2)
|
| 110 |
+
|
| 111 |
+
del _latin, _greek, Symbol, _k, null
|
deepseekvl2/lib/python3.10/site-packages/sympy/conftest.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
|
| 3 |
+
sys._running_pytest = True # type: ignore
|
| 4 |
+
from sympy.external.importtools import version_tuple
|
| 5 |
+
|
| 6 |
+
import pytest
|
| 7 |
+
from sympy.core.cache import clear_cache, USE_CACHE
|
| 8 |
+
from sympy.external.gmpy import GROUND_TYPES
|
| 9 |
+
from sympy.utilities.misc import ARCH
|
| 10 |
+
import re
|
| 11 |
+
|
| 12 |
+
try:
|
| 13 |
+
import hypothesis
|
| 14 |
+
|
| 15 |
+
hypothesis.settings.register_profile("sympy_hypothesis_profile", deadline=None)
|
| 16 |
+
hypothesis.settings.load_profile("sympy_hypothesis_profile")
|
| 17 |
+
except ImportError:
|
| 18 |
+
raise ImportError(
|
| 19 |
+
"hypothesis is a required dependency to run the SymPy test suite. "
|
| 20 |
+
"Install it with 'pip install hypothesis' or 'conda install -c conda-forge hypothesis'"
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
sp = re.compile(r"([0-9]+)/([1-9][0-9]*)")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def process_split(config, items):
|
| 28 |
+
split = config.getoption("--split")
|
| 29 |
+
if not split:
|
| 30 |
+
return
|
| 31 |
+
m = sp.match(split)
|
| 32 |
+
if not m:
|
| 33 |
+
raise ValueError(
|
| 34 |
+
"split must be a string of the form a/b " "where a and b are ints."
|
| 35 |
+
)
|
| 36 |
+
i, t = map(int, m.groups())
|
| 37 |
+
start, end = (i - 1) * len(items) // t, i * len(items) // t
|
| 38 |
+
|
| 39 |
+
if i < t:
|
| 40 |
+
# remove elements from end of list first
|
| 41 |
+
del items[end:]
|
| 42 |
+
del items[:start]
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def pytest_report_header(config):
|
| 46 |
+
s = "architecture: %s\n" % ARCH
|
| 47 |
+
s += "cache: %s\n" % USE_CACHE
|
| 48 |
+
version = ""
|
| 49 |
+
if GROUND_TYPES == "gmpy":
|
| 50 |
+
import gmpy2
|
| 51 |
+
|
| 52 |
+
version = gmpy2.version()
|
| 53 |
+
elif GROUND_TYPES == "flint":
|
| 54 |
+
try:
|
| 55 |
+
from flint import __version__
|
| 56 |
+
except ImportError:
|
| 57 |
+
version = "unknown"
|
| 58 |
+
else:
|
| 59 |
+
version = f'(python-flint=={__version__})'
|
| 60 |
+
s += "ground types: %s %s\n" % (GROUND_TYPES, version)
|
| 61 |
+
return s
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def pytest_terminal_summary(terminalreporter):
|
| 65 |
+
if terminalreporter.stats.get("error", None) or terminalreporter.stats.get(
|
| 66 |
+
"failed", None
|
| 67 |
+
):
|
| 68 |
+
terminalreporter.write_sep(" ", "DO *NOT* COMMIT!", red=True, bold=True)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def pytest_addoption(parser):
|
| 72 |
+
parser.addoption("--split", action="store", default="", help="split tests")
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def pytest_collection_modifyitems(config, items):
|
| 76 |
+
"""pytest hook."""
|
| 77 |
+
# handle splits
|
| 78 |
+
process_split(config, items)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
@pytest.fixture(autouse=True, scope="module")
|
| 82 |
+
def file_clear_cache():
|
| 83 |
+
clear_cache()
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
@pytest.fixture(autouse=True, scope="module")
|
| 87 |
+
def check_disabled(request):
|
| 88 |
+
if getattr(request.module, "disabled", False):
|
| 89 |
+
pytest.skip("test requirements not met.")
|
| 90 |
+
elif getattr(request.module, "ipython", False):
|
| 91 |
+
# need to check version and options for ipython tests
|
| 92 |
+
if (
|
| 93 |
+
version_tuple(pytest.__version__) < version_tuple("2.6.3")
|
| 94 |
+
and pytest.config.getvalue("-s") != "no"
|
| 95 |
+
):
|
| 96 |
+
pytest.skip("run py.test with -s or upgrade to newer version.")
|
deepseekvl2/lib/python3.10/site-packages/sympy/discrete/__init__.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""This module contains functions which operate on discrete sequences.
|
| 2 |
+
|
| 3 |
+
Transforms - ``fft``, ``ifft``, ``ntt``, ``intt``, ``fwht``, ``ifwht``,
|
| 4 |
+
``mobius_transform``, ``inverse_mobius_transform``
|
| 5 |
+
|
| 6 |
+
Convolutions - ``convolution``, ``convolution_fft``, ``convolution_ntt``,
|
| 7 |
+
``convolution_fwht``, ``convolution_subset``,
|
| 8 |
+
``covering_product``, ``intersecting_product``
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from .transforms import (fft, ifft, ntt, intt, fwht, ifwht,
|
| 12 |
+
mobius_transform, inverse_mobius_transform)
|
| 13 |
+
from .convolutions import convolution, covering_product, intersecting_product
|
| 14 |
+
|
| 15 |
+
__all__ = [
|
| 16 |
+
'fft', 'ifft', 'ntt', 'intt', 'fwht', 'ifwht', 'mobius_transform',
|
| 17 |
+
'inverse_mobius_transform',
|
| 18 |
+
|
| 19 |
+
'convolution', 'covering_product', 'intersecting_product',
|
| 20 |
+
]
|
deepseekvl2/lib/python3.10/site-packages/sympy/discrete/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (944 Bytes). View file
|
|
|
deepseekvl2/lib/python3.10/site-packages/sympy/discrete/__pycache__/convolutions.cpython-310.pyc
ADDED
|
Binary file (16.2 kB). View file
|
|
|